aboutsummaryrefslogtreecommitdiff
path: root/sys/libn/fs.c
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2021-09-23 12:35:04 -0700
committerNicholas Noll <nbnoll@eml.cc>2021-09-23 12:35:04 -0700
commit83cd586ea304d6f6aa190c65ee796baaba1941a7 (patch)
tree74bf8efcfb0a3d458767659d34ed3e58618f9d71 /sys/libn/fs.c
parent67c778d19c862218423a17f889401eaeb2ebfbb9 (diff)
feat: improved interface of map macro
Diffstat (limited to 'sys/libn/fs.c')
-rw-r--r--sys/libn/fs.c18
1 files changed, 2 insertions, 16 deletions
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