From 9740eee555cac43cc27e08a39a38e09a96ecb002 Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Mon, 16 May 2022 00:35:21 +0200 Subject: Add layout and a common widget type --- set/set.ha | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'set/set.ha') diff --git a/set/set.ha b/set/set.ha index 2c56efe..504d716 100644 --- a/set/set.ha +++ b/set/set.ha @@ -33,11 +33,16 @@ export fn contains(s: set, item: size) (size | nosuchitem) = { return nosuchitem; }; -// Clears all items +// Clears all items. export fn clear(s: *set) void = { delete(s.items[..]); }; +// Free the underlying slice. +export fn finish(s: *set) void = { + free(s.items); +}; + @test fn add() void = { let s = set {...}; assert(add(&s, 1z)); -- cgit v1.2.3