From 83cd586ea304d6f6aa190c65ee796baaba1941a7 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Thu, 23 Sep 2021 12:35:04 -0700 Subject: feat: improved interface of map macro --- sys/libn/fs.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'sys/libn/fs.c') diff --git a/sys/libn/fs.c b/sys/libn/fs.c index 10cd93e..e89ef07 100644 --- a/sys/libn/fs.c +++ b/sys/libn/fs.c @@ -12,20 +12,6 @@ struct Key dev_t dev; }; -static -void* -xalloc(void *_, int n, uintptr size) -{ - return malloc(n*size); -} - -static -void -xfree(void *_, void *ptr) -{ - return free(ptr); -} - #define hash(k) ((int32)k.ino ^ (int32)k.dev) #define equal(k1, k2) (k1.ino == k2.ino && k1.dev == k2.dev) @@ -38,7 +24,7 @@ static int morehistory(fs·History *h, int n) { - SET_GROW(h, struct Key, n, hash, xalloc, xfree, nil); + SET_GROW(h, struct Key, n, hash, sys·Memory, nil); } static @@ -62,7 +48,7 @@ static void delete(fs·History *h) { - SET_FREE(h, xfree, nil); + SET_FREE(h, sys·Memory, nil); } #undef hash -- cgit v1.2.1