aboutsummaryrefslogtreecommitdiff
path: root/include/jemalloc/internal/size_classes.sh
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2014-10-09 17:54:06 -0700
committerJason Evans <jasone@canonware.com>2014-10-09 22:44:37 -0700
commitfc0b3b7383373d66cfed2cd4e2faa272a6868d32 (patch)
tree529043fc2e79c396241ad6808a92d2fddd36d21a /include/jemalloc/internal/size_classes.sh
parentb123ddc760e5b53dde17c6a19a130173067c0e30 (diff)
downloadjemalloc-fc0b3b7383373d66cfed2cd4e2faa272a6868d32.tar.gz
Add configure options.
Add: --with-lg-page --with-lg-page-sizes --with-lg-size-class-group --with-lg-quantum Get rid of STATIC_PAGE_SHIFT, in favor of directly setting LG_PAGE. Fix various edge conditions exposed by the configure options.
Diffstat (limited to 'include/jemalloc/internal/size_classes.sh')
-rwxr-xr-xinclude/jemalloc/internal/size_classes.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/jemalloc/internal/size_classes.sh b/include/jemalloc/internal/size_classes.sh
index 897570c..733338c 100755
--- a/include/jemalloc/internal/size_classes.sh
+++ b/include/jemalloc/internal/size_classes.sh
@@ -1,4 +1,6 @@
#!/bin/sh
+#
+# Usage: size_classes.sh <lg_parr> <lg_g>
# The following limits are chosen such that they cover all supported platforms.
@@ -15,10 +17,10 @@ lg_tmin=3
lg_kmax=12
# Page sizes.
-lg_parr="12 13 16"
+lg_parr=`echo $1 | tr ',' ' '`
# Size class group size (number of size classes for each size doubling).
-lg_g=2
+lg_g=$2
pow2() {
e=$1
@@ -159,7 +161,11 @@ size_classes() {
nbins=$((${index} + 1))
# Final written value is correct:
small_maxclass="((((size_t)1) << ${lg_grp}) + (((size_t)${ndelta}) << ${lg_delta}))"
- lg_large_minclass=$((${lg_grp} + 1))
+ if [ ${lg_g} -gt 0 ] ; then
+ lg_large_minclass=$((${lg_grp} + 1))
+ else
+ lg_large_minclass=$((${lg_grp} + 2))
+ fi
fi
index=$((${index} + 1))
ndelta=$((${ndelta} + 1))