Skip to content

Release function for parsec_object_t #724

@devreal

Description

@devreal

Description

With #694 the GPU task structure becomes a proper PaRSEC object and carefully avoid calling PARSEC_OBJ_RELEASE on it to avoid freeing it explicitly and instead add a callback to free it. The regular task structure is already an object but we don't really utilize the object management macros because we want to utilize free lists, so we have a dedicated callback for its release. Data copies have to be heap allocated because they are freed so we cannot use free lists for them.

Describe the solution you'd like

Instead of calling free in PARSEC_OBJ_RELEASE we should unify the above approaches and add a release callback to the parsec_object_t that allows the entity allocating it to determine the way it should be freed. Then we can PARSEC_OBJ_RELEASE the object and the object will go back where it came from, e.g., a free-list. This avoids the careful dance we do with parsec_task_t and parsec_gpu_task_t and would allow the use of free lists for parsec_data_copy_t.

Describe alternatives you've considered

The current approach of type-specific deallocators is fragile and does not cover all objects that could benefit from non-standard allocation methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions