Skip to content

Should nc_free_vlens be called in cases when it doesn't work? #2078

@krisfed

Description

@krisfed

It is documented that nc_free_vlens() works only when the base type of NC_VLEN is an atomic type (excluding NC_STRING), or an NC_ENUM, or an NC_OPAQUE.

(At least that's how I am interpreting this part of the doc, which is a bit confusingly phrased:

WARNING: this code is incorrect because it will only work if the basetype of the vlen is
atomic
+ enum
+ opaque
excluding string basetype,

The reason is that to operate properly, it needs to recurse when the basetype is a complex object such as another vlen or compound.

)

What is the best practice for situations when nc_free_vlens() is not supposed to work? Should calling it be avoided in the cases when we know it won't quite work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions