diff options
Diffstat (limited to 'sys/vm/vm_dynalloc.c')
-rw-r--r-- | sys/vm/vm_dynalloc.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sys/vm/vm_dynalloc.c b/sys/vm/vm_dynalloc.c index 861efe4..e1b61c7 100644 --- a/sys/vm/vm_dynalloc.c +++ b/sys/vm/vm_dynalloc.c @@ -39,12 +39,12 @@ void * dynalloc(size_t sz) { /* TODO: Per CPU */ - struct vm_ctx vm_ctx = vm_get_bsp_ctx(); + struct vm_ctx *vm_ctx = vm_get_bsp_ctx(); void *tmp; - spinlock_acquire(&vm_ctx.dynalloc_lock); - tmp = tlsf_malloc(vm_ctx.tlsf_ctx, sz); - spinlock_release(&vm_ctx.dynalloc_lock); + spinlock_acquire(&vm_ctx->dynalloc_lock); + tmp = tlsf_malloc(vm_ctx->tlsf_ctx, sz); + spinlock_release(&vm_ctx->dynalloc_lock); return tmp; } @@ -58,12 +58,12 @@ void * dynrealloc(void *old_ptr, size_t newsize) { /* TODO: Per CPU */ - struct vm_ctx vm_ctx = vm_get_bsp_ctx(); + struct vm_ctx *vm_ctx = vm_get_bsp_ctx(); void *tmp; - spinlock_acquire(&vm_ctx.dynalloc_lock); - tmp = tlsf_realloc(vm_ctx.tlsf_ctx, old_ptr, newsize); - spinlock_release(&vm_ctx.dynalloc_lock); + spinlock_acquire(&vm_ctx->dynalloc_lock); + tmp = tlsf_realloc(vm_ctx->tlsf_ctx, old_ptr, newsize); + spinlock_release(&vm_ctx->dynalloc_lock); return tmp; } @@ -76,9 +76,9 @@ void dynfree(void *ptr) { /* TODO: Per CPU */ - struct vm_ctx vm_ctx = vm_get_bsp_ctx(); + struct vm_ctx *vm_ctx = vm_get_bsp_ctx(); - spinlock_acquire(&vm_ctx.dynalloc_lock); - tlsf_free(vm_ctx.tlsf_ctx, ptr); - spinlock_release(&vm_ctx.dynalloc_lock); + spinlock_acquire(&vm_ctx->dynalloc_lock); + tlsf_free(vm_ctx->tlsf_ctx, ptr); + spinlock_release(&vm_ctx->dynalloc_lock); } |