capablevms / CHERI-ELF-comp

Other
4 stars 1 forks source link

Improve memory allocator #35

Closed 0152la closed 2 months ago

0152la commented 2 months ago

Implement a memory allocator which can free, rather than the simple bump allocator we had before.

For each allocation, we additionally save the size of the allocation, and a pointer to the next allocation (an extra sizeof(size_t) + sizeof(void*) (or 16) bytes) in the preamble of the allocation. We can then use this to find how much to free, and to fight blocks large enough that fit future allocation (nothing too smart regarding compaction or fragmentation).

Also prepare init_test.py, which sets the CI testing environment, for the addition of test lua_suite_some.c (currently still broken).

ltratt commented 2 months ago

fight blocks

Harsh but fair? ;) I assume "find" might be more appropriate?

0152la commented 2 months ago

fight blocks

Harsh but fair? ;) I assume "find" might be more appropriate?

You're right. Want me to edit the PR text? Or copy that amended description somewhere else, i.e., in the code as a comment, or the commit message?

ltratt commented 2 months ago

Please force push an update to the commit message.

0152la commented 2 months ago

The commit message is just

Implement a memory allocator which can free, rather than the simple bump allocator we had before.

Do you mean you'd prefer I update the commit message with the first message in this PR?

ltratt commented 2 months ago

Ah, ignore me! It's fine as-is.