X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=sidebyside;f=urcu-bp.c;h=d0bfb0dc713dd563bd4b8d67b41cbac03a5227e4;hb=181ca7a66672a51c9643b2462de0c537530b2661;hp=22e17ccdd0a81eafe3b49917bb610f10a5e2ac3c;hpb=d3ac5bb7c43cbe5412a4e3a13692ec7a90b9fbbb;p=userspace-rcu.git diff --git a/urcu-bp.c b/urcu-bp.c index 22e17cc..d0bfb0d 100644 --- a/urcu-bp.c +++ b/urcu-bp.c @@ -373,7 +373,8 @@ void expand_arena(struct registry_arena *arena) sizeof(struct registry_chunk) + sizeof(struct rcu_reader)); new_chunk_len = ARENA_INIT_ALLOC; - new_chunk = mmap(NULL, new_chunk_len, + new_chunk = (struct registry_chunk *) mmap(NULL, + new_chunk_len, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); @@ -407,7 +408,8 @@ void expand_arena(struct registry_arena *arena) } /* Remap did not succeed, we need to add a new chunk. */ - new_chunk = mmap(NULL, new_chunk_len, + new_chunk = (struct registry_chunk *) mmap(NULL, + new_chunk_len, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); @@ -609,9 +611,10 @@ void rcu_bp_exit(void) cds_list_for_each_entry_safe(chunk, tmp, ®istry_arena.chunk_list, node) { - munmap(chunk, chunk->data_len + munmap((void *) chunk, chunk->data_len + sizeof(struct registry_chunk)); } + CDS_INIT_LIST_HEAD(®istry_arena.chunk_list); ret = pthread_key_delete(urcu_bp_key); if (ret) abort();