summaryrefslogtreecommitdiff
path: root/magic_buddy.c
diff options
context:
space:
mode:
authorMatthew Sotoudeh <matthew@masot.net>2024-05-16 11:15:19 -0700
committerMatthew Sotoudeh <matthew@masot.net>2024-05-16 11:15:19 -0700
commit964fea7500f4bcba3bf2629e959df415ee0ce48f (patch)
treedc3a05c779fb66f427fab5113ca70f0227862e94 /magic_buddy.c
parent35674243f07216ce94c2680fde13ee9df48d766c (diff)
more documentation
Diffstat (limited to 'magic_buddy.c')
-rw-r--r--magic_buddy.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/magic_buddy.c b/magic_buddy.c
index a741132..1e88c21 100644
--- a/magic_buddy.c
+++ b/magic_buddy.c
@@ -311,3 +311,11 @@ int shrink_buddy(size_t new_size, struct buddy *state) {
state->root_logsize = logsize;
return 1;
}
+
+void move_buddy(struct buddy *new_state, struct buddy *old_state) {
+ memcpy(new_state, old_state, sizeof(struct buddy));
+ for (size_t i = 0; i < ADDRESS_BITS; i++) {
+ if (!new_state->avail[i]) continue;
+ new_state->avail[i]->pprev = &(new_state->avail[i]);
+ }
+}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback