X-Git-Url: https://pd.if.org/git/?p=nbds;a=blobdiff_plain;f=runtime%2Fmem.c;h=0b7cd5b7be8a0c23662a74cb3ea53eeb1a3e343a;hp=708ef22ed94f5526b1b5cb23de73b1f21c8d73fc;hb=8143ca0acc36e19d004431952e3b6f9b3d337f49;hpb=010e49988a8b12f78053c387b3798763b4e8df18 diff --git a/runtime/mem.c b/runtime/mem.c index 708ef22..0b7cd5b 100644 --- a/runtime/mem.c +++ b/runtime/mem.c @@ -8,7 +8,7 @@ #include #include #include "common.h" -#include "runtime_local.h" +#include "rlocal.h" #include "lwt.h" #define GET_SCALE(n) (sizeof(n)*8-__builtin_clzl((n)-1)) // log2 of , rounded up @@ -98,7 +98,7 @@ void *nbd_malloc (size_t n) { assert(b_scale <= MAX_SCALE); TRACE("m0", "nbd_malloc(): size %llu scale %llu", n, b_scale); private_list_t *pri = &pri_free_list_[tid_][b_scale]; // our private free list - TRACE("m0", "nbd_malloc(): private free list %p first block %p", pri->list, pri->head); + TRACE("m0", "nbd_malloc(): private free list first block %p", pri->head, 0); // If our private free list is empty, try to find blocks on our public free list. If that fails, // allocate a new region. @@ -133,7 +133,7 @@ void *nbd_malloc (size_t n) { if (pubs[pri->next_pub] != NULL) { block_t *stolen = SYNC_SWAP(&pubs[pri->next_pub], NULL); - TRACE("m0", "nbd_malloc(): stole list %p first block %p", stolen); + TRACE("m0", "nbd_malloc(): stole list %p", stolen, 0); if (stolen == NULL) continue; pri->head = stolen; @@ -145,7 +145,7 @@ void *nbd_malloc (size_t n) { // Pull a block off of our private free list. block_t *b = pri->head; - TRACE("m0", "nbd_malloc(): take block %p off of of private list (new head is %p)", b, pri->next); + TRACE("m0", "nbd_malloc(): take block %p off of of private list (new head is %p)", b, b->next); assert(b); pri->head = b->next; pri->count++;