diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2021-09-23 12:35:04 -0700 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2021-09-23 12:35:04 -0700 |
commit | 83cd586ea304d6f6aa190c65ee796baaba1941a7 (patch) | |
tree | 74bf8efcfb0a3d458767659d34ed3e58618f9d71 /sys/libn/memory.c | |
parent | 67c778d19c862218423a17f889401eaeb2ebfbb9 (diff) |
feat: improved interface of map macro
Diffstat (limited to 'sys/libn/memory.c')
-rw-r--r-- | sys/libn/memory.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/libn/memory.c b/sys/libn/memory.c index 1c7ab07..795fe1f 100644 --- a/sys/libn/memory.c +++ b/sys/libn/memory.c @@ -1,19 +1,19 @@ #include <u.h> #include <libn.h> -static -void +static +void ·free(void* _, void* ptr) { return free(ptr); } -static +static void * ·alloc(void* _, uint n, ulong size) { return malloc(n*size); } -static +static void * ·calloc(void* _, uint n, ulong size) { return calloc(n, size); @@ -26,7 +26,7 @@ void * } mem·Allocator sys·Memory = { - .alloc = ·alloc, + .alloc = ·calloc, .free = ·free }; |