Skip to content

Conversation

@devreal
Copy link
Contributor

@devreal devreal commented Feb 10, 2025

By default, objects created through PARSEC_OBJ_NEW will be free'd in the callback, objects constructed through PARSEC_OBJ_CONSTRUCT will only be destructed. Users/applications can provide their own release callback through
PARSEC_OBJ_RELEASE_CONSTRUCT.

Mempools break the PaRSEC object model. To store the mempool origin, a list item and an offset stored in the mempool that points to the mempool from where the item was allocated. We should consider adding a type parsec_mempool_item_t that stores the origin mempool. Then the release callback invoked from PARSEC_OBJ_RELEASE can put the object back into the mempool.

Yes, this adds 8B to the parsec_object_t but in today's world that is negligible and is outweighed by the benefits of having a more flexible object model.

Alternative to #726 and #728.

@devreal devreal requested a review from a team as a code owner February 10, 2025 13:28
By default, objects created through `PARSEC_OBJ_NEW`
will  be free'd in the callback, objects constructed through
`PARSEC_OBJ_CONSTRUCT` will only be destructed. Users/applications
can provide their own release callback through
`PARSEC_OBJ_RELEASE_CONSTRUCT`.

Mempools break the PaRSEC object model. To store the mempool origin,
a list item and an offset stored in the mempool that points to the
mempool from where the item was allocated. We should consider adding
a type `parsec_mempool_item_t` that stores the origin mempool.
Then the release callback invoked from `PARSEC_OBJ_RELEASE` can put the
object back into the mempool.

Yes, this adds 8B to the `parsec_object_t` but in today's world that is
negligible and is outweighed by the benefits of having a more flexible
object model.

Signed-off-by: Joseph Schuchart <[email protected]>
@devreal devreal force-pushed the parsec-object-release branch from 3c2baf2 to 24867d0 Compare February 13, 2025 00:32
@abouteiller abouteiller merged commit c7e719c into ICLDisco:master Feb 21, 2025
4 checks passed
@bosilca
Copy link
Contributor

bosilca commented Feb 24, 2025

Sorry but merging this was a bad idea. This is not a proper object approach, it basically destroy the beauty of the parsec object system for a single 'it works for me case'.

bosilca added a commit to bosilca/parsec that referenced this pull request Feb 24, 2025
bosilca added a commit to bosilca/parsec that referenced this pull request Feb 24, 2025
@devreal
Copy link
Contributor Author

devreal commented Feb 24, 2025

Feel free to revert. TTG is on a fork now, I'll make it work there.

@abouteiller abouteiller added this to the v4.1 milestone Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants