Version 0.8.11
[userspace-rcu.git] / urcu-bp.c
index 9d6713ef1b53aae08fae9cc975b307b040621701..ac8c6806e1008e5314f61e013b31e6b454e3fb69 100644 (file)
--- a/urcu-bp.c
+++ b/urcu-bp.c
@@ -355,7 +355,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);
@@ -389,7 +390,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);
@@ -587,9 +589,10 @@ void _rcu_bp_exit(void)
 
                cds_list_for_each_entry_safe(chunk, tmp,
                                &registry_arena.chunk_list, node) {
-                       munmap(chunk, chunk->data_len
+                       munmap((void *) chunk, chunk->data_len
                                        + sizeof(struct registry_chunk));
                }
+               CDS_INIT_LIST_HEAD(&registry_arena.chunk_list);
                ret = pthread_key_delete(urcu_bp_key);
                if (ret)
                        abort();
This page took 0.023537 seconds and 4 git commands to generate.