]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Slab: can be deleted as a single object
authorMaria Matejka <mq@ucw.cz>
Thu, 30 May 2024 21:05:15 +0000 (23:05 +0200)
committerMaria Matejka <mq@ucw.cz>
Tue, 4 Jun 2024 08:11:36 +0000 (10:11 +0200)
lib/slab.c

index 935e35460fd6f316de187241546f3957b891f448..ab913f0cd406479f445b3d6b0e4dadd8c1ed856c 100644 (file)
@@ -245,6 +245,17 @@ sl_new(pool *p, uint size)
   return s;
 }
 
+/**
+ * sl_delete - destroy an existing Slab
+ * @s: slab
+ *
+ * This function destroys the given Slab.
+ */
+void sl_delete(slab *s)
+{
+  rfree(&s->r);
+}
+
 /**
  * sl_alloc - allocate an object from Slab
  * @s: slab