diff options
author | Matthew Sotoudeh <matthew@masot.net> | 2024-05-16 10:39:47 -0700 |
---|---|---|
committer | Matthew Sotoudeh <matthew@masot.net> | 2024-05-16 10:39:47 -0700 |
commit | 35674243f07216ce94c2680fde13ee9df48d766c (patch) | |
tree | 994a678e6385d750731afe2ca71e1911c21db797 /buddy.h | |
parent | eb0bb6e38beff1517453502f78c1df994e4bb48c (diff) |
support for moving the allocation pool
Diffstat (limited to 'buddy.h')
-rw-r--r-- | buddy.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -24,3 +24,8 @@ void debug_buddy(struct buddy *state); void *reallocate(void *old, size_t old_size, size_t new_size, struct buddy *state); int reserve(void *start, size_t size, struct buddy *state); + +// grow can also be used to move the buddy. grow can never fail. +void grow_buddy(uint8_t *new_base, size_t new_size, struct buddy *state); +// 0 -> failure. always in-place. to do out-of-place, first shrink then grow. +int shrink_buddy(size_t new_size, struct buddy *state); |