summaryrefslogtreecommitdiffstats
path: root/src/bin.c
diff options
context:
space:
mode:
authorDavid T. Goldblatt <davidtgoldblatt@gmail.com>2017-10-02 00:22:06 (GMT)
committerDavid Goldblatt <davidtgoldblatt@gmail.com>2017-12-19 00:29:10 (GMT)
commit4bf4a1c4ea418ba490d35d23aee0f535e96ddd23 (patch)
tree30900d7b8cc06e43ac9a69d8420044e78028753d /src/bin.c
parent740bdd68b1d4b9c39c68432e06deb70ad4da3210 (diff)
downloadjemalloc-4bf4a1c4ea418ba490d35d23aee0f535e96ddd23.zip
jemalloc-4bf4a1c4ea418ba490d35d23aee0f535e96ddd23.tar.gz
jemalloc-4bf4a1c4ea418ba490d35d23aee0f535e96ddd23.tar.bz2
Pull out arena_bin_info_t and arena_bin_t into their own file.
In the process, kill arena_bin_index, which is unused. To follow are several diffs continuing this separation.
Diffstat (limited to 'src/bin.c')
-rw-r--r--src/bin.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/bin.c b/src/bin.c
new file mode 100644
index 0000000..59cdd2c
--- /dev/null
+++ b/src/bin.c
@@ -0,0 +1,21 @@
+#include "jemalloc/internal/jemalloc_preamble.h"
+#include "jemalloc/internal/jemalloc_internal_includes.h"
+
+#include "jemalloc/internal/bin.h"
+
+const bin_info_t bin_infos[NBINS] = {
+#define BIN_INFO_bin_yes(reg_size, slab_size, nregs) \
+ {reg_size, slab_size, nregs, BITMAP_INFO_INITIALIZER(nregs)},
+#define BIN_INFO_bin_no(reg_size, slab_size, nregs)
+#define SC(index, lg_grp, lg_delta, ndelta, psz, bin, pgs, \
+ lg_delta_lookup) \
+ BIN_INFO_bin_##bin((1U<<lg_grp) + (ndelta<<lg_delta), \
+ (pgs << LG_PAGE), (pgs << LG_PAGE) / ((1U<<lg_grp) + \
+ (ndelta<<lg_delta)))
+ SIZE_CLASSES
+#undef BIN_INFO_bin_yes
+#undef BIN_INFO_bin_no
+#undef SC
+};
+
+