From 96bbd8a6aba2cb5510ebfd84697c746cefda2c6e Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Mon, 6 Feb 2012 08:56:45 +0400 Subject: [PATCH] Remove unused and hide some inner symbols in atomic_ops_malloc * src/atomic_ops_malloc.c (AO_chunk_free_list): Remove unused global variable. * src/atomic_ops_malloc.c (msbs): Add 'const' keyword. * src/atomic_ops_malloc.c (msb): Add 'static' keyword to inner function declaration. --- src/atomic_ops_malloc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/atomic_ops_malloc.c b/src/atomic_ops_malloc.c index bb1e949..4c29b15 100644 --- a/src/atomic_ops_malloc.c +++ b/src/atomic_ops_malloc.c @@ -204,10 +204,6 @@ retry: /* of total size 2**i bytes. */ AO_stack_t AO_free_list[LOG_MAX_SIZE+1]; -/* Chunk free list, linked through first word in chunks. */ -/* All entries of size CHUNK_SIZE. */ -AO_stack_t AO_chunk_free_list; - /* Break up the chunk, and add it to the object free list for */ /* the given size. Sz must be a power of two. */ /* We have exclusive access to chunk. */ @@ -224,13 +220,13 @@ add_chunk_as(void * chunk, size_t sz, unsigned log_sz) } } -static int msbs[16] = {0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4}; +static const int msbs[16] = {0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4}; /* Return the position of the most significant set bit in the */ /* argument. */ /* We follow the conventions of ffs(), i.e. the least */ /* significant bit is number one. */ -int msb(size_t s) +static int msb(size_t s) { int result = 0; int v; -- 2.40.0