Skip to content

Improve array memory releasing mechanism #174

@bpalak

Description

@bpalak

An array can have various memory management policy: duplicate, neverDelete, deleteWhenDone...
Calling array.free(), doesn't release memory of array having neverDelete policy.
Unfortunately there is no way to check what policy was used at array creation time, so it cannot be determined if array data should be released manually or not. Moreover, array.free() nullifies a pointer to data even if memory was not automatically deallocated.
Potential solutions:
A) (the simples one) to not nullify _data private variable if memory was not automatically deallocated. After calling array.free(), user may check if pointer is valid - if so, memory can be freed manually.
B) to expose memory policy via array method to provide user knowledge if an array must be deallocated manually

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