summaryrefslogtreecommitdiff
path: root/buddy.h
diff options
context:
space:
mode:
authorMatthew Sotoudeh <matthew@masot.net>2024-05-16 10:39:47 -0700
committerMatthew Sotoudeh <matthew@masot.net>2024-05-16 10:39:47 -0700
commit35674243f07216ce94c2680fde13ee9df48d766c (patch)
tree994a678e6385d750731afe2ca71e1911c21db797 /buddy.h
parenteb0bb6e38beff1517453502f78c1df994e4bb48c (diff)
support for moving the allocation pool
Diffstat (limited to 'buddy.h')
-rw-r--r--buddy.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/buddy.h b/buddy.h
index 0b4de09..ad4f4aa 100644
--- a/buddy.h
+++ b/buddy.h
@@ -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);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback