diff options
author | jasone <jasone@FreeBSD.org> | 2006-01-19 07:23:13 +0000 |
---|---|---|
committer | jasone <jasone@FreeBSD.org> | 2006-01-19 07:23:13 +0000 |
commit | 46342446289b9f9b89fad476871dd100b76e7e12 (patch) | |
tree | 27312880f1ccd1f34c3ecd599b121e9f1750e533 /lib/libc/stdlib/malloc.c | |
parent | 3c01b0047df770a12d49bcfca8360ce3762d2e82 (diff) | |
download | FreeBSD-src-46342446289b9f9b89fad476871dd100b76e7e12.zip FreeBSD-src-46342446289b9f9b89fad476871dd100b76e7e12.tar.gz |
Make all internal variables and functions static.
Reported by: ache
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 2e4ba42..75edd2f 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -708,9 +708,12 @@ static chunk_tree_t huge; /* * Try to use brk for chunk-size allocations, due to address space constraints. */ -void *brk_base; /* Result of first sbrk(0) call. */ -void *brk_prev; /* Current end of brk, or ((void *)-1) if brk is exhausted. */ -void *brk_max; /* Upper limit on brk addresses (may be an over-estimate). */ +/* Result of first sbrk(0) call. */ +static void *brk_base; +/* Current end of brk, or ((void *)-1) if brk is exhausted. */ +static void *brk_prev; +/* Upper limit on brk addresses (may be an over-estimate). */ +static void *brk_max; #endif #ifdef MALLOC_STATS @@ -738,13 +741,13 @@ static chunk_tree_t old_chunks; * chunk is carved up in cacheline-size quanta, so that there is no chance of * false cach sharing. * */ -void *base_chunk; -void *base_next_addr; -void *base_past_addr; /* Addr immediately past base_chunk. */ -chunk_node_t *base_chunk_nodes; /* LIFO cache of chunk nodes. */ -malloc_mutex_t base_mtx; +static void *base_chunk; +static void *base_next_addr; +static void *base_past_addr; /* Addr immediately past base_chunk. */ +static chunk_node_t *base_chunk_nodes; /* LIFO cache of chunk nodes. */ +static malloc_mutex_t base_mtx; #ifdef MALLOC_STATS -uint64_t base_total; +static uint64_t base_total; #endif /********/ @@ -773,7 +776,7 @@ static __thread arena_t *arenas_map; #ifdef MALLOC_STATS /* Chunk statistics. */ -chunk_stats_t stats_chunks; +static chunk_stats_t stats_chunks; #endif /*******************************/ @@ -1287,7 +1290,7 @@ chunk_comp(chunk_node_t *a, chunk_node_t *b) } /* Generate red-black tree code for chunks. */ -RB_GENERATE(chunk_tree_s, chunk_node_s, link, chunk_comp); +RB_GENERATE_STATIC(chunk_tree_s, chunk_node_s, link, chunk_comp); static __inline int region_comp(region_node_t *a, region_node_t *b) @@ -1332,7 +1335,7 @@ region_comp(region_node_t *a, region_node_t *b) } /* Generate red-black tree code for regions. */ -RB_GENERATE(region_tree_s, region_node_s, link, region_comp); +RB_GENERATE_STATIC(region_tree_s, region_node_s, link, region_comp); static void * pages_map(void *addr, size_t size) |