aboutsummaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/buffer.c b/buffer.c
index 92b10e5..f548e9f 100644
--- a/buffer.c
+++ b/buffer.c
@@ -315,6 +315,26 @@ x_gc_free (struct gc_arena *a)
}
/*
+ * Transfer src arena to dest, resetting src to an empty arena.
+ */
+void
+gc_transfer (struct gc_arena *dest, struct gc_arena *src)
+{
+ if (dest && src)
+ {
+ struct gc_entry *e = src->list;
+ if (e)
+ {
+ while (e->next != NULL)
+ e = e->next;
+ e->next = dest->list;
+ dest->list = src->list;
+ src->list = NULL;
+ }
+ }
+}
+
+/*
* Hex dump -- Output a binary buffer to a hex string and return it.
*/