aboutsummaryrefslogtreecommitdiff
path: root/src/tcache.c
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2014-10-05 17:54:10 -0700
committerJason Evans <jasone@canonware.com>2014-10-06 01:45:13 -0700
commit155bfa7da18cab0d21d87aa2dce4554166836f5d (patch)
tree4689fe0ec9481715084fb8a84204d36d471c3b14 /src/tcache.c
parent3c3b3b1a94705c8019b973fb679dd99bd19305af (diff)
downloadjemalloc-155bfa7da18cab0d21d87aa2dce4554166836f5d.tar.gz
Normalize size classes.
Normalize size classes to use the same number of size classes per size doubling (currently hard coded to 4), across the intire range of size classes. Small size classes already used this spacing, but in order to support this change, additional small size classes now fill [4 KiB .. 16 KiB). Large size classes range from [16 KiB .. 4 MiB). Huge size classes now support non-multiples of the chunk size in order to fill (4 MiB .. 16 MiB).
Diffstat (limited to 'src/tcache.c')
-rw-r--r--src/tcache.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tcache.c b/src/tcache.c
index 07167b6..2c968c6 100644
--- a/src/tcache.c
+++ b/src/tcache.c
@@ -24,7 +24,7 @@ size_t tcache_salloc(const void *ptr)
void
tcache_event_hard(tcache_t *tcache)
{
- size_t binind = tcache->next_gc_bin;
+ index_t binind = tcache->next_gc_bin;
tcache_bin_t *tbin = &tcache->tbins[binind];
tcache_bin_info_t *tbin_info = &tcache_bin_info[binind];
@@ -62,7 +62,7 @@ tcache_event_hard(tcache_t *tcache)
}
void *
-tcache_alloc_small_hard(tcache_t *tcache, tcache_bin_t *tbin, size_t binind)
+tcache_alloc_small_hard(tcache_t *tcache, tcache_bin_t *tbin, index_t binind)
{
void *ret;
@@ -76,7 +76,7 @@ tcache_alloc_small_hard(tcache_t *tcache, tcache_bin_t *tbin, size_t binind)
}
void
-tcache_bin_flush_small(tcache_bin_t *tbin, size_t binind, unsigned rem,
+tcache_bin_flush_small(tcache_bin_t *tbin, index_t binind, unsigned rem,
tcache_t *tcache)
{
void *ptr;
@@ -153,7 +153,7 @@ tcache_bin_flush_small(tcache_bin_t *tbin, size_t binind, unsigned rem,
}
void
-tcache_bin_flush_large(tcache_bin_t *tbin, size_t binind, unsigned rem,
+tcache_bin_flush_large(tcache_bin_t *tbin, index_t binind, unsigned rem,
tcache_t *tcache)
{
void *ptr;