Skip to content

Conversation

TriedAngle
Copy link

addresses the problem and ideas of #106 for mempool alloc and free

currently realloc is not supported yet

* mod: Disable memcpy interposition by default

Signed-off-by: Diogo Behrens <[email protected]>

* cicd: Trigger pipeline on pull requests

Signed-off-by: Diogo Behrens <[email protected]>

* cicd: Enable memcpy interposition where safe

Signed-off-by: Diogo Behrens <[email protected]>

---------

Signed-off-by: Diogo Behrens <[email protected]>
Signed-off-by: Sebastian Strobl <[email protected]>
size_t size = n + sizeof(entry_t);
unsigned bucket = _bucketize(size);
size = _sizes[bucket];
#ifdef ALLOC_STRICT_ALIGN8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can always use the align_up macro and redefine it to by identity when the alignment is not set.


#define MEMPOOL_SIZE (1024 * 1024 * 200)

#ifdef ALLOC_STRICT_ALIGN8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rename this as MEMPOOL_ALLOC_ALIGN8 ?

@db7
Copy link
Member

db7 commented Oct 20, 2025

Please create a simple test case in test/mempool/alignment.c which links with mempool compiled with the option and then allocates something and ensure the aligment.

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.

2 participants