diff options
author | Ian Moffett <ian@osmora.org> | 2024-03-28 01:36:33 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-03-28 01:36:33 -0400 |
commit | e43852ffc738b27cbb84d0aea85b677bd5d98f82 (patch) | |
tree | 8e45f8dee68ee3f6c24a9a788dcb7ad2159749f3 /sys/vm/vm_dynalloc.c | |
parent | c426258d595e2b9490f037b8d8a768b6257d09f1 (diff) |
kernel: vm_dynalloc: Add dynalloc_memalign()
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/vm/vm_dynalloc.c')
-rw-r--r-- | sys/vm/vm_dynalloc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/vm/vm_dynalloc.c b/sys/vm/vm_dynalloc.c index 0b8d668..dea4460 100644 --- a/sys/vm/vm_dynalloc.c +++ b/sys/vm/vm_dynalloc.c @@ -47,6 +47,18 @@ dynalloc(size_t sz) return tmp; } +void * +dynalloc_memalign(size_t sz, size_t align) +{ + struct vm_ctx *vm_ctx = vm_get_ctx(); + void *tmp; + + spinlock_acquire(&vm_ctx->dynalloc_lock); + tmp = tlsf_memalign(vm_ctx->tlsf_ctx, align, sz); + spinlock_release(&vm_ctx->dynalloc_lock); + return tmp; +} + /* * Reallocates memory pool created by `dynalloc()' * |