From 81365cdff410e7289d54da93d56ca9addcdf12cc Mon Sep 17 00:00:00 2001 From: Greg Burd Date: Sat, 23 Mar 2024 11:53:13 -0400 Subject: [PATCH] snapshot v2/p5; destroy --- include/sl.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/sl.h b/include/sl.h index 078db85..72d512e 100644 --- a/include/sl.h +++ b/include/sl.h @@ -836,6 +836,7 @@ } \ if (SKIPLIST_MAX_HEIGHT == 1) \ free(path); \ + /* if we didn't preserve any nodes we can free this one */ \ if (np == 0) \ free_node_blk; \ \ @@ -888,6 +889,12 @@ node = next; \ } while (node != NULL); \ \ + node = slist->slh_pres; \ + while (node) { \ + next = node->field.sle.next[0]; \ + prefix##skip_free_node_##decl(node); \ + } \ + \ free(slist->slh_head); \ free(slist->slh_tail); \ return 0; \