Releases: spaskalev/buddy_alloc
Releases · spaskalev/buddy_alloc
v1.2.0
- Add a new
buddy_get_embed_at
function to get a handle to the allocator when having a pointer to the arena. - Add a new
enum buddy_safe_free_status
that is returned from thebuddy_safe_free
function. It can be used to detect invalid free calls and fail early. - Document the allocator metadata size based on some common arena and smallest allocation block sizes.
v1.1.1
v1.1.0
v1.0.0
External changes:
buddy_walk
callback is now invoked for free slots in addition to allocated ones and has an extra parameter to distinguish between free and allocated.buddy_fragmentation
return type is now anunsigned char
that ranges between 0 and 255 and nofloat
types are used. This way fragmentation can be reported when used in environments that don't support thefloat
type.
Internal changes:
- A static inline
two_to_the_power_of
helper function that returnssize_t
is used in place of manual power of two calculations. - The fast square root algorithm used in the fragmentation formula has been replaced with an integer square root algorithm by Martin Guy, 1985.
Misc:
Two years and nine months have passed since this project started and it has now reached the 1.0.0
milestone. Thanks to all contributors and users for their interest in it.
v0.9
- Remove FAMs and
{0}
initializers to facilitate interop with strict C++ compilers- Clang generates identical code with FAMs and without FAMs
- GCC generates almost-identical code
- Make the debug functions non-static so that they can be used by code in other units
- Include
stdio.h
only whenBUDDY_PRINTF
is not defined - Add a macro for C++ name mangling
v0.8
- The allocator is now easier to use within a linux kernel/module.
- Conforms to the c90-style variable declarations in functions
- New defines
BUDDY_PRINTF
,BUDDY_HEADER
andBUDDY_FRAG_OPTIONAL
added to allow conditional inclusion of functionality and setting a suitable printf-like function for the debug functions.
- Fixed some issues with explicit alignment init functions
- Fixed UB on invalid free calls
v0.7.2
v0.7.1
This is a significant performance update achieved by reducing the number of tree reads during allocation.
Running bench.c
using gcc -O2
on v0.7 takes 20 seconds vs 16 seconds on v0.7.1
Running bench.c
using clang -O3
on v0.7 takes 16 seconds vs 13 seconds on v0.7.1
v0.7
- Add
buddy_arena_free_size
that reports the remaining free space in the arena.
Note that this is a sum of all slots and not necessarily continuous memory. - Support setting alignment as an argument to init and sizeof functions.
This way an application can use multiple allocator instances with different alignments. TheBUDDY_ALLOC_ALIGN
define is still supported.
This is a change in the internal structure of the allocator which can impact serialized instances. There's no impact to regular users. - Always use the optimal fit algorithm, drop support for the left-bias one.
- Drop the
BUDDY_ALLOC_SAFETY
define, always use safety checks. - Jump to version v0.7. v0.6 was a botched release that was deleted