X-Git-Url: https://pd.if.org/git/?p=nbds;a=blobdiff_plain;f=runtime%2Fmem.c;fp=runtime%2Fmem.c;h=f6fd318aef75f732c781b7d4a62585d6b382ea99;hp=c65dfb05c7705fce3e2900ef6d306d708ba153ad;hb=fb536c12185fd1e339b5fd479d9ef84554b436df;hpb=3ad1b21110cea1cf04f6acf5500d774bba05a8c8 diff --git a/runtime/mem.c b/runtime/mem.c index c65dfb0..f6fd318 100644 --- a/runtime/mem.c +++ b/runtime/mem.c @@ -8,8 +8,8 @@ #include #include #include "common.h" +#include "runtime_local.h" #include "lwt.h" -#include "tls.h" #define GET_SCALE(n) (sizeof(n)*8-__builtin_clzl((n)-1)) // log2 of , rounded up #define MAX_SCALE 31 // allocate blocks up to 4GB in size (arbitrary, could be bigger) @@ -61,7 +61,7 @@ void nbd_free (void *x) { assert(((size_t)b >> REGION_SCALE) < ((1 << HEADER_REGION_SCALE) / sizeof(header_t))); header_t *h = region_header_ + ((size_t)b >> REGION_SCALE); TRACE("m0", "nbd_free(): block %p scale %llu", x, h->scale); - block_t *l = &free_list_[(int)h->owner][(int)h->scale][tid_]; + block_t *l = &free_list_[h->owner][h->scale][tid_]; TRACE("m0", "nbd_free(): free list %p first block %p", l, l->next); b->next = l->next; l->next = b;