aboutsummaryrefslogtreecommitdiff
path: root/include/jemalloc/internal/size_classes.sh
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-04-16 11:10:55 +0000
committerNicolas Geoffray <ngeoffray@google.com>2015-04-16 11:10:55 +0000
commit75929a97332565c3b987986f35652b6d5d275d3c (patch)
tree6c24378eef62b4381033b9615d247f5934fc0342 /include/jemalloc/internal/size_classes.sh
parent5b5d97b42e84c2ac417271c3fab6fc282496a335 (diff)
downloadjemalloc-75929a97332565c3b987986f35652b6d5d275d3c.tar.gz
Revert "Merge remote-tracking branch 'aosp/upstream-dev' into merge"
Revert due to random ART crashes seen. This reverts commit 5b5d97b42e84c2ac417271c3fab6fc282496a335. Change-Id: I62a784301fded7ee853b182d172be46bb32bded7
Diffstat (limited to 'include/jemalloc/internal/size_classes.sh')
-rwxr-xr-xinclude/jemalloc/internal/size_classes.sh28
1 files changed, 7 insertions, 21 deletions
diff --git a/include/jemalloc/internal/size_classes.sh b/include/jemalloc/internal/size_classes.sh
index 38020dc..3edebf2 100755
--- a/include/jemalloc/internal/size_classes.sh
+++ b/include/jemalloc/internal/size_classes.sh
@@ -1,6 +1,4 @@
#!/bin/sh
-#
-# Usage: size_classes.sh <lg_qarr> <lg_tmin> <lg_parr> <lg_g>
# The following limits are chosen such that they cover all supported platforms.
@@ -8,19 +6,19 @@
lg_zarr="2 3"
# Quanta.
-lg_qarr=$1
+lg_qarr="3 4"
# The range of tiny size classes is [2^lg_tmin..2^(lg_q-1)].
-lg_tmin=$2
+lg_tmin=3
# Maximum lookup size.
lg_kmax=12
# Page sizes.
-lg_parr=`echo $3 | tr ',' ' '`
+lg_parr="12 13 16"
# Size class group size (number of size classes for each size doubling).
-lg_g=$4
+lg_g=2
pow2() {
e=$1
@@ -63,7 +61,7 @@ size_class() {
rem="yes"
fi
- if [ ${lg_size} -lt $((${lg_p} + ${lg_g})) ] ; then
+ if [ ${lg_size} -lt ${lg_p} ] ; then
bin="yes"
else
bin="no"
@@ -161,11 +159,6 @@ size_classes() {
nbins=$((${index} + 1))
# Final written value is correct:
small_maxclass="((((size_t)1) << ${lg_grp}) + (((size_t)${ndelta}) << ${lg_delta}))"
- 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))
@@ -174,17 +167,14 @@ size_classes() {
lg_delta=$((${lg_delta} + 1))
done
echo
- nsizes=${index}
# Defined upon completion:
# - ntbins
# - nlbins
# - nbins
- # - nsizes
# - lg_tiny_maxclass
# - lookup_maxclass
# - small_maxclass
- # - lg_large_minclass
}
cat <<EOF
@@ -209,11 +199,9 @@ cat <<EOF
* NTBINS: Number of tiny bins.
* NLBINS: Number of bins supported by the lookup table.
* NBINS: Number of small size class bins.
- * NSIZES: Number of size classes.
* LG_TINY_MAXCLASS: Lg of maximum tiny size class.
* LOOKUP_MAXCLASS: Maximum size class included in lookup table.
* SMALL_MAXCLASS: Maximum small size class.
- * LG_LARGE_MINCLASS: Lg of minimum large size class.
*/
#define LG_SIZE_CLASS_GROUP ${lg_g}
@@ -232,11 +220,9 @@ for lg_z in ${lg_zarr} ; do
echo "#define NTBINS ${ntbins}"
echo "#define NLBINS ${nlbins}"
echo "#define NBINS ${nbins}"
- echo "#define NSIZES ${nsizes}"
echo "#define LG_TINY_MAXCLASS ${lg_tiny_maxclass}"
echo "#define LOOKUP_MAXCLASS ${lookup_maxclass}"
echo "#define SMALL_MAXCLASS ${small_maxclass}"
- echo "#define LG_LARGE_MINCLASS ${lg_large_minclass}"
echo "#endif"
echo
done
@@ -251,10 +237,10 @@ cat <<EOF
#endif
#undef SIZE_CLASSES_DEFINED
/*
- * The size2index_tab lookup table uses uint8_t to encode each bin index, so we
+ * The small_size2bin lookup table uses uint8_t to encode each bin index, so we
* cannot support more than 256 small size classes. Further constrain NBINS to
* 255 since all small size classes, plus a "not small" size class must be
- * stored in 8 bits of arena_chunk_map_bits_t's bits field.
+ * stored in 8 bits of arena_chunk_map_t's bits field.
*/
#if (NBINS > 255)
# error "Too many small size classes"