repo
stringlengths 1
152
⌀ | file
stringlengths 15
205
| code
stringlengths 0
41.6M
| file_length
int64 0
41.6M
| avg_line_length
float64 0
1.81M
| max_line_length
int64 0
12.7M
| extension_type
stringclasses 90
values |
---|---|---|---|---|---|---|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/unittest/unittest.sh
|
#
# Copyright 2014-2018, Intel Corporation
# Copyright (c) 2016, Microsoft Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
set -e
# make sure we have a well defined locale for string operations here
export LC_ALL="C"
#export LC_ALL="en_US.UTF-8"
. ../testconfig.sh
function verbose_msg() {
if [ "$UNITTEST_LOG_LEVEL" -ge 2 ]; then
echo "$*"
fi
}
function msg() {
if [ "$UNITTEST_LOG_LEVEL" -ge 1 ]; then
echo "$*"
fi
}
function fatal() {
echo "$*" >&2
exit 1
}
if [ -z "${UNITTEST_NAME}" ]; then
CURDIR=$(basename $(pwd))
SCRIPTNAME=$(basename $0)
export UNITTEST_NAME=$CURDIR/$SCRIPTNAME
export UNITTEST_NUM=$(echo $SCRIPTNAME | sed "s/TEST//")
fi
# defaults
[ "$UNITTEST_LOG_LEVEL" ] || UNITTEST_LOG_LEVEL=2
[ "$GREP" ] || GREP="grep -a"
[ "$TEST" ] || TEST=check
[ "$FS" ] || FS=any
[ "$BUILD" ] || BUILD=debug
[ "$CHECK_TYPE" ] || CHECK_TYPE=auto
[ "$CHECK_POOL" ] || CHECK_POOL=0
[ "$VERBOSE" ] || VERBOSE=0
[ -n "${SUFFIX+x}" ] || SUFFIX="😘⠝⠧⠍⠇ɗPMDKӜ⥺🙋"
export UNITTEST_LOG_LEVEL GREP TEST FS BUILD CHECK_TYPE CHECK_POOL VERBOSE SUFFIX
VMMALLOC=libvmmalloc.so.1
TOOLS=../tools
LIB_TOOLS="../../tools"
# Paths to some useful tools
[ "$PMEMPOOL" ] || PMEMPOOL=$LIB_TOOLS/pmempool/pmempool
[ "$DAXIO" ] || DAXIO=$LIB_TOOLS/daxio/daxio
[ "$PMEMSPOIL" ] || PMEMSPOIL=$TOOLS/pmemspoil/pmemspoil.static-nondebug
[ "$BTTCREATE" ] || BTTCREATE=$TOOLS/bttcreate/bttcreate.static-nondebug
[ "$PMEMWRITE" ] || PMEMWRITE=$TOOLS/pmemwrite/pmemwrite
[ "$PMEMALLOC" ] || PMEMALLOC=$TOOLS/pmemalloc/pmemalloc
[ "$PMEMOBJCLI" ] || PMEMOBJCLI=$TOOLS/pmemobjcli/pmemobjcli
[ "$PMEMDETECT" ] || PMEMDETECT=$TOOLS/pmemdetect/pmemdetect.static-nondebug
[ "$PMREORDER" ] || PMREORDER=$LIB_TOOLS/pmreorder/pmreorder.py
[ "$FIP" ] || FIP=$TOOLS/fip/fip
[ "$DDMAP" ] || DDMAP=$TOOLS/ddmap/ddmap
[ "$CMPMAP" ] || CMPMAP=$TOOLS/cmpmap/cmpmap
[ "$EXTENTS" ] || EXTENTS=$TOOLS/extents/extents
[ "$FALLOCATE_DETECT" ] || FALLOCATE_DETECT=$TOOLS/fallocate_detect/fallocate_detect.static-nondebug
[ "$OBJ_VERIFY" ] || OBJ_VERIFY=$TOOLS/obj_verify/obj_verify
# force globs to fail if they don't match
shopt -s failglob
# number of remote nodes required in the current unit test
NODES_MAX=-1
# sizes of aligments
SIZE_4KB=4096
SIZE_2MB=2097152
# SSH and SCP options
SSH_OPTS="-o BatchMode=yes"
SCP_OPTS="-o BatchMode=yes -r -p"
# list of common files to be copied to all remote nodes
DIR_SRC="../.."
FILES_COMMON_DIR="\
$DIR_SRC/test/*.supp \
$DIR_SRC/tools/rpmemd/rpmemd \
$DIR_SRC/tools/pmempool/pmempool \
$DIR_SRC/test/tools/extents/extents \
$DIR_SRC/test/tools/obj_verify/obj_verify \
$DIR_SRC/test/tools/ctrld/ctrld \
$DIR_SRC/test/tools/fip/fip"
# Portability
VALGRIND_SUPP="--suppressions=../ld.supp --suppressions=../memcheck-libunwind.supp"
if [ "$(uname -s)" = "FreeBSD" ]; then
DATE="gdate"
DD="gdd"
FALLOCATE="mkfile"
VM_OVERCOMMIT="[ $(sysctl vm.overcommit | awk '{print $2}') == 0 ]"
RM_ONEFS="-x"
STAT_MODE="-f%Lp"
STAT_PERM="-f%Sp"
STAT_SIZE="-f%z"
STRACE="truss"
VALGRIND_SUPP="$VALGRIND_SUPP --suppressions=../freebsd.supp"
else
DATE="date"
DD="dd"
FALLOCATE="fallocate -l"
VM_OVERCOMMIT="[ $(cat /proc/sys/vm/overcommit_memory) != 2 ]"
RM_ONEFS="--one-file-system"
STAT_MODE="-c%a"
STAT_PERM="-c%A"
STAT_SIZE="-c%s"
STRACE="strace"
fi
# array of lists of PID files to be cleaned in case of an error
NODE_PID_FILES[0]=""
#
# The variable TEST_LD_LIBRARY_PATH is constructed so the test pulls in
# the appropriate library from this source tree. To override this behavior
# (i.e. to force the test to use the libraries installed elsewhere on
# the system), set TEST_LD_LIBRARY_PATH and this script will not override it.
#
# For example, in a test directory, run:
# TEST_LD_LIBRARY_PATH=/usr/lib ./TEST0
#
[ "$TEST_LD_LIBRARY_PATH" ] || {
case "$BUILD"
in
debug|static-debug)
if [ -z "$PMDK_LIB_PATH_DEBUG" ]; then
TEST_LD_LIBRARY_PATH=../../debug
REMOTE_LD_LIBRARY_PATH=../debug
else
TEST_LD_LIBRARY_PATH=$PMDK_LIB_PATH_DEBUG
REMOTE_LD_LIBRARY_PATH=$PMDK_LIB_PATH_DEBUG
fi
;;
nondebug|static-nondebug)
if [ -z "$PMDK_LIB_PATH_NONDEBUG" ]; then
TEST_LD_LIBRARY_PATH=../../nondebug
REMOTE_LD_LIBRARY_PATH=../nondebug
else
TEST_LD_LIBRARY_PATH=$PMDK_LIB_PATH_NONDEBUG
REMOTE_LD_LIBRARY_PATH=$PMDK_LIB_PATH_NONDEBUG
fi
;;
esac
}
#
# When running static binary tests, append the build type to the binary
#
case "$BUILD"
in
static-*)
EXESUFFIX=.$BUILD
;;
esac
#
# The variable DIR is constructed so the test uses that directory when
# constructing test files. DIR is chosen based on the fs-type for
# this test, and if the appropriate fs-type doesn't have a directory
# defined in testconfig.sh, the test is skipped.
#
# This behavior can be overridden by setting DIR. For example:
# DIR=/force/test/dir ./TEST0
#
curtestdir=`basename $PWD`
# just in case
if [ ! "$curtestdir" ]; then
fatal "curtestdir does not have a value"
fi
curtestdir=test_$curtestdir
if [ ! "$UNITTEST_NUM" ]; then
fatal "UNITTEST_NUM does not have a value"
fi
if [ ! "$UNITTEST_NAME" ]; then
fatal "UNITTEST_NAME does not have a value"
fi
REAL_FS=$FS
if [ "$DIR" ]; then
DIR=$DIR/$curtestdir$UNITTEST_NUM
else
case "$FS"
in
pmem)
# if a variable is set - it must point to a valid directory
if [ "$PMEM_FS_DIR" == "" ]; then
fatal "$UNITTEST_NAME: PMEM_FS_DIR is not set"
fi
DIR=$PMEM_FS_DIR/$DIRSUFFIX/$curtestdir$UNITTEST_NUM
if [ "$PMEM_FS_DIR_FORCE_PMEM" = "1" ] || [ "$PMEM_FS_DIR_FORCE_PMEM" = "2" ]; then
export PMEM_IS_PMEM_FORCE=1
fi
;;
non-pmem)
# if a variable is set - it must point to a valid directory
if [ "$NON_PMEM_FS_DIR" == "" ]; then
fatal "$UNITTEST_NAME: NON_PMEM_FS_DIR is not set"
fi
DIR=$NON_PMEM_FS_DIR/$DIRSUFFIX/$curtestdir$UNITTEST_NUM
;;
any)
if [ "$PMEM_FS_DIR" != "" ]; then
DIR=$PMEM_FS_DIR/$DIRSUFFIX/$curtestdir$UNITTEST_NUM
REAL_FS=pmem
if [ "$PMEM_FS_DIR_FORCE_PMEM" = "1" ] || [ "$PMEM_FS_DIR_FORCE_PMEM" = "2" ]; then
export PMEM_IS_PMEM_FORCE=1
fi
elif [ "$NON_PMEM_FS_DIR" != "" ]; then
DIR=$NON_PMEM_FS_DIR/$DIRSUFFIX/$curtestdir$UNITTEST_NUM
REAL_FS=non-pmem
else
fatal "$UNITTEST_NAME: fs-type=any and both env vars are empty"
fi
;;
none)
DIR=/dev/null/not_existing_dir/$DIRSUFFIX/$curtestdir$UNITTEST_NUM
;;
*)
verbose_msg "$UNITTEST_NAME: SKIP fs-type $FS (not configured)"
exit 0
;;
esac
fi
#
# The default is to turn on library logging to level 3 and save it to local files.
# Tests that don't want it on, should override these environment variables.
#
export VMEM_LOG_LEVEL=3
export VMEM_LOG_FILE=vmem$UNITTEST_NUM.log
export PMEM_LOG_LEVEL=3
export PMEM_LOG_FILE=pmem$UNITTEST_NUM.log
export PMEMBLK_LOG_LEVEL=3
export PMEMBLK_LOG_FILE=pmemblk$UNITTEST_NUM.log
export PMEMLOG_LOG_LEVEL=3
export PMEMLOG_LOG_FILE=pmemlog$UNITTEST_NUM.log
export PMEMOBJ_LOG_LEVEL=3
export PMEMOBJ_LOG_FILE=pmemobj$UNITTEST_NUM.log
export PMEMCTO_LOG_LEVEL=3
export PMEMCTO_LOG_FILE=pmemcto$UNITTEST_NUM.log
export PMEMPOOL_LOG_LEVEL=3
export PMEMPOOL_LOG_FILE=pmempool$UNITTEST_NUM.log
export PMREORDER_LOG_FILE=pmreorder$UNITTEST_NUM.log
export VMMALLOC_POOL_SIZE=$((16 * 1024 * 1024))
export VMMALLOC_LOG_LEVEL=3
export VMMALLOC_LOG_FILE=vmmalloc$UNITTEST_NUM.log
export OUT_LOG_FILE=out$UNITTEST_NUM.log
export ERR_LOG_FILE=err$UNITTEST_NUM.log
export TRACE_LOG_FILE=trace$UNITTEST_NUM.log
export PREP_LOG_FILE=prep$UNITTEST_NUM.log
export VALGRIND_LOG_FILE=${CHECK_TYPE}${UNITTEST_NUM}.log
export VALIDATE_VALGRIND_LOG=1
export RPMEM_LOG_LEVEL=3
export RPMEM_LOG_FILE=rpmem$UNITTEST_NUM.log
export RPMEMD_LOG_LEVEL=info
export RPMEMD_LOG_FILE=rpmemd$UNITTEST_NUM.log
export REMOTE_VARS="
RPMEMD_LOG_FILE
RPMEMD_LOG_LEVEL
RPMEM_LOG_FILE
RPMEM_LOG_LEVEL
PMEM_LOG_FILE
PMEM_LOG_LEVEL
PMEMOBJ_LOG_FILE
PMEMOBJ_LOG_LEVEL
PMEMPOOL_LOG_FILE
PMEMPOOL_LOG_LEVEL"
[ "$UT_DUMP_LINES" ] || UT_DUMP_LINES=30
export CHECK_POOL_LOG_FILE=check_pool_${BUILD}_${UNITTEST_NUM}.log
# In case a lock is required for Device DAXes
DEVDAX_LOCK=../devdax.lock
#
# store_exit_on_error -- store on a stack a sign that reflects the current state
# of the 'errexit' shell option
#
function store_exit_on_error() {
if [ "${-#*e}" != "$-" ]; then
estack+=-
else
estack+=+
fi
}
#
# restore_exit_on_error -- restore the state of the 'errexit' shell option
#
function restore_exit_on_error() {
if [ -z $estack ]; then
fatal "error: store_exit_on_error function has to be called first"
fi
eval "set ${estack:${#estack}-1:1}e"
estack=${estack%?}
}
#
# disable_exit_on_error -- store the state of the 'errexit' shell option and
# disable it
#
function disable_exit_on_error() {
store_exit_on_error
set +e
}
#
# get_files -- print list of files in the current directory matching the given regex to stdout
#
# This function has been implemented to workaround a race condition in
# `find`, which fails if any file disappears in the middle of the operation.
#
# example, to list all *.log files in the current directory
# get_files ".*\.log"
function get_files() {
disable_exit_on_error
ls -1 | grep -E "^$*$"
restore_exit_on_error
}
#
# get_executables -- print list of executable files in the current directory to stdout
#
# This function has been implemented to workaround a race condition in
# `find`, which fails if any file disappears in the middle of the operation.
#
function get_executables() {
disable_exit_on_error
for c in *
do
if [ -f $c -a -x $c ]
then
echo "$c"
fi
done
restore_exit_on_error
}
#
# convert_to_bytes -- converts the string with K, M, G or T suffixes
# to bytes
#
# example:
# "1G" --> "1073741824"
# "2T" --> "2199023255552"
# "3k" --> "3072"
# "1K" --> "1024"
# "10" --> "10"
#
function convert_to_bytes() {
size="$(echo $1 | tr '[:upper:]' '[:lower:]')"
if [[ $size == *kib ]]
then size=$(($(echo $size | tr -d 'kib') * 1024))
elif [[ $size == *mib ]]
then size=$(($(echo $size | tr -d 'mib') * 1024 * 1024))
elif [[ $size == *gib ]]
then size=$(($(echo $size | tr -d 'gib') * 1024 * 1024 * 1024))
elif [[ $size == *tib ]]
then size=$(($(echo $size | tr -d 'tib') * 1024 * 1024 * 1024 * 1024))
elif [[ $size == *pib ]]
then size=$(($(echo $size | tr -d 'pib') * 1024 * 1024 * 1024 * 1024 * 1024))
elif [[ $size == *kb ]]
then size=$(($(echo $size | tr -d 'kb') * 1000))
elif [[ $size == *mb ]]
then size=$(($(echo $size | tr -d 'mb') * 1000 * 1000))
elif [[ $size == *gb ]]
then size=$(($(echo $size | tr -d 'gb') * 1000 * 1000 * 1000))
elif [[ $size == *tb ]]
then size=$(($(echo $size | tr -d 'tb') * 1000 * 1000 * 1000 * 1000))
elif [[ $size == *pb ]]
then size=$(($(echo $size | tr -d 'pb') * 1000 * 1000 * 1000 * 1000 * 1000))
elif [[ $size == *b ]]
then size=$(($(echo $size | tr -d 'b')))
elif [[ $size == *k ]]
then size=$(($(echo $size | tr -d 'k') * 1024))
elif [[ $size == *m ]]
then size=$(($(echo $size | tr -d 'm') * 1024 * 1024))
elif [[ $size == *g ]]
then size=$(($(echo $size | tr -d 'g') * 1024 * 1024 * 1024))
elif [[ $size == *t ]]
then size=$(($(echo $size | tr -d 't') * 1024 * 1024 * 1024 * 1024))
elif [[ $size == *p ]]
then size=$(($(echo $size | tr -d 'p') * 1024 * 1024 * 1024 * 1024 * 1024))
fi
echo "$size"
}
#
# create_file -- create zeroed out files of a given length
#
# example, to create two files, each 1GB in size:
# create_file 1G testfile1 testfile2
#
function create_file() {
size=$(convert_to_bytes $1)
shift
for file in $*
do
$DD if=/dev/zero of=$file bs=1M count=$size iflag=count_bytes >> $PREP_LOG_FILE
done
}
#
# create_nonzeroed_file -- create non-zeroed files of a given length
#
# A given first kilobytes of the file is zeroed out.
#
# example, to create two files, each 1GB in size, with first 4K zeroed
# create_nonzeroed_file 1G 4K testfile1 testfile2
#
function create_nonzeroed_file() {
offset=$(convert_to_bytes $2)
size=$(($(convert_to_bytes $1) - $offset))
shift 2
for file in $*
do
truncate -s ${offset} $file >> $PREP_LOG_FILE
$DD if=/dev/zero bs=1K count=${size} iflag=count_bytes 2>>$PREP_LOG_FILE | tr '\0' '\132' >> $file
done
}
#
# create_holey_file -- create holey files of a given length
#
# examples:
# create_holey_file 1024k testfile1 testfile2
# create_holey_file 2048M testfile1 testfile2
# create_holey_file 234 testfile1
# create_holey_file 2340b testfile1
#
# Input unit size is in bytes with optional suffixes like k, KB, M, etc.
#
function create_holey_file() {
size=$(convert_to_bytes $1)
shift
for file in $*
do
truncate -s ${size} $file >> $PREP_LOG_FILE
done
}
#
# create_poolset -- create a dummy pool set
#
# Creates a pool set file using the provided list of part sizes and paths.
# Optionally, it also creates the selected part files (zeroed, partially zeroed
# or non-zeroed) with requested size and mode. The actual file size may be
# different than the part size in the pool set file.
# 'r' or 'R' on the list of arguments indicate the beginning of the next
# replica set and 'm' or 'M' the beginning of the next remote replica set.
# 'o' or 'O' indicates the next argument is a pool set option.
# A remote replica requires two parameters: a target node and a pool set
# descriptor.
#
# Each part argument has the following format:
# psize:ppath[:cmd[:fsize[:mode]]]
#
# where:
# psize - part size or AUTO (only for DAX device)
# ppath - path
# cmd - (optional) can be:
# x - do nothing (may be skipped if there's no 'fsize', 'mode')
# z - create zeroed (holey) file
# n - create non-zeroed file
# h - create non-zeroed file, but with zeroed header (first 4KB)
# d - create directory
# fsize - (optional) the actual size of the part file (if 'cmd' is not 'x')
# mode - (optional) same format as for 'chmod' command
#
# Each remote replica argument has the following format:
# node:desc
#
# where:
# node - target node
# desc - pool set descriptor
#
# example:
# The following command define a pool set consisting of two parts: 16MB
# and 32MB, a local replica with only one part of 48MB and a remote replica.
# The first part file is not created, the second is zeroed. The only replica
# part is non-zeroed. Also, the last file is read-only and its size
# does not match the information from pool set file. The last but one line
# describes a remote replica. The SINGLEHDR poolset option is set, so only
# the first part in each replica contains a pool header. The remote poolset
# also has to have the SINGLEHDR option.
#
# create_poolset ./pool.set 16M:testfile1 32M:testfile2:z \
# R 48M:testfile3:n:11M:0400 \
# M remote_node:remote_pool.set \
# O SINGLEHDR
#
function create_poolset() {
psfile=$1
shift 1
echo "PMEMPOOLSET" > $psfile
while [ "$1" ]
do
if [ "$1" = "M" ] || [ "$1" = "m" ] # remote replica
then
shift 1
cmd=$1
shift 1
# extract last ":" separated segment as descriptor
# extract everything before last ":" as node address
# this extraction method is compatible with IPv6 and IPv4
node=${cmd%:*}
desc=${cmd##*:}
echo "REPLICA $node $desc" >> $psfile
continue
fi
if [ "$1" = "R" ] || [ "$1" = "r" ]
then
echo "REPLICA" >> $psfile
shift 1
continue
fi
if [ "$1" = "O" ] || [ "$1" = "o" ]
then
echo "OPTION $2" >> $psfile
shift 2
continue
fi
cmd=$1
fparms=(${cmd//:/ })
shift 1
fsize=${fparms[0]}
fpath=${fparms[1]}
cmd=${fparms[2]}
asize=${fparms[3]}
mode=${fparms[4]}
if [ ! $asize ]; then
asize=$fsize
fi
if [ "$asize" != "AUTO" ]; then
asize=$(convert_to_bytes $asize)
fi
case "$cmd"
in
x)
# do nothing
;;
z)
# zeroed (holey) file
truncate -s $asize $fpath >> $PREP_LOG_FILE
;;
n)
# non-zeroed file
$DD if=/dev/zero bs=$asize count=1 2>>$PREP_LOG_FILE | tr '\0' '\132' >> $fpath
;;
h)
# non-zeroed file, except 4K header
truncate -s 4K $fpath >> prep$UNITTEST_NUM.log
$DD if=/dev/zero bs=$asize count=1 2>>$PREP_LOG_FILE | tr '\0' '\132' >> $fpath
truncate -s $asize $fpath >> $PREP_LOG_FILE
;;
d)
mkdir -p $fpath
;;
esac
if [ $mode ]; then
chmod $mode $fpath
fi
echo "$fsize $fpath" >> $psfile
done
}
function dump_last_n_lines() {
if [ "$1" != "" -a -f "$1" ]; then
ln=`wc -l < $1`
if [ $ln -gt $UT_DUMP_LINES ]; then
echo -e "Last $UT_DUMP_LINES lines of $1 below (whole file has $ln lines)." >&2
ln=$UT_DUMP_LINES
else
echo -e "$1 below." >&2
fi
paste -d " " <(yes $UNITTEST_NAME $1 | head -n $ln) <(tail -n $ln $1) >&2
echo >&2
fi
}
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=810295
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=780173
# https://bugs.kde.org/show_bug.cgi?id=303877
#
# valgrind issues an unsuppressable warning when exceeding
# the brk segment, causing matching failures. We can safely
# ignore it because malloc() will fallback to mmap() anyway.
function valgrind_ignore_warnings() {
cat $1 | grep -v \
-e "WARNING: Serious error when reading debug info" \
-e "When reading debug info from " \
-e "Ignoring non-Dwarf2/3/4 block in .debug_info" \
-e "Last block truncated in .debug_info; ignoring" \
-e "parse_CU_Header: is neither DWARF2 nor DWARF3 nor DWARF4" \
-e "brk segment overflow" \
-e "see section Limitations in user manual" \
-e "Warning: set address range perms: large range"\
-e "further instances of this message will not be shown"\
> $1.tmp
mv $1.tmp $1
}
#
# get_trace -- return tracing tool command line if applicable
# usage: get_trace <check type> <log file> [<node>]
#
function get_trace() {
if [ "$1" == "none" ]; then
echo "$TRACE"
return
fi
local exe=$VALGRINDEXE
local check_type=$1
local log_file=$2
local opts="$VALGRIND_OPTS"
local node=-1
[ "$#" -eq 3 ] && node=$3
if [ "$check_type" = "memcheck" -a "$MEMCHECK_DONT_CHECK_LEAKS" != "1" ]; then
opts="$opts --leak-check=full"
fi
if [ "$check_type" = "pmemcheck" ]; then
# Before Skylake, Intel CPUs did not have clflushopt instruction, so
# pmem_flush and pmem_persist both translated to clflush.
# This means that missing pmem_drain after pmem_flush could only be
# detected on Skylake+ CPUs.
# This option tells pmemcheck to expect fence (sfence or
# VALGRIND_PMC_DO_FENCE client request, used by pmem_drain) after
# clflush and makes pmemcheck output the same on pre-Skylake and
# post-Skylake CPUs.
opts="$opts --expect-fence-after-clflush=yes"
fi
opts="$opts $VALGRIND_SUPP"
if [ "$node" -ne -1 ]; then
exe=${NODE_VALGRINDEXE[$node]}
opts="$opts"
case "$check_type" in
memcheck)
opts="$opts --suppressions=../memcheck-libibverbs.supp"
;;
helgrind)
opts="$opts --suppressions=../helgrind-cxgb4.supp"
opts="$opts --suppressions=../helgrind-libfabric.supp"
;;
drd)
opts="$opts --suppressions=../drd-libfabric.supp"
;;
esac
fi
echo "$exe --tool=$check_type --log-file=$log_file $opts $TRACE"
return
}
#
# validate_valgrind_log -- validate valgrind log
# usage: validate_valgrind_log <log-file>
#
function validate_valgrind_log() {
[ "$VALIDATE_VALGRIND_LOG" != "1" ] && return
# fail if there are valgrind errors found or
# if it detects overlapping chunks
if [ ! -e "$1.match" ] && grep \
-e "ERROR SUMMARY: [^0]" \
-e "Bad mempool" \
$1 >/dev/null ;
then
msg="failed"
[ -t 2 ] && command -v tput >/dev/null && msg="$(tput setaf 1)$msg$(tput sgr0)"
echo -e "$UNITTEST_NAME $msg with Valgrind. See $1. Last 20 lines below." >&2
paste -d " " <(yes $UNITTEST_NAME $1 | head -n 20) <(tail -n 20 $1) >&2
false
fi
}
#
# expect_normal_exit -- run a given command, expect it to exit 0
#
# if VALGRIND_DISABLED is not empty valgrind tool will be omitted
#
function expect_normal_exit() {
local VALGRIND_LOG_FILE=${CHECK_TYPE}${UNITTEST_NUM}.log
local N=$2
# in case of a remote execution disable valgrind check if valgrind is not
# enabled on node
local _CHECK_TYPE=$CHECK_TYPE
if [ "x$VALGRIND_DISABLED" != "x" ]; then
_CHECK_TYPE=none
fi
if [ "$1" == "run_on_node" -o "$1" == "run_on_node_background" ]; then
if [ -z $(is_valgrind_enabled_on_node $N) ]; then
_CHECK_TYPE="none"
fi
else
N=-1
fi
if [ -n "$TRACE" ]; then
case "$1"
in
*_on_node*)
msg "$UNITTEST_NAME: SKIP: TRACE is not supported if test is executed on remote nodes"
exit 0
esac
fi
local trace=$(get_trace $_CHECK_TYPE $VALGRIND_LOG_FILE $N)
if [ "$MEMCHECK_DONT_CHECK_LEAKS" = "1" -a "$CHECK_TYPE" = "memcheck" ]; then
export OLD_ASAN_OPTIONS="${ASAN_OPTIONS}"
export ASAN_OPTIONS="detect_leaks=0 ${ASAN_OPTIONS}"
fi
if [ "$CHECK_TYPE" = "helgrind" ]; then
export VALGRIND_OPTS="--suppressions=../helgrind-log.supp"
fi
if [ "$CHECK_TYPE" = "memcheck" ]; then
export VALGRIND_OPTS="$VALGRIND_OPTS --suppressions=../memcheck-dlopen.supp"
fi
# in case of preloading libvmmalloc.so.1 force valgrind to not override malloc
if [ -n "$VALGRINDEXE" -a -n "$TEST_LD_PRELOAD" ]; then
if [ $(valgrind_version) -ge 312 ]; then
preload=`basename $TEST_LD_PRELOAD`
fi
if [ "$preload" == "$VMMALLOC" ]; then
export VALGRIND_OPTS="$VALGRIND_OPTS --soname-synonyms=somalloc=nouserintercepts"
fi
fi
local REMOTE_VALGRIND_LOG=0
if [ "$CHECK_TYPE" != "none" ]; then
case "$1"
in
run_on_node)
REMOTE_VALGRIND_LOG=1
trace="$1 $2 $trace"
[ $# -ge 2 ] && shift 2 || shift $#
;;
run_on_node_background)
trace="$1 $2 $3 $trace"
[ $# -ge 3 ] && shift 3 || shift $#
;;
wait_on_node|wait_on_node_port|kill_on_node)
[ "$1" = "wait_on_node" ] && REMOTE_VALGRIND_LOG=1
trace="$1 $2 $3 $4"
[ $# -ge 4 ] && shift 4 || shift $#
;;
esac
fi
if [ "$CHECK_TYPE" = "drd" ]; then
export VALGRIND_OPTS="$VALGRIND_OPTS --suppressions=../drd-log.supp"
fi
disable_exit_on_error
eval $ECHO LD_LIBRARY_PATH=$TEST_LD_LIBRARY_PATH LD_PRELOAD=$TEST_LD_PRELOAD \
$trace $*
ret=$?
if [ $REMOTE_VALGRIND_LOG -eq 1 ]; then
for node in $CHECK_NODES
do
local new_log_file=node\_$node\_$VALGRIND_LOG_FILE
copy_files_from_node $node "." ${NODE_TEST_DIR[$node]}/$VALGRIND_LOG_FILE
mv $VALGRIND_LOG_FILE $new_log_file
done
fi
restore_exit_on_error
if [ "$ret" -ne "0" ]; then
if [ "$ret" -gt "128" ]; then
msg="crashed (signal $(($ret - 128)))"
else
msg="failed with exit code $ret"
fi
[ -t 2 ] && command -v tput >/dev/null && msg="$(tput setaf 1)$msg$(tput sgr0)"
if [ -f $ERR_LOG_FILE ]; then
if [ "$UNITTEST_LOG_LEVEL" -ge "1" ]; then
echo -e "$UNITTEST_NAME $msg. $ERR_LOG_FILE below." >&2
cat $ERR_LOG_FILE >&2
else
echo -e "$UNITTEST_NAME $msg. $ERR_LOG_FILE above." >&2
fi
else
echo -e "$UNITTEST_NAME $msg." >&2
fi
if [ "$CHECK_TYPE" != "none" -a -f $VALGRIND_LOG_FILE ]; then
dump_last_n_lines $VALGRIND_LOG_FILE
fi
# ignore Ctrl-C
if [ $ret != 130 ]; then
for f in $(get_files "node_.*${UNITTEST_NUM}\.log"); do
dump_last_n_lines $f
done
dump_last_n_lines $TRACE_LOG_FILE
dump_last_n_lines $PMEM_LOG_FILE
dump_last_n_lines $PMEMOBJ_LOG_FILE
dump_last_n_lines $PMEMLOG_LOG_FILE
dump_last_n_lines $PMEMBLK_LOG_FILE
dump_last_n_lines $PMEMCTO_LOG_FILE
dump_last_n_lines $PMEMPOOL_LOG_FILE
dump_last_n_lines $VMEM_LOG_FILE
dump_last_n_lines $VMMALLOC_LOG_FILE
dump_last_n_lines $RPMEM_LOG_FILE
dump_last_n_lines $RPMEMD_LOG_FILE
fi
[ $NODES_MAX -ge 0 ] && clean_all_remote_nodes
false
fi
if [ "$CHECK_TYPE" != "none" ]; then
if [ $REMOTE_VALGRIND_LOG -eq 1 ]; then
for node in $CHECK_NODES
do
local log_file=node\_$node\_$VALGRIND_LOG_FILE
valgrind_ignore_warnings $new_log_file
validate_valgrind_log $new_log_file
done
else
if [ -f $VALGRIND_LOG_FILE ]; then
valgrind_ignore_warnings $VALGRIND_LOG_FILE
validate_valgrind_log $VALGRIND_LOG_FILE
fi
fi
fi
if [ "$MEMCHECK_DONT_CHECK_LEAKS" = "1" -a "$CHECK_TYPE" = "memcheck" ]; then
export ASAN_OPTIONS="${OLD_ASAN_OPTIONS}"
fi
}
#
# expect_abnormal_exit -- run a given command, expect it to exit non-zero
#
function expect_abnormal_exit() {
if [ -n "$TRACE" ]; then
case "$1"
in
*_on_node*)
msg "$UNITTEST_NAME: SKIP: TRACE is not supported if test is executed on remote nodes"
exit 0
esac
fi
# in case of preloading libvmmalloc.so.1 force valgrind to not override malloc
if [ -n "$VALGRINDEXE" -a -n "$TEST_LD_PRELOAD" ]; then
if [ $(valgrind_version) -ge 312 ]; then
preload=`basename $TEST_LD_PRELOAD`
fi
if [ "$preload" == "$VMMALLOC" ]; then
export VALGRIND_OPTS="$VALGRIND_OPTS --soname-synonyms=somalloc=nouserintercepts"
fi
fi
if [ "$CHECK_TYPE" = "drd" ]; then
export VALGRIND_OPTS="$VALGRIND_OPTS --suppressions=../drd-log.supp"
fi
disable_exit_on_error
eval $ECHO ASAN_OPTIONS="detect_leaks=0 ${ASAN_OPTIONS}" \
LD_LIBRARY_PATH=$TEST_LD_LIBRARY_PATH LD_PRELOAD=$TEST_LD_PRELOAD $TRACE $*
ret=$?
restore_exit_on_error
if [ "$ret" -eq "0" ]; then
msg="succeeded"
[ -t 2 ] && command -v tput >/dev/null && msg="$(tput setaf 1)$msg$(tput sgr0)"
echo -e "$UNITTEST_NAME command $msg unexpectedly." >&2
[ $NODES_MAX -ge 0 ] && clean_all_remote_nodes
false
fi
}
#
# check_pool -- run pmempool check on specified pool file
#
function check_pool() {
if [ "$CHECK_POOL" == "1" ]
then
if [ "$VERBOSE" != "0" ]
then
echo "$UNITTEST_NAME: checking consistency of pool ${1}"
fi
${PMEMPOOL}.static-nondebug check $1 2>&1 1>>$CHECK_POOL_LOG_FILE
fi
}
#
# check_pools -- run pmempool check on specified pool files
#
function check_pools() {
if [ "$CHECK_POOL" == "1" ]
then
for f in $*
do
check_pool $f
done
fi
}
#
# require_unlimited_vm -- require unlimited virtual memory
#
# This implies requirements for:
# - overcommit_memory enabled (/proc/sys/vm/overcommit_memory is 0 or 1)
# - unlimited virtual memory (ulimit -v is unlimited)
#
function require_unlimited_vm() {
$VM_OVERCOMMIT && [ $(ulimit -v) = "unlimited" ] && return
msg "$UNITTEST_NAME: SKIP required: overcommit_memory enabled and unlimited virtual memory"
exit 0
}
#
# require_linked_with_ndctl -- require an executable linked with libndctl
#
# usage: require_linked_with_ndctl <executable-file>
#
function require_linked_with_ndctl() {
[ "$1" == "" -o ! -x "$1" ] && \
fatal "$UNITTEST_NAME: ERROR: require_linked_with_ndctl() requires one argument - an executable file"
local lddndctl=$(expect_normal_exit ldd $1 | $GREP -ce "libndctl")
[ "$lddndctl" == "1" ] && return
msg "$UNITTEST_NAME: SKIP required: executable $1 linked with libndctl"
exit 0
}
#
# require_sudo_allowed -- require sudo command is allowed
#
function require_sudo_allowed() {
if [ "$ENABLE_SUDO_TESTS" != "y" ]; then
msg "$UNITTEST_NAME: SKIP: tests using 'sudo' are not enabled in testconfig.sh (ENABLE_SUDO_TESTS)"
exit 0
fi
if ! timeout --signal=SIGKILL --kill-after=3s 3s sudo date >/dev/null 2>&1
then
msg "$UNITTEST_NAME: SKIP required: sudo allowed"
exit 0
fi
}
#
# require_sudo_allowed_node -- require sudo command on a remote node
#
# usage: require_sudo_allowed_node <node-number>
#
function require_sudo_allowed_node() {
if [ "$ENABLE_SUDO_TESTS" != "y" ]; then
msg "$UNITTEST_NAME: SKIP: tests using 'sudo' are not enabled in testconfig.sh (ENABLE_SUDO_TESTS)"
exit 0
fi
if ! run_on_node $1 "timeout --signal=SIGKILL --kill-after=3s 3s sudo date" >/dev/null 2>&1
then
msg "$UNITTEST_NAME: SKIP required: sudo allowed on node $1"
exit 0
fi
}
#
# require_no_superuser -- require user without superuser rights
#
function require_no_superuser() {
local user_id=$(id -u)
[ "$user_id" != "0" ] && return
msg "$UNITTEST_NAME: SKIP required: run without superuser rights"
exit 0
}
#
# require_no_freebsd -- Skip test on FreeBSD
#
function require_no_freebsd() {
[ "$(uname -s)" != "FreeBSD" ] && return
msg "$UNITTEST_NAME: SKIP: Not supported on FreeBSD"
exit 0
}
#
# require_procfs -- Skip test if /proc is not mounted
#
function require_procfs() {
mount | grep -q "/proc" && return
msg "$UNITTEST_NAME: SKIP: /proc not mounted"
exit 0
}
function get_arch() {
gcc -dumpmachine | awk -F'[/-]' '{print $1}'
}
function require_x86_64() {
[ $(get_arch) = "x86_64" ] && return
msg "$UNITTEST_NAME: SKIP: Not supported on arch != x86_64"
exit 0
}
#
# require_test_type -- only allow script to continue for a certain test type
#
function require_test_type() {
req_test_type=1
for type in $*
do
case "$TEST"
in
all)
# "all" is a synonym of "short + medium + long"
return
;;
check)
# "check" is a synonym of "short + medium"
[ "$type" = "short" -o "$type" = "medium" ] && return
;;
*)
[ "$type" = "$TEST" ] && return
;;
esac
done
verbose_msg "$UNITTEST_NAME: SKIP test-type $TEST ($* required)"
exit 0
}
#
# require_dev_dax_region -- check if region id file exist for dev dax
#
function require_dev_dax_region() {
local prefix="$UNITTEST_NAME: SKIP"
local cmd="$PMEMDETECT -r"
for path in ${DEVICE_DAX_PATH[@]}
do
disable_exit_on_error
out=$($cmd $path 2>&1)
ret=$?
restore_exit_on_error
if [ "$ret" == "0" ]; then
continue
elif [ "$ret" == "1" ]; then
msg "$prefix $out"
exit 0
else
fatal "$UNITTEST_NAME: pmemdetect: $out"
fi
done
DEVDAX_TO_LOCK=1
}
#
# lock_devdax -- acquire a lock on Device DAXes
#
lock_devdax() {
exec {DEVDAX_LOCK_FD}> $DEVDAX_LOCK
flock $DEVDAX_LOCK_FD
}
#
# unlock_devdax -- release a lock on Device DAXes
#
unlock_devdax() {
flock -u $DEVDAX_LOCK_FD
eval "exec ${DEVDAX_LOCK_FD}>&-"
}
#
# require_dev_dax_node -- common function for require_dax_devices and
# node_require_dax_device
#
# usage: require_dev_dax_node <N devices> [<node>]
#
function require_dev_dax_node() {
req_dax_dev=1
if [ "$req_dax_dev_align" == "1" ]; then
fatal "$UNITTEST_NAME: Do not use 'require_(node_)dax_devices' and "
"'require_(node_)dax_device_alignments' together. Use the latter instead."
fi
local min=$1
local node=$2
if [ -n "$node" ]; then
local DIR=${NODE_WORKING_DIR[$node]}/$curtestdir
local prefix="$UNITTEST_NAME: SKIP NODE $node:"
local device_dax_path=(${NODE_DEVICE_DAX_PATH[$node]})
if [ ${#device_dax_path[@]} -lt $min ]; then
msg "$prefix NODE_${node}_DEVICE_DAX_PATH does not specify enough dax devices (min: $min)"
exit 0
fi
local cmd="ssh $SSH_OPTS ${NODE[$node]} cd $DIR && LD_LIBRARY_PATH=$REMOTE_LD_LIBRARY_PATH ../pmemdetect -d"
else
local prefix="$UNITTEST_NAME: SKIP"
if [ ${#DEVICE_DAX_PATH[@]} -lt $min ]; then
msg "$prefix DEVICE_DAX_PATH does not specify enough dax devices (min: $min)"
exit 0
fi
local device_dax_path=${DEVICE_DAX_PATH[@]}
local cmd="$PMEMDETECT -d"
fi
for path in ${device_dax_path[@]}
do
disable_exit_on_error
out=$($cmd $path 2>&1)
ret=$?
restore_exit_on_error
if [ "$ret" == "0" ]; then
continue
elif [ "$ret" == "1" ]; then
msg "$prefix $out"
exit 0
else
fatal "$UNITTEST_NAME: pmemdetect: $out"
fi
done
DEVDAX_TO_LOCK=1
}
#
# require_dax_devices -- only allow script to continue if there is a required
# number of Device DAX devices
#
function require_dax_devices() {
require_dev_dax_node $1
}
#
# require_node_dax_device -- only allow script to continue if specified node
# has enough Device DAX devices defined in testconfig.sh
#
function require_node_dax_device() {
validate_node_number $1
require_dev_dax_node $2 $1
}
#
# require_no_unicode -- overwrite unicode suffix to empty string
#
function require_no_unicode() {
export SUFFIX=""
}
#
# get_node_devdax_path -- get path of a Device DAX device on a node
#
# usage: get_node_devdax_path <node> <device>
#
get_node_devdax_path() {
local node=$1
local device=$2
local device_dax_path=(${NODE_DEVICE_DAX_PATH[$node]})
echo ${device_dax_path[$device]}
}
#
# dax_device_zero -- zero all local dax devices
#
dax_device_zero() {
for path in ${DEVICE_DAX_PATH[@]}
do
${PMEMPOOL}.static-debug rm -f $path
done
}
#
# node_dax_device_zero -- zero all dax devices on a node
#
node_dax_device_zero() {
local node=$1
local DIR=${NODE_WORKING_DIR[$node]}/$curtestdir
local prefix="$UNITTEST_NAME: SKIP NODE $node:"
local device_dax_path=(${NODE_DEVICE_DAX_PATH[$node]})
local cmd="ssh $SSH_OPTS ${NODE[$node]} cd $DIR && LD_LIBRARY_PATH=$REMOTE_LD_LIBRARY_PATH ../pmempool rm -f"
for path in ${device_dax_path[@]}
do
disable_exit_on_error
out=$($cmd $path 2>&1)
ret=$?
restore_exit_on_error
if [ "$ret" == "0" ]; then
continue
elif [ "$ret" == "1" ]; then
msg "$prefix $out"
exit 0
else
fatal "$UNITTEST_NAME: pmempool rm: $out"
fi
done
}
#
# get_devdax_size -- get the size of a device dax
#
function get_devdax_size() {
local device=$1
local path=${DEVICE_DAX_PATH[$device]}
local major_hex=$(stat -c "%t" $path)
local minor_hex=$(stat -c "%T" $path)
local major_dec=$((16#$major_hex))
local minor_dec=$((16#$minor_hex))
cat /sys/dev/char/$major_dec:$minor_dec/size
}
#
# get_node_devdax_size -- get the size of a device dax on a node
#
function get_node_devdax_size() {
local node=$1
local device=$2
local device_dax_path=(${NODE_DEVICE_DAX_PATH[$node]})
local path=${device_dax_path[$device]}
local cmd_prefix="ssh $SSH_OPTS ${NODE[$node]} "
disable_exit_on_error
out=$($cmd_prefix stat -c %t $path 2>&1)
ret=$?
restore_exit_on_error
if [ "$ret" != "0" ]; then
fatal "$UNITTEST_NAME: stat on node $node: $out"
fi
local major=$((16#$out))
disable_exit_on_error
out=$($cmd_prefix stat -c %T $path 2>&1)
ret=$?
restore_exit_on_error
if [ "$ret" != "0" ]; then
fatal "$UNITTEST_NAME: stat on node $node: $out"
fi
local minor=$((16#$out))
disable_exit_on_error
out=$($cmd_prefix "cat /sys/dev/char/$major:$minor/size" 2>&1)
ret=$?
restore_exit_on_error
if [ "$ret" != "0" ]; then
fatal "$UNITTEST_NAME: stat on node $node: $out"
fi
echo $out
}
#
# dax_get_alignment -- get the alignment of a device dax
#
function dax_get_alignment() {
major_hex=$(stat -c "%t" $1)
minor_hex=$(stat -c "%T" $1)
major_dec=$((16#$major_hex))
minor_dec=$((16#$minor_hex))
cat /sys/dev/char/$major_dec:$minor_dec/device/align
}
#
# require_dax_device_node_alignments -- only allow script to continue if
# the internal Device DAX alignments on a remote nodes are as specified.
# If necessary, it sorts DEVICE_DAX_PATH entries to match
# the requested alignment order.
#
# usage: require_node_dax_device_alignments <node> <alignment1> [ alignment2 ... ]
#
function require_node_dax_device_alignments() {
req_dax_dev_align=1
if [ "$req_dax_dev" == "$1" ]; then
fatal "$UNITTEST_NAME: Do not use 'require_(node_)dax_devices' and "
"'require_(node_)dax_device_alignments' together. Use the latter instead."
fi
local node=$1
shift
if [ "$node" == "-1" ]; then
local device_dax_path=(${DEVICE_DAX_PATH[@]})
local cmd="$PMEMDETECT -a"
else
local device_dax_path=(${NODE_DEVICE_DAX_PATH[$node]})
local DIR=${NODE_WORKING_DIR[$node]}/$curtestdir
local cmd="ssh $SSH_OPTS ${NODE[$node]} cd $DIR && LD_LIBRARY_PATH=$REMOTE_LD_LIBRARY_PATH ../pmemdetect -a"
fi
local cnt=${#device_dax_path[@]}
local j=0
for alignment in $*
do
for (( i=j; i<cnt; i++ ))
do
path=${device_dax_path[$i]}
disable_exit_on_error
out=$($cmd $alignment $path 2>&1)
ret=$?
restore_exit_on_error
if [ "$ret" == "0" ]; then
if [ $i -ne $j ]; then
# swap device paths
tmp=${device_dax_path[$j]}
device_dax_path[$j]=$path
device_dax_path[$i]=$tmp
if [ "$node" == "-1" ]; then
DEVICE_DAX_PATH=(${device_dax_path[@]})
else
NODE_DEVICE_DAX_PATH[$node]=${device_dax_path[@]}
fi
fi
break
fi
done
if [ $i -eq $cnt ]; then
if [ "$node" == "-1" ]; then
msg "$UNITTEST_NAME: SKIP DEVICE_DAX_PATH"\
"does not specify enough dax devices or they don't have required alignments (min: $#, alignments: $*)"
else
msg "$UNITTEST_NAME: SKIP NODE $node: NODE_${node}_DEVICE_DAX_PATH"\
"does not specify enough dax devices or they don't have required alignments (min: $#, alignments: $*)"
fi
exit 0
fi
j=$(( j + 1 ))
done
}
#
# require_dax_device_alignments -- only allow script to continue if
# the internal Device DAX alignments are as specified.
# If necessary, it sorts DEVICE_DAX_PATH entries to match
# the requested alignment order.
#
# usage: require_dax_device_alignments alignment1 [ alignment2 ... ]
#
require_dax_device_alignments() {
require_node_dax_device_alignments -1 $*
}
#
# require_fs_type -- only allow script to continue for a certain fs type
#
function require_fs_type() {
req_fs_type=1
for type in $*
do
# treat any as either pmem or non-pmem
[ "$type" = "$FS" ] ||
([ -n "${FORCE_FS:+x}" ] && [ "$type" = "any" ] &&
[ "$FS" != "none" ]) && return
done
verbose_msg "$UNITTEST_NAME: SKIP fs-type $FS ($* required)"
exit 0
}
#
# require_native_fallocate -- verify if filesystem supports fallocate
#
function require_native_fallocate() {
require_fs_type pmem non-pmem
set +e
$FALLOCATE_DETECT $1
status=$?
set -e
if [ $status -eq 1 ]; then
msg "$UNITTEST_NAME: SKIP: filesystem does not support fallocate"
exit 0
elif [ $status -ne 0 ]; then
msg "$UNITTEST_NAME: fallocate_detect failed"
exit 1
fi
}
#
# require_fs_name -- verify if the $DIR is on the required file system
#
# Must be AFTER setup() because $DIR must exist
#
function require_fs_name() {
fsname=`df $DIR -PT | awk '{if (NR == 2) print $2}'`
for name in $*
do
if [ "$name" == "$fsname" ]; then
return
fi
done
echo "$UNITTEST_NAME: SKIP file system $fsname ($* required)"
exit 0
}
#
# require_build_type -- only allow script to continue for a certain build type
#
function require_build_type() {
for type in $*
do
[ "$type" = "$BUILD" ] && return
done
verbose_msg "$UNITTEST_NAME: SKIP build-type $BUILD ($* required)"
exit 0
}
#
# require_command -- only allow script to continue if specified command exists
#
function require_command() {
if ! which $1 &>/dev/null; then
msg "$UNITTEST_NAME: SKIP: '$1' command required"
exit 0
fi
}
#
# require_command_node -- only allow script to continue if specified command exists on a remote node
#
# usage: require_command_node <node-number>
#
function require_command_node() {
if ! run_on_node $1 "which $2 &>/dev/null"; then
msg "$UNITTEST_NAME: SKIP: node $1: '$2' command required"
exit 0
fi
}
#
# require_kernel_module -- only allow script to continue if specified kernel module exists
#
# usage: require_kernel_module <module_name> [path_to_modinfo]
#
function require_kernel_module() {
MODULE=$1
MODINFO=$2
if [ "$MODINFO" == "" ]; then
set +e
[ "$MODINFO" == "" ] && \
MODINFO=$(which modinfo 2>/dev/null)
set -e
[ "$MODINFO" == "" ] && \
[ -x /usr/sbin/modinfo ] && MODINFO=/usr/sbin/modinfo
[ "$MODINFO" == "" ] && \
[ -x /sbin/modinfo ] && MODINFO=/sbin/modinfo
[ "$MODINFO" == "" ] && \
msg "$UNITTEST_NAME: SKIP: modinfo command required" && \
exit 0
else
[ ! -x $MODINFO ] && \
msg "$UNITTEST_NAME: SKIP: modinfo command required" && \
exit 0
fi
$MODINFO -F name $MODULE &>/dev/null && true
if [ $? -ne 0 ]; then
msg "$UNITTEST_NAME: SKIP: '$MODULE' kernel module required"
exit 0
fi
}
#
# require_kernel_module_node -- only allow script to continue if specified kernel module exists on a remote node
#
# usage: require_kernel_module_node <node> <module_name> [path_to_modinfo]
#
function require_kernel_module_node() {
NODE_N=$1
MODULE=$2
MODINFO=$3
if [ "$MODINFO" == "" ]; then
set +e
[ "$MODINFO" == "" ] && \
MODINFO=$(run_on_node $NODE_N which modinfo 2>/dev/null)
set -e
[ "$MODINFO" == "" ] && \
run_on_node $NODE_N "test -x /usr/sbin/modinfo" && MODINFO=/usr/sbin/modinfo
[ "$MODINFO" == "" ] && \
run_on_node $NODE_N "test -x /sbin/modinfo" && MODINFO=/sbin/modinfo
[ "$MODINFO" == "" ] && \
msg "$UNITTEST_NAME: SKIP: node $NODE_N: modinfo command required" && \
exit 0
else
run_on_node $NODE_N "test ! -x $MODINFO" && \
msg "$UNITTEST_NAME: SKIP: node $NODE_N: modinfo command required" && \
exit 0
fi
run_on_node $NODE_N "$MODINFO -F name $MODULE &>/dev/null" && true
if [ $? -ne 0 ]; then
msg "$UNITTEST_NAME: SKIP: node $NODE_N: '$MODULE' kernel module required"
exit 0
fi
}
#
# require_pkg -- only allow script to continue if specified package exists
# usage: require_pkg <package name> [<package minimal version>]
#
function require_pkg() {
if ! command -v pkg-config 1>/dev/null
then
msg "$UNITTEST_NAME: SKIP pkg-config required"
exit 0
fi
local COMMAND="pkg-config $1"
local MSG="$UNITTEST_NAME: SKIP '$1' package"
if [ "$#" -eq "2" ]; then
COMMAND="$COMMAND --atleast-version $2"
MSG="$MSG (version >= $2)"
fi
MSG="$MSG required"
if ! $COMMAND
then
msg "$MSG"
exit 0
fi
}
#
# require_node_pkg -- only allow script to continue if specified package exists
# on specified node
# usage: require_node_pkg <node> <package name> [<package minimal version>]
#
function require_node_pkg() {
validate_node_number $1
local N=$1
shift
local DIR=${NODE_WORKING_DIR[$N]}/$curtestdir
local COMMAND="${NODE_ENV[$N]}"
if [ -n "${NODE_LD_LIBRARY_PATH[$N]}" ]; then
local PKG_CONFIG_PATH=${NODE_LD_LIBRARY_PATH[$N]//:/\/pkgconfig:}/pkgconfig
COMMAND="$COMMAND PKG_CONFIG_PATH=\$PKG_CONFIG_PATH:$PKG_CONFIG_PATH"
fi
COMMAND="$COMMAND pkg-config $1"
MSG="$UNITTEST_NAME: SKIP NODE $N: '$1' package"
if [ "$#" -eq "2" ]; then
COMMAND="$COMMAND --atleast-version $2"
MSG="$MSG (version >= $2)"
fi
MSG="$MSG required"
disable_exit_on_error
run_command ssh $SSH_OPTS ${NODE[$N]} "$COMMAND" 2>&1
ret=$?
restore_exit_on_error
if [ "$ret" == 1 ]; then
msg "$MSG"
exit 0
fi
}
#
# configure_valgrind -- only allow script to continue when settings match
#
function configure_valgrind() {
case "$1"
in
memcheck|pmemcheck|helgrind|drd|force-disable)
;;
*)
usage "bad test-type: $1"
;;
esac
if [ "$CHECK_TYPE" == "none" ]; then
if [ "$1" == "force-disable" ]; then
msg "$UNITTEST_NAME: all valgrind tests disabled"
elif [ "$2" = "force-enable" ]; then
CHECK_TYPE="$1"
require_valgrind_tool $1 $3
elif [ "$2" = "force-disable" ]; then
CHECK_TYPE=none
else
fatal "invalid parameter"
fi
else
if [ "$1" == "force-disable" ]; then
msg "$UNITTEST_NAME: SKIP RUNTESTS script parameter $CHECK_TYPE tries to enable valgrind test when all valgrind tests are disabled in TEST"
exit 0
elif [ "$CHECK_TYPE" != "$1" -a "$2" == "force-enable" ]; then
msg "$UNITTEST_NAME: SKIP RUNTESTS script parameter $CHECK_TYPE tries to enable different valgrind test than one defined in TEST"
exit 0
elif [ "$CHECK_TYPE" == "$1" -a "$2" == "force-disable" ]; then
msg "$UNITTEST_NAME: SKIP RUNTESTS script parameter $CHECK_TYPE tries to enable test defined in TEST as force-disable"
exit 0
fi
require_valgrind_tool $CHECK_TYPE $3
fi
if [ "$UT_VALGRIND_SKIP_PRINT_MISMATCHED" == 1 ]; then
export UT_SKIP_PRINT_MISMATCHED=1
fi
}
#
# valgrind_version_no_check -- returns Valgrind version without checking
# for valgrind first
#
function valgrind_version_no_check() {
require_command bc
$VALGRINDEXE --version | sed "s/valgrind-\([0-9]*\)\.\([0-9]*\).*/\1*100+\2/" | bc
}
#
# require_valgrind -- continue script execution only if
# valgrind package is installed
#
function require_valgrind() {
require_no_asan
disable_exit_on_error
VALGRINDEXE=`which valgrind 2>/dev/null`
local ret=$?
restore_exit_on_error
if [ $ret -ne 0 ]; then
msg "$UNITTEST_NAME: SKIP valgrind required"
exit 0
fi
[ $NODES_MAX -lt 0 ] && return;
if [ ! -z "$1" ]; then
available=$(valgrind_version_no_check)
required=`echo $1 | sed "s/\([0-9]*\)\.\([0-9]*\).*/\1*100+\2/" | bc`
if [ $available -lt $required ]; then
msg "$UNITTEST_NAME: SKIP valgrind required (ver $1 or later)"
exit 0
fi
fi
for N in $NODES_SEQ; do
if [ "${NODE_VALGRINDEXE[$N]}" = "" ]; then
disable_exit_on_error
NODE_VALGRINDEXE[$N]=$(ssh $SSH_OPTS ${NODE[$N]} "which valgrind 2>/dev/null")
ret=$?
restore_exit_on_error
if [ $ret -ne 0 ]; then
msg "$UNITTEST_NAME: SKIP valgrind required on remote node #$N"
exit 0
fi
fi
done
}
#
# valgrind_version -- returns Valgrind version
#
function valgrind_version() {
require_valgrind
valgrind_version_no_check
}
#
# require_valgrind_tool -- continue script execution only if valgrind with
# specified tool is installed
#
# usage: require_valgrind_tool <tool> [<binary>]
#
function require_valgrind_tool() {
require_valgrind
local tool=$1
local binary=$2
local dir=.
[ -d "$2" ] && dir="$2" && binary=
pushd "$dir" > /dev/null
[ -n "$binary" ] || binary=$(get_executables)
if [ -z "$binary" ]; then
fatal "require_valgrind_tool: error: no binary found"
fi
strings ${binary} 2>&1 | \
grep -q "compiled with support for Valgrind $tool" && true
if [ $? -ne 0 ]; then
msg "$UNITTEST_NAME: SKIP not compiled with support for Valgrind $tool"
exit 0
fi
if [ "$tool" == "helgrind" ]; then
valgrind --tool=$tool --help 2>&1 | \
grep -qi "$tool is Copyright (c)" && true
if [ $? -ne 0 ]; then
msg "$UNITTEST_NAME: SKIP Valgrind with $tool required"
exit 0;
fi
fi
if [ "$tool" == "pmemcheck" ]; then
out=`valgrind --tool=$tool --help 2>&1` && true
echo "$out" | grep -qi "$tool is Copyright (c)" && true
if [ $? -ne 0 ]; then
msg "$UNITTEST_NAME: SKIP Valgrind with $tool required"
exit 0;
fi
echo "$out" | grep -qi "expect-fence-after-clflush" && true
if [ $? -ne 0 ]; then
msg "$UNITTEST_NAME: SKIP pmemcheck does not support --expect-fence-after-clflush option. Please update it to the latest version."
exit 0;
fi
fi
popd > /dev/null
return 0
}
#
# set_valgrind_exe_name -- set the actual Valgrind executable name
#
# On some systems (Ubuntu), "valgrind" is a shell script that calls
# the actual executable "valgrind.bin".
# The wrapper script doesn't work well with LD_PRELOAD, so we want
# to call Valgrind directly.
#
function set_valgrind_exe_name() {
if [ "$VALGRINDEXE" = "" ]; then
fatal "set_valgrind_exe_name: error: valgrind is not set up"
fi
local VALGRINDDIR=`dirname $VALGRINDEXE`
if [ -x $VALGRINDDIR/valgrind.bin ]; then
VALGRINDEXE=$VALGRINDDIR/valgrind.bin
fi
[ $NODES_MAX -lt 0 ] && return;
for N in $NODES_SEQ; do
local COMMAND="\
[ -x $(dirname ${NODE_VALGRINDEXE[$N]})/valgrind.bin ] && \
echo $(dirname ${NODE_VALGRINDEXE[$N]})/valgrind.bin || \
echo ${NODE_VALGRINDEXE[$N]}"
NODE_VALGRINDEXE[$N]=$(ssh $SSH_OPTS ${NODE[$N]} $COMMAND)
if [ $? -ne 0 ]; then
fatal ${NODE_VALGRINDEXE[$N]}
fi
done
}
#
# require_no_asan_for - continue script execution only if passed binary does
# NOT require libasan
#
function require_no_asan_for() {
disable_exit_on_error
nm $1 | grep -q __asan_
ASAN_ENABLED=$?
restore_exit_on_error
if [ "$ASAN_ENABLED" == "0" ]; then
msg "$UNITTEST_NAME: SKIP: ASAN enabled"
exit 0
fi
}
#
# require_cxx11 -- continue script execution only if C++11 supporting compiler
# is installed
#
function require_cxx11() {
[ "$CXX" ] || CXX=c++
CXX11_AVAILABLE=`echo "int main(){return 0;}" |\
$CXX -std=c++11 -x c++ -o /dev/null - 2>/dev/null &&\
echo y || echo n`
if [ "$CXX11_AVAILABLE" == "n" ]; then
msg "$UNITTEST_NAME: SKIP: C++11 required"
exit 0
fi
}
#
# require_no_asan - continue script execution only if libpmem does NOT require
# libasan
#
function require_no_asan() {
case "$BUILD"
in
debug)
require_no_asan_for ../../debug/libpmem.so
;;
nondebug)
require_no_asan_for ../../nondebug/libpmem.so
;;
static-debug)
require_no_asan_for ../../debug/libpmem.a
;;
static-nondebug)
require_no_asan_for ../../nondebug/libpmem.a
;;
esac
}
#
# require_tty - continue script execution only if standard output is a terminal
#
function require_tty() {
if ! tty >/dev/null; then
msg "$UNITTEST_NAME: SKIP no terminal"
exit 0
fi
}
#
# require_binary -- continue script execution only if the binary has been compiled
#
# In case of conditional compilation, skip this test.
#
function require_binary() {
if [ -z "$1" ]; then
fatal "require_binary: error: binary not provided"
fi
if [ ! -x "$1" ]; then
msg "$UNITTEST_NAME: SKIP no binary found"
exit 0
fi
return
}
#
# require_preload - continue script execution only if supplied
# executable does not generate SIGABRT
#
# Used to check that LD_PRELOAD of, e.g., libvmmalloc is possible
#
# usage: require_preload <errorstr> <executable> [<exec_args>]
#
function require_preload() {
msg=$1
shift
trap SIGABRT
disable_exit_on_error
ret=$(LD_LIBRARY_PATH=$TEST_LD_LIBRARY_PATH LD_PRELOAD=$TEST_LD_PRELOAD $* 2>&1 /dev/null)
ret=$?
restore_exit_on_error
if [ $ret == 134 ]; then
msg "$UNITTEST_NAME: SKIP: $msg not supported"
rm -f $1.core
exit 0
fi
}
#
# require_sds -- continue script execution only if binary is compiled with
# shutdown state support
#
# usage: require_sds <binary>
#
function require_sds() {
local binary=$1
local dir=.
if [ -z "$binary" ]; then
fatal "require_sds: error: no binary found"
fi
strings ${binary} 2>&1 | \
grep -q "compiled with support for shutdown state" && true
if [ $? -ne 0 ]; then
msg "$UNITTEST_NAME: SKIP not compiled with support for shutdown state"
exit 0
fi
return 0
}
#
# require_no_sds -- continue script execution only if binary is NOT compiled with
# shutdown state support
#
# usage: require_no_sds <binary>
#
function require_no_sds() {
local binary=$1
local dir=.
if [ -z "$binary" ]; then
fatal "require_sds: error: no binary found"
fi
set +e
found=$(strings ${binary} 2>&1 | \
grep -c "compiled with support for shutdown state")
set -e
if [ "$found" -ne "0" ]; then
msg "$UNITTEST_NAME: SKIP compiled with support for shutdown state"
exit 0
fi
return 0
}
#
# check_absolute_path -- continue script execution only if $DIR path is
# an absolute path; do not resolve symlinks
#
function check_absolute_path() {
if [ "${DIR:0:1}" != "/" ]; then
fatal "Directory \$DIR has to be an absolute path. $DIR was given."
fi
}
#
# run_command -- run a command in a verbose or quiet way
#
function run_command()
{
local COMMAND="$*"
if [ "$VERBOSE" != "0" ]; then
echo "$ $COMMAND"
$COMMAND
else
$COMMAND
fi
}
#
# validate_node_number -- validate a node number
#
function validate_node_number() {
[ $1 -gt $NODES_MAX ] \
&& fatal "error: node number ($1) greater than maximum allowed node number ($NODES_MAX)"
return 0
}
#
# clean_remote_node -- usage: clean_remote_node <node> <list-of-pid-files>
#
function clean_remote_node() {
validate_node_number $1
local N=$1
shift
local DIR=${NODE_WORKING_DIR[$N]}/$curtestdir
# register the list of PID files to be cleaned in case of an error
NODE_PID_FILES[$N]="${NODE_PID_FILES[$N]} $*"
# clean the remote node
disable_exit_on_error
for pidfile in ${NODE_PID_FILES[$N]}; do
require_ctrld_err $N $pidfile
run_command ssh $SSH_OPTS ${NODE[$N]} "\
cd $DIR && [ -f $pidfile ] && \
../ctrld $pidfile kill SIGINT && \
../ctrld $pidfile wait 1 ; \
rm -f $pidfile"
done;
restore_exit_on_error
return 0
}
#
# clean_all_remote_nodes -- clean all remote nodes in case of an error
#
function clean_all_remote_nodes() {
msg "$UNITTEST_NAME: CLEAN (cleaning processes on remote nodes)"
local N=0
disable_exit_on_error
for N in $NODES_SEQ; do
local DIR=${NODE_WORKING_DIR[$N]}/$curtestdir
for pidfile in ${NODE_PID_FILES[$N]}; do
run_command ssh $SSH_OPTS ${NODE[$N]} "\
cd $DIR && [ -f $pidfile ] && \
../ctrld $pidfile kill SIGINT && \
../ctrld $pidfile wait 1 ; \
rm -f $pidfile"
done
done
restore_exit_on_error
return 0
}
#
# export_vars_node -- export specified variables on specified node
#
function export_vars_node() {
local N=$1
shift
validate_node_number $N
for var in "$@"; do
NODE_ENV[$N]="${NODE_ENV[$N]} $var=${!var}"
done
}
#
# require_nodes_libfabric -- only allow script to continue if libfabric with
# optionally specified provider is available on
# specified node
# usage: require_nodes_libfabric <node> <provider> [<libfabric-version>]
#
function require_node_libfabric() {
validate_node_number $1
local N=$1
local provider=$2
# Minimal required version of libfabric.
# Keep in sync with requirements in src/common.inc.
local version=${3:-1.4.2}
require_pkg libfabric "$version"
require_node_pkg $N libfabric "$version"
if [ "$RPMEM_DISABLE_LIBIBVERBS" != "y" ]; then
if ! fi_info --list | grep -q verbs; then
msg "$UNITTEST_NAME: SKIP libfabric not compiled with verbs provider"
exit 0
fi
if ! run_on_node $N "fi_info --list | grep -q verbs"; then
msg "$UNITTEST_NAME: SKIP libfabric on node $N not compiled with verbs provider"
exit 0
fi
fi
local DIR=${NODE_WORKING_DIR[$N]}/$curtestdir
local COMMAND="$COMMAND ${NODE_ENV[$N]}"
COMMAND="$COMMAND LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$REMOTE_LD_LIBRARY_PATH:${NODE_LD_LIBRARY_PATH[$N]}"
COMMAND="$COMMAND ../fip ${NODE_ADDR[$N]} $provider"
disable_exit_on_error
fip_out=$(ssh $SSH_OPTS ${NODE[$N]} "cd $DIR && $COMMAND" 2>&1)
ret=$?
restore_exit_on_error
if [ "$ret" == "0" ]; then
return
elif [ "$ret" == "1" ]; then
msg "$UNITTEST_NAME: SKIP NODE $N: $fip_out"
exit 0
else
fatal "NODE $N: require_libfabric $provider: $fip_out"
fi
}
#
# check_if_node_is_reachable -- check if the $1 node is reachable
#
function check_if_node_is_reachable() {
disable_exit_on_error
run_command ssh $SSH_OPTS ${NODE[$1]} exit
local ret=$?
restore_exit_on_error
return $ret
}
#
# require_nodes -- only allow script to continue for a certain number
# of defined and reachable nodes
#
# Input arguments:
# NODE[] - (required) array of nodes' addresses
# NODE_WORKING_DIR[] - (required) array of nodes' working directories
#
function require_nodes() {
local N_NODES=${#NODE[@]}
local N=$1
[ -z "$N" ] \
&& fatal "require_nodes: missing reguired parameter: number of nodes"
# if it has already been called, check if number of required nodes is bigger than previously
[ -n "$NODES_MAX" ] \
&& [ $(($N - 1)) -le $NODES_MAX ] && return
[ $N -gt $N_NODES ] \
&& msg "$UNITTEST_NAME: SKIP: requires $N node(s), but $N_NODES node(s) provided" \
&& exit 0
NODES_MAX=$(($N - 1))
NODES_SEQ=$(seq -s' ' 0 $NODES_MAX)
# check if all required nodes are reachable
for N in $NODES_SEQ; do
# validate node's address
[ "${NODE[$N]}" = "" ] \
&& msg "$UNITTEST_NAME: SKIP: address of node #$N is not provided" \
&& exit 0
# validate the working directory
[ "${NODE_WORKING_DIR[$N]}" = "" ] \
&& fatal "error: working directory for node #$N (${NODE[$N]}) is not provided"
# check if the node is reachable
check_if_node_is_reachable $N
[ $? -ne 0 ] \
&& fatal "error: node #$N (${NODE[$N]}) is unreachable"
# clear the list of PID files for each node
NODE_PID_FILES[$N]=""
NODE_TEST_DIR[$N]=${NODE_WORKING_DIR[$N]}/$curtestdir
NODE_DIR[$N]=${NODE_WORKING_DIR[$N]}/$curtestdir/data/
require_node_log_files $N $ERR_LOG_FILE $OUT_LOG_FILE $TRACE_LOG_FILE
if [ "$CHECK_TYPE" != "none" -a "${NODE_VALGRINDEXE[$N]}" = "" ]; then
disable_exit_on_error
NODE_VALGRINDEXE[$N]=$(ssh $SSH_OPTS ${NODE[$N]} "which valgrind 2>/dev/null")
local ret=$?
restore_exit_on_error
if [ $ret -ne 0 ]; then
msg "$UNITTEST_NAME: SKIP valgrind required on remote node #$N"
exit 0
fi
fi
done
# remove all log files of the current unit test from the required nodes
# and export the 'log' variables to these nodes
for N in $NODES_SEQ; do
for f in $(get_files "node_${N}.*${UNITTEST_NUM}\.log"); do
rm -f $f
done
export_vars_node $N $REMOTE_VARS
done
# register function to clean all remote nodes in case of an error or SIGINT
trap clean_all_remote_nodes ERR SIGINT
return 0
}
#
# check_files_on_node -- check if specified files exist on given node
#
function check_files_on_node() {
validate_node_number $1
local N=$1
shift
local REMOTE_DIR=${NODE_DIR[$N]}
run_command ssh $SSH_OPTS ${NODE[$N]} "for f in $*; do if [ ! -f $REMOTE_DIR/\$f ]; then echo \"Missing file \$f on node #$N\" 1>&2; exit 1; fi; done"
}
#
# check_no_files_on_node -- check if specified files does not exist on given node
#
function check_no_files_on_node() {
validate_node_number $1
local N=$1
shift
local REMOTE_DIR=${NODE_DIR[$N]}
run_command ssh $SSH_OPTS ${NODE[$N]} "for f in $*; do if [ -f $REMOTE_DIR/\$f ]; then echo \"Not deleted file \$f on node #$N\" 1>&2; exit 1; fi; done"
}
#
# copy_files_to_node -- copy all required files to the given remote node
# usage: copy_files_to_node <node> <destination dir> <file_1> [<file_2>] ...
#
function copy_files_to_node() {
validate_node_number $1
local N=$1
local DEST_DIR=$2
shift 2
[ $# -eq 0 ] &&\
fatal "error: copy_files_to_node(): no files provided"
# copy all required files
run_command scp $SCP_OPTS $@ ${NODE[$N]}:$DEST_DIR > /dev/null
return 0
}
#
# copy_files_from_node -- copy all required files from the given remote node
# usage: copy_files_from_node <node> <destination_dir> <file_1> [<file_2>] ...
#
function copy_files_from_node() {
validate_node_number $1
local N=$1
local DEST_DIR=$2
[ ! -d $DEST_DIR ] &&\
fatal "error: destination directory $DEST_DIR does not exist"
shift 2
[ $# -eq 0 ] &&\
fatal "error: copy_files_from_node(): no files provided"
# compress required files, copy and extract
local temp_file=node_${N}_temp_file.tar
files=""
dir_name=""
files=$(basename -a $@)
dir_name=$(dirname $1)
run_command ssh $SSH_OPTS ${NODE[$N]} "cd $dir_name && tar -czf $temp_file $files"
run_command scp $SCP_OPTS ${NODE[$N]}:$dir_name/$temp_file $DEST_DIR > /dev/null
cd $DEST_DIR \
&& tar -xzf $temp_file \
&& rm $temp_file \
&& cd - > /dev/null
return 0
}
#
# copy_log_files -- copy log files from remote node
#
function copy_log_files() {
local NODE_SCP_LOG_FILES[0]=""
for N in $NODES_SEQ; do
local DIR=${NODE_WORKING_DIR[$N]}/$curtestdir
for file in ${NODE_LOG_FILES[$N]}; do
NODE_SCP_LOG_FILES[$N]="${NODE_SCP_LOG_FILES[$N]} ${NODE[$N]}:$DIR/${file}"
done
[ "${NODE_SCP_LOG_FILES[$N]}" ] && run_command scp $SCP_OPTS ${NODE_SCP_LOG_FILES[$N]} . &>> $PREP_LOG_FILE
for file in ${NODE_LOG_FILES[$N]}; do
[ -f $file ] && mv $file node_${N}_${file}
done
done
}
#
# rm_files_from_node -- removes all listed files from the given remote node
# usage: rm_files_from_node <node> <file_1> [<file_2>] ...
#
function rm_files_from_node() {
validate_node_number $1
local N=$1
shift
[ $# -eq 0 ] &&\
fatal "error: rm_files_from_node(): no files provided"
run_command ssh $SSH_OPTS ${NODE[$N]} "rm -f $@"
return 0
}
#
#
# require_node_log_files -- store log files which must be copied from
# specified node on failure
#
function require_node_log_files() {
validate_node_number $1
local N=$1
shift
NODE_LOG_FILES[$N]="${NODE_LOG_FILES[$N]} $*"
}
#
# require_ctrld_err -- store ctrld's log files to copy from specified
# node on failure
#
function require_ctrld_err() {
local N=$1
local PID_FILE=$2
local DIR=${NODE_WORKING_DIR[$N]}/$curtestdir
for cmd in run wait kill wait_port; do
NODE_LOG_FILES[$N]="${NODE_LOG_FILES[$N]} $PID_FILE.$cmd.ctrld.log"
done
}
#
# run_on_node -- usage: run_on_node <node> <command>
#
# Run the <command> in background on the remote <node>.
# LD_LIBRARY_PATH for the n-th remote node can be provided
# in the array NODE_LD_LIBRARY_PATH[n]
#
function run_on_node() {
validate_node_number $1
local N=$1
shift
local DIR=${NODE_WORKING_DIR[$N]}/$curtestdir
local COMMAND="UNITTEST_NUM=$UNITTEST_NUM UNITTEST_NAME=$UNITTEST_NAME"
COMMAND="$COMMAND UNITTEST_LOG_LEVEL=1"
COMMAND="$COMMAND ${NODE_ENV[$N]}"
COMMAND="$COMMAND LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$REMOTE_LD_LIBRARY_PATH:${NODE_LD_LIBRARY_PATH[$N]} $*"
run_command ssh $SSH_OPTS ${NODE[$N]} "cd $DIR && $COMMAND"
ret=$?
if [ "$ret" -ne "0" ]; then
copy_log_files
fi
return $ret
}
#
# run_on_node_background -- usage:
# run_on_node_background <node> <pid-file> <command>
#
# Run the <command> in background on the remote <node>
# and create a <pid-file> for this process.
# LD_LIBRARY_PATH for the n-th remote node
# can be provided in the array NODE_LD_LIBRARY_PATH[n]
#
function run_on_node_background() {
validate_node_number $1
local N=$1
local PID_FILE=$2
shift
shift
local DIR=${NODE_WORKING_DIR[$N]}/$curtestdir
local COMMAND="UNITTEST_NUM=$UNITTEST_NUM UNITTEST_NAME=$UNITTEST_NAME"
COMMAND="$COMMAND UNITTEST_LOG_LEVEL=1"
COMMAND="$COMMAND ${NODE_ENV[$N]}"
COMMAND="$COMMAND LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$REMOTE_LD_LIBRARY_PATH:${NODE_LD_LIBRARY_PATH[$N]}"
COMMAND="$COMMAND ../ctrld $PID_FILE run $RUNTEST_TIMEOUT $*"
# register the PID file to be cleaned in case of an error
NODE_PID_FILES[$N]="${NODE_PID_FILES[$N]} $PID_FILE"
run_command ssh $SSH_OPTS ${NODE[$N]} "cd $DIR && $COMMAND"
ret=$?
if [ "$ret" -ne "0" ]; then
copy_log_files
fi
return $ret
}
#
# wait_on_node -- usage: wait_on_node <node> <pid-file> [<timeout>]
#
# Wait until the process with the <pid-file> on the <node>
# exits or <timeout> expires.
#
function wait_on_node() {
validate_node_number $1
local N=$1
local PID_FILE=$2
local TIMEOUT=$3
local DIR=${NODE_WORKING_DIR[$N]}/$curtestdir
run_command ssh $SSH_OPTS ${NODE[$N]} "cd $DIR && ../ctrld $PID_FILE wait $TIMEOUT"
ret=$?
if [ "$ret" -ne "0" ]; then
copy_log_files
fi
return $ret
}
#
# wait_on_node_port -- usage: wait_on_node_port <node> <pid-file> <portno>
#
# Wait until the process with the <pid-file> on the <node>
# opens the port <portno>.
#
function wait_on_node_port() {
validate_node_number $1
local N=$1
local PID_FILE=$2
local PORTNO=$3
local DIR=${NODE_WORKING_DIR[$N]}/$curtestdir
run_command ssh $SSH_OPTS ${NODE[$N]} "cd $DIR && ../ctrld $PID_FILE wait_port $PORTNO"
ret=$?
if [ "$ret" -ne "0" ]; then
copy_log_files
fi
return $ret
}
#
# kill_on_node -- usage: kill_on_node <node> <pid-file> <signo>
#
# Send the <signo> signal to the process with the <pid-file>
# on the <node>.
#
function kill_on_node() {
validate_node_number $1
local N=$1
local PID_FILE=$2
local SIGNO=$3
local DIR=${NODE_WORKING_DIR[$N]}/$curtestdir
run_command ssh $SSH_OPTS ${NODE[$N]} "cd $DIR && ../ctrld $PID_FILE kill $SIGNO"
ret=$?
if [ "$ret" -ne "0" ]; then
copy_log_files
fi
return $ret
}
#
# create_holey_file_on_node -- create holey files of a given length
# usage: create_holey_file_on_node <node> <size>
#
# example, to create two files, each 1GB in size on node 0:
# create_holey_file_on_node 0 1G testfile1 testfile2
#
# Input unit size is in bytes with optional suffixes like k, KB, M, etc.
#
function create_holey_file_on_node() {
validate_node_number $1
local N=$1
size=$(convert_to_bytes $2)
shift 2
for file in $*
do
run_on_node $N truncate -s ${size} $file >> $PREP_LOG_FILE
done
}
#
# setup -- print message that test setup is commencing
#
function setup() {
DIR=$DIR$SUFFIX
export VMMALLOC_POOL_DIR="$DIR"
# writes test working directory to temporary file
# that allows read location of data after test failure
if [ -f "$TEMP_LOC" ]; then
echo "$DIR" > $TEMP_LOC
fi
# test type must be explicitly specified
if [ "$req_test_type" != "1" ]; then
fatal "error: required test type is not specified"
fi
# fs type "none" must be explicitly enabled
if [ "$FS" = "none" -a "$req_fs_type" != "1" ]; then
exit 0
fi
# fs type "any" must be explicitly enabled
if [ "$FS" = "any" -a "$req_fs_type" != "1" ]; then
exit 0
fi
if [ "$CHECK_TYPE" != "none" ]; then
require_valgrind
export VALGRIND_LOG_FILE=$CHECK_TYPE${UNITTEST_NUM}.log
MCSTR="/$CHECK_TYPE"
else
MCSTR=""
fi
[ -n "$RPMEM_PROVIDER" ] && PROV="/$RPMEM_PROVIDER"
[ -n "$RPMEM_PM" ] && PM="/$RPMEM_PM"
msg "$UNITTEST_NAME: SETUP ($TEST/$REAL_FS/$BUILD$MCSTR$PROV$PM)"
for f in $(get_files ".*[a-zA-Z_]${UNITTEST_NUM}\.log"); do
rm -f $f
done
# $DIR has to be an absolute path
check_absolute_path
if [ "$FS" != "none" ]; then
if [ -d "$DIR" ]; then
rm $RM_ONEFS -rf -- $DIR
fi
mkdir -p $DIR
fi
if [ "$TM" = "1" ]; then
start_time=$($DATE +%s.%N)
fi
if [ "$DEVDAX_TO_LOCK" == 1 ]; then
lock_devdax
fi
}
#
# check_log_empty -- if match file does not exist, assume log should be empty
#
function check_log_empty() {
if [ ! -f ${1}.match ] && [ $(get_size $1) -ne 0 ]; then
echo "unexpected output in $1"
dump_last_n_lines $1
exit 1
fi
}
#
# check_local -- check local test results (using .match files)
#
function check_local() {
if [ "$UT_SKIP_PRINT_MISMATCHED" == 1 ]; then
option=-q
fi
check_log_empty $ERR_LOG_FILE
FILES=$(get_files "[^0-9w]*${UNITTEST_NUM}\.log\.match")
if [ -n "$FILES" ]; then
../match $option $FILES
fi
}
#
# match -- execute match
#
function match() {
../match $@
}
#
# check -- check local or remote test results (using .match files)
#
function check() {
if [ $NODES_MAX -lt 0 ]; then
check_local
else
FILES=$(get_files "node_[0-9]+_[^0-9w]*${UNITTEST_NUM}\.log\.match")
local NODE_MATCH_FILES[0]=""
local NODE_SCP_MATCH_FILES[0]=""
for file in $FILES; do
local N=`echo $file | cut -d"_" -f2`
local DIR=${NODE_WORKING_DIR[$N]}/$curtestdir
local FILE=`echo $file | cut -d"_" -f3 | sed "s/\.match$//g"`
validate_node_number $N
NODE_MATCH_FILES[$N]="${NODE_MATCH_FILES[$N]} $FILE"
NODE_SCP_MATCH_FILES[$N]="${NODE_SCP_MATCH_FILES[$N]} ${NODE[$N]}:$DIR/$FILE"
done
for N in $NODES_SEQ; do
[ "${NODE_SCP_MATCH_FILES[$N]}" ] && run_command scp $SCP_OPTS ${NODE_SCP_MATCH_FILES[$N]} . > /dev/null
for file in ${NODE_MATCH_FILES[$N]}; do
mv $file node_${N}_${file}
done
done
if [ "$UT_SKIP_PRINT_MISMATCHED" == 1 ]; then
option=-q
fi
for N in $NODES_SEQ; do
check_log_empty node_${N}_${ERR_LOG_FILE}
done
if [ -n "$FILES" ]; then
match $option $FILES
fi
fi
}
#
# pass -- print message that the test has passed
#
function pass() {
if [ "$DEVDAX_TO_LOCK" == 1 ]; then
unlock_devdax
fi
if [ "$TM" = "1" ]; then
end_time=$($DATE +%s.%N)
start_time_sec=$($DATE -d "0 $start_time sec" +%s)
end_time_sec=$($DATE -d "0 $end_time sec" +%s)
days=$(((end_time_sec - start_time_sec) / (24*3600)))
days=$(printf "%03d" $days)
tm=$($DATE -d "0 $end_time sec - $start_time sec" +%H:%M:%S.%N)
tm=$(echo "$days:$tm" | sed -e "s/^000://g" -e "s/^00://g" -e "s/^00://g" -e "s/\([0-9]*\)\.\([0-9][0-9][0-9]\).*/\1.\2/")
tm="\t\t\t[$tm s]"
else
tm=""
fi
msg="PASS"
[ -t 1 ] && command -v tput >/dev/null && msg="$(tput setaf 2)$msg$(tput sgr0)"
if [ "$UNITTEST_LOG_LEVEL" -ge 1 ]; then
echo -e "$UNITTEST_NAME: $msg$tm"
fi
if [ "$FS" != "none" ]; then
rm $RM_ONEFS -rf -- $DIR
fi
}
# Length of pool file's signature
SIG_LEN=8
# Offset and length of pmemobj layout
LAYOUT_OFFSET=4096
LAYOUT_LEN=1024
# Length of arena's signature
ARENA_SIG_LEN=16
# Signature of BTT Arena
ARENA_SIG="BTT_ARENA_INFO"
# Offset to first arena
ARENA_OFF=8192
#
# check_file -- check if file exists and print error message if not
#
check_file()
{
if [ ! -f $1 ]
then
fatal "Missing file: ${1}"
fi
}
#
# check_files -- check if files exist and print error message if not
#
check_files()
{
for file in $*
do
check_file $file
done
}
#
# check_no_file -- check if file has been deleted and print error message if not
#
check_no_file()
{
if [ -f $1 ]
then
fatal "Not deleted file: ${1}"
fi
}
#
# check_no_files -- check if files has been deleted and print error message if not
#
check_no_files()
{
for file in $*
do
check_no_file $file
done
}
#
# get_size -- return size of file (0 if file does not exist)
#
get_size()
{
if [ ! -f $1 ]; then
echo "0"
else
stat $STAT_SIZE $1
fi
}
#
# get_mode -- return mode of file
#
get_mode()
{
stat $STAT_MODE $1
}
#
# check_size -- validate file size
#
check_size()
{
local size=$1
local file=$2
local file_size=$(get_size $file)
if [[ $size != $file_size ]]
then
fatal "error: wrong size ${file_size} != ${size}"
fi
}
#
# check_mode -- validate file mode
#
check_mode()
{
local mode=$1
local file=$2
local file_mode=$(get_mode $file)
if [[ $mode != $file_mode ]]
then
fatal "error: wrong mode ${file_mode} != ${mode}"
fi
}
#
# check_signature -- check if file contains specified signature
#
check_signature()
{
local sig=$1
local file=$2
local file_sig=$($DD if=$file bs=1 count=$SIG_LEN 2>/dev/null | tr -d \\0)
if [[ $sig != $file_sig ]]
then
fatal "error: $file: signature doesn't match ${file_sig} != ${sig}"
fi
}
#
# check_signatures -- check if multiple files contain specified signature
#
check_signatures()
{
local sig=$1
shift 1
for file in $*
do
check_signature $sig $file
done
}
#
# check_layout -- check if pmemobj pool contains specified layout
#
check_layout()
{
local layout=$1
local file=$2
local file_layout=$($DD if=$file bs=1\
skip=$LAYOUT_OFFSET count=$LAYOUT_LEN 2>/dev/null | tr -d \\0)
if [[ $layout != $file_layout ]]
then
fatal "error: layout doesn't match ${file_layout} != ${layout}"
fi
}
#
# check_arena -- check if file contains specified arena signature
#
check_arena()
{
local file=$1
local sig=$($DD if=$file bs=1 skip=$ARENA_OFF count=$ARENA_SIG_LEN 2>/dev/null | tr -d \\0)
if [[ $sig != $ARENA_SIG ]]
then
fatal "error: can't find arena signature"
fi
}
#
# dump_pool_info -- dump selected pool metadata and/or user data
#
function dump_pool_info() {
# ignore selected header fields that differ by definition
${PMEMPOOL}.static-nondebug info $* | sed -e "/^UUID/,/^Checksum/d"
}
#
# compare_replicas -- check replicas consistency by comparing `pmempool info` output
#
function compare_replicas() {
disable_exit_on_error
diff <(dump_pool_info $1 $2) <(dump_pool_info $1 $3) -I "^path" -I "^size"
restore_exit_on_error
}
#
# get_node_dir -- returns node dir for current test
# usage: get_node_dir <node>
#
function get_node_dir() {
validate_node_number $1
echo ${NODE_WORKING_DIR[$1]}/$curtestdir
}
#
# init_rpmem_on_node -- prepare rpmem environment variables on node
# usage: init_rpmem_on_node <master-node> <slave-node-1> [<slave-node-2> ...]
#
# example:
# The following command initialize rpmem environment variables on the node 1
# to perform replication to node 0, node 2 and node 3.
# Additionally:
# - on node 2 rpmemd pid will be stored in file.pid
# - on node 3 no pid file will be created (SKIP) and rpmemd will use
# file.conf config file
#
# init_rpmem_on_node 1 0 2:file.pid 3:SKIP:file.conf
#
function init_rpmem_on_node() {
local master=$1
shift
validate_node_number $master
case "$RPMEM_PM" in
APM|GPSPM)
;;
*)
msg "$UNITTEST_NAME: SKIP required: RPMEM_PM is invalid or empty"
exit 0
;;
esac
# Workaround for SIGSEGV in the infinipath-psm during abort
# The infinipath-psm is registering a signal handler and do not unregister
# it when rpmem handle is dlclosed. SIGABRT (potentially any other signal)
# would try to call the signal handler which does not exist after dlclose.
# Issue require a fix in the infinipath-psm or the libfabric.
IPATH_NO_BACKTRACE=1
export_vars_node $master IPATH_NO_BACKTRACE
RPMEM_CMD=""
local SEPARATOR="|"
for slave in "$@"
do
slave=(${slave//:/ })
conf=${slave[2]}
pid=${slave[1]}
slave=${slave[0]}
validate_node_number $slave
local poolset_dir=${NODE_DIR[$slave]}
if [ -n "${RPMEM_POOLSET_DIR[$slave]}" ]; then
poolset_dir=${RPMEM_POOLSET_DIR[$slave]}
fi
local trace=
if [ -n "$(is_valgrind_enabled_on_node $slave)" ]; then
log_file=${CHECK_TYPE}${UNITTEST_NUM}.log
trace=$(get_trace $CHECK_TYPE $log_file $slave)
fi
if [ -n "$pid" -a "$pid" != "SKIP" ]; then
trace="$trace ../ctrld $pid exe"
fi
if [ -n ${UNITTEST_DO_NOT_CHECK_OPEN_FILES+x} ]; then
export_vars_node $slave UNITTEST_DO_NOT_CHECK_OPEN_FILES
fi
if [ -n ${IPATH_NO_BACKTRACE+x} ]; then
export_vars_node $slave IPATH_NO_BACKTRACE
fi
CMD="cd ${NODE_TEST_DIR[$slave]} && "
# Force pmem for APM. Otherwise in case of lack of a pmem rpmemd will
# silently fallback to GPSPM.
[ "$RPMEM_PM" == "APM" ] && CMD="$CMD PMEM_IS_PMEM_FORCE=1"
CMD="$CMD ${NODE_ENV[$slave]}"
CMD="$CMD LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$REMOTE_LD_LIBRARY_PATH:${NODE_LD_LIBRARY_PATH[$slave]}"
CMD="$CMD $trace ../rpmemd"
CMD="$CMD --log-file=$RPMEMD_LOG_FILE"
CMD="$CMD --log-level=$RPMEMD_LOG_LEVEL"
CMD="$CMD --poolset-dir=$poolset_dir"
if [ -n "$conf" ]; then
CMD="$CMD --config=$conf"
fi
if [ "$RPMEM_PM" == "APM" ]; then
CMD="$CMD --persist-apm"
fi
if [ "$RPMEM_CMD" ]; then
RPMEM_CMD="$RPMEM_CMD$SEPARATOR$CMD"
else
RPMEM_CMD=$CMD
fi
require_node_log_files $slave rpmemd$UNITTEST_NUM.log
done
RPMEM_CMD="\"$RPMEM_CMD\""
RPMEM_ENABLE_SOCKETS=0
RPMEM_ENABLE_VERBS=0
case "$RPMEM_PROVIDER" in
sockets)
RPMEM_ENABLE_SOCKETS=1
;;
verbs)
RPMEM_ENABLE_VERBS=1
;;
*)
msg "$UNITTEST_NAME: SKIP required: RPMEM_PROVIDER is invalid or empty"
exit 0
;;
esac
export_vars_node $master RPMEM_CMD
export_vars_node $master RPMEM_ENABLE_SOCKETS
export_vars_node $master RPMEM_ENABLE_VERBS
if [ -n ${UNITTEST_DO_NOT_CHECK_OPEN_FILES+x} ]; then
export_vars_node $master UNITTEST_DO_NOT_CHECK_OPEN_FILES
fi
if [ -n ${PMEMOBJ_NLANES+x} ]; then
export_vars_node $master PMEMOBJ_NLANES
fi
if [ -n ${RPMEM_MAX_NLANES+x} ]; then
export_vars_node $master RPMEM_MAX_NLANES
fi
require_node_log_files $master rpmem$UNITTEST_NUM.log
require_node_log_files $master $PMEMOBJ_LOG_FILE
}
#
# init_valgrind_on_node -- prepare valgrind on nodes
# usage: init_valgrind_on_node <node list>
#
function init_valgrind_on_node() {
# When librpmem is preloaded libfabric does not close all opened files
# before list of opened files is checked.
local UNITTEST_DO_NOT_CHECK_OPEN_FILES=1
local LD_PRELOAD=../$BUILD/librpmem.so
CHECK_NODES=""
for node in "$@"
do
validate_node_number $node
export_vars_node $node LD_PRELOAD
export_vars_node $node UNITTEST_DO_NOT_CHECK_OPEN_FILES
CHECK_NODES="$CHECK_NODES $node"
done
}
#
# is_valgrind_enabled_on_node -- echo the node number if the node has
# initialized valgrind environment by calling
# init_valgrind_on_node
# usage: is_valgrind_enabled_on_node <node>
#
function is_valgrind_enabled_on_node() {
for node in $CHECK_NODES
do
if [ "$node" -eq "$1" ]; then
echo $1
return
fi
done
return
}
#
# pack_all_libs -- put all libraries and their links to one tarball
#
function pack_all_libs() {
local LIBS_TAR_DIR=$(pwd)/$1
cd $DIR_SRC
tar -cf $LIBS_TAR_DIR ./debug/*.so* ./nondebug/*.so*
cd - > /dev/null
}
#
# copy_common_to_remote_nodes -- copy common files to all remote nodes
#
function copy_common_to_remote_nodes() {
local NODES_ALL_MAX=$((${#NODE[@]} - 1))
local NODES_ALL_SEQ=$(seq -s' ' 0 $NODES_ALL_MAX)
DIR_SYNC=$1
if [ "$DIR_SYNC" != "" ]; then
[ ! -d $DIR_SYNC ] \
&& fatal "error: $DIR_SYNC does not exist or is not a directory"
fi
# add all libraries to the 'to-copy' list
local LIBS_TAR=libs.tar
pack_all_libs $LIBS_TAR
if [ "$DIR_SYNC" != "" -a "$(ls $DIR_SYNC)" != "" ]; then
FILES_COMMON_DIR="$DIR_SYNC/* $LIBS_TAR"
else
FILES_COMMON_DIR="$FILES_COMMON_DIR $LIBS_TAR"
fi
for N in $NODES_ALL_SEQ; do
# validate node's address
[ "${NODE[$N]}" = "" ] \
&& fatal "error: address of node #$N is not provided"
check_if_node_is_reachable $N
[ $? -ne 0 ] \
&& msg "warning: node #$N (${NODE[$N]}) is unreachable, skipping..." \
&& continue
# validate the working directory
[ "${NODE_WORKING_DIR[$N]}" = "" ] \
&& msg ": warning: working directory for node #$N (${NODE[$N]}) is not provided, skipping..." \
&& continue
# create the working dir if it does not exist
run_command ssh $SSH_OPTS ${NODE[$N]} "mkdir -p ${NODE_WORKING_DIR[$N]}"
# copy all common files
run_command scp $SCP_OPTS $FILES_COMMON_DIR ${NODE[$N]}:${NODE_WORKING_DIR[$N]} > /dev/null
# unpack libraries
run_command ssh $SSH_OPTS ${NODE[$N]} "cd ${NODE_WORKING_DIR[$N]} \
&& tar -xf $LIBS_TAR && rm -f $LIBS_TAR"
done
rm -f $LIBS_TAR
}
#
# copy_test_to_remote_nodes -- copy all unit test binaries to all remote nodes
#
function copy_test_to_remote_nodes() {
local NODES_ALL_MAX=$((${#NODE[@]} - 1))
local NODES_ALL_SEQ=$(seq -s' ' 0 $NODES_ALL_MAX)
for N in $NODES_ALL_SEQ; do
# validate node's address
[ "${NODE[$N]}" = "" ] \
&& fatal "error: address of node #$N is not provided"
check_if_node_is_reachable $N
[ $? -ne 0 ] \
&& msg "warning: node #$N (${NODE[$N]}) is unreachable, skipping..." \
&& continue
# validate the working directory
[ "${NODE_WORKING_DIR[$N]}" = "" ] \
&& msg ": warning: working directory for node #$N (${NODE[$N]}) is not provided, skipping..." \
&& continue
local DIR=${NODE_WORKING_DIR[$N]}/$curtestdir
# create a new test dir
run_command ssh $SSH_OPTS ${NODE[$N]} "rm -rf $DIR && mkdir -p $DIR"
# create the working data dir
run_command ssh $SSH_OPTS ${NODE[$N]} "mkdir -p \
${DIR}/data"
# copy all required files
[ $# -gt 0 ] && run_command scp $SCP_OPTS $* ${NODE[$N]}:$DIR > /dev/null
done
return 0
}
#
# enable_log_append -- turn on appending to the log files rather than truncating them
# It also removes all log files created by tests: out*.log, err*.log and trace*.log
#
function enable_log_append() {
rm -f $OUT_LOG_FILE
rm -f $ERR_LOG_FILE
rm -f $TRACE_LOG_FILE
export UNITTEST_LOG_APPEND=1
}
# clean data directory on all remote
# nodes if remote test failed
if [ "$CLEAN_FAILED_REMOTE" == "y" ]; then
NODES_ALL=$((${#NODE[@]} - 1))
MYPID=$$
for ((i=0;i<=$NODES_ALL;i++));
do
if [[ -z "${NODE_WORKING_DIR[$i]}" || -z "$curtestdir" ]]; then
echo "Invalid path to tests data: ${NODE_WORKING_DIR[$i]}/$curtestdir/data/"
exit 1
fi
N[$i]=${NODE_WORKING_DIR[$i]}/$curtestdir/data/
run_command ssh $SSH_OPTS ${NODE[$i]} "rm -rf ${N[$i]}; mkdir ${N[$i]}"
if [ $? -eq 0 ]; then
verbose_msg "Removed data from: ${NODE[$i]}:${N[$i]}"
fi
done
exit 0
fi
# calculate the minimum of two or more numbers
minimum() {
local min=$1
shift
for val in $*; do
if [[ "$val" < "$min" ]]; then
min=$val
fi
done
echo $min
}
#
# count_lines - count number of lines that match pattern $1 in file $2
#
function count_lines() {
# grep returns 1 on no match
disable_exit_on_error
$GREP -ce "$1" $2
restore_exit_on_error
}
#
# get_pmemcheck_version() - return pmemcheck API major or minor version
# usage: get_pmemcheck_version <0|1>
#
function get_pmemcheck_version()
{
PMEMCHECK_VERSION=$($VALGRINDEXE --tool=pmemcheck true 2>&1 \
| head -n 1 | sed "s/.*-\([0-9.]*\),.*/\1/")
OIFS=$IFS
IFS="."
PMEMCHECK_MAJ_MIN=($PMEMCHECK_VERSION)
IFS=$OIFS
PMEMCHECK_VERSION_PART=${PMEMCHECK_MAJ_MIN[$1]}
echo "$PMEMCHECK_VERSION_PART"
}
#
# require_pmemcheck_version_ge - check if pmemcheck API
# version is greater or equal to required value
# usage: require_pmemcheck_version_ge <major> <minor>
#
function require_pmemcheck_version_ge()
{
require_valgrind_tool pmemcheck
REQUIRE_MAJOR=$1
REQUIRE_MINOR=$2
PMEMCHECK_MAJOR=$(get_pmemcheck_version 0)
PMEMCHECK_MINOR=$(get_pmemcheck_version 1)
# compare MAJOR
if [ $PMEMCHECK_MAJOR -gt $REQUIRE_MAJOR ]; then
return 0
fi
# compare MINOR
if [ $PMEMCHECK_MAJOR -eq $REQUIRE_MAJOR ]; then
if [ $PMEMCHECK_MINOR -ge $REQUIRE_MINOR ]; then
return 0
fi
fi
msg "$UNITTEST_NAME: SKIP pmemcheck API version:" \
"$PMEMCHECK_MAJOR.$PMEMCHECK_MINOR" \
"is less than required" \
"$REQUIRE_MAJOR.$REQUIRE_MINOR"
exit 0
}
#
# require_pmemcheck_version_lt - check if pmemcheck API
# version is less than required value
# usage: require_pmemcheck_version_lt <major> <minor>
#
function require_pmemcheck_version_lt()
{
require_valgrind_tool pmemcheck
REQUIRE_MAJOR=$1
REQUIRE_MINOR=$2
PMEMCHECK_MAJOR=$(get_pmemcheck_version 0)
PMEMCHECK_MINOR=$(get_pmemcheck_version 1)
# compare MAJOR
if [ $PMEMCHECK_MAJOR -lt $REQUIRE_MAJOR ]; then
return 0
fi
# compare MINOR
if [ $PMEMCHECK_MAJOR -eq $REQUIRE_MAJOR ]; then
if [ $PMEMCHECK_MINOR -lt $REQUIRE_MINOR ]; then
return 0
fi
fi
msg "$UNITTEST_NAME: SKIP pmemcheck API version:" \
"$PMEMCHECK_MAJOR.$PMEMCHECK_MINOR" \
"is greater or equal than" \
"$REQUIRE_MAJOR.$REQUIRE_MINOR"
exit 0
}
#
# require_python_3 -- check if python3 is available
#
function require_python3()
{
if hash python3 &>/dev/null;
then
PYTHON_EXE=python3
else
PYTHON_EXE=python
fi
case "$($PYTHON_EXE --version 2>&1)" in
*" 3."*)
return
;;
*)
msg "$UNITTEST_NAME: SKIP: required python version 3"
exit 0
;;
esac
}
#
# require_pmreorder -- check all necessarily conditions to run pmreorder
#
function require_pmreorder()
{
# python3 and valgrind are necessary
require_python3
# pmemcheck is required to generate store_log
configure_valgrind pmemcheck force-enable
# pmreorder tool does not support unicode yet
require_no_unicode
}
#
# pmreorder_run_tool -- run pmreorder with parameters and return exit status
#
# 1 - reorder engine type [nochecker|full|noreorder|partial|accumulative]
# 2 - marker-engine pairs in format: MARKER=ENGINE,MARKER1=ENGINE1 or
# config file in json format: { "MARKER":"ENGINE","MARKER1":"ENGINE1" }
# 3 - the path to the checker binary/library and remaining parameters which
# will be passed to the consistency checker binary.
# If you are using a library checker, prepend '-n funcname'
#
function pmreorder_run_tool()
{
rm -f pmreorder$UNITTEST_NUM.log
disable_exit_on_error
LD_LIBRARY_PATH=$TEST_LD_LIBRARY_PATH $PYTHON_EXE $PMREORDER \
-l store_log$UNITTEST_NUM.log \
-o pmreorder$UNITTEST_NUM.log \
-r $1 \
-x $2 \
-p "$3"
ret=$?
restore_exit_on_error
echo $ret
}
#
# pmreorder_expect_success -- run pmreoreder with forwarded parameters,
# expect it to exit zero
#
function pmreorder_expect_success()
{
ret=$(pmreorder_run_tool "$@")
if [ "$ret" -ne "0" ]; then
msg="failed with exit code $ret"
[ -t 2 ] && command -v tput >/dev/null && msg="$(tput setaf 1)$msg$(tput sgr0)"
# exit code 130 - script terminated by user (Control-C)
if [ "$ret" -ne "130" ]; then
echo -e "$UNITTEST_NAME $msg." >&2
dump_last_n_lines $PMREORDER_LOG_FILE
fi
false
fi
}
#
# pmreorder_expect_failure -- run pmreoreder with forwarded parameters,
# expect it to exit non zero
#
function pmreorder_expect_failure()
{
ret=$(pmreorder_run_tool "$@")
if [ "$ret" -eq "0" ]; then
msg="succeeded"
[ -t 2 ] && command -v tput >/dev/null && msg="$(tput setaf 1)$msg$(tput sgr0)"
echo -e "$UNITTEST_NAME command $msg unexpectedly." >&2
false
fi
}
#
# pmreorder_create_store_log -- perform a reordering test
#
# This function expects 5 additional parameters. They are in order:
# 1 - the pool file to be tested
# 2 - the application and necessary parameters to run pmemcheck logging
#
function pmreorder_create_store_log()
{
#copy original file and perform store logging
cp $1 "$1.pmr"
rm -f store_log$UNITTEST_NUM.log
LD_LIBRARY_PATH=$TEST_LD_LIBRARY_PATH $VALGRINDEXE \
--tool=pmemcheck -q \
--log-stores=yes \
--print-summary=no \
--log-file=store_log$UNITTEST_NUM.log \
--log-stores-stacktraces=yes \
--log-stores-stacktraces-depth=2 \
--expect-fence-after-clflush=yes \
$2
# uncomment this line for debug purposes
# mv $1 "$1.bak"
mv "$1.pmr" $1
}
#
# require_free_space -- check if there is enough free space to run the test
# Example, checking if there is 1 GB of free space on disk:
# require_free_space 1G
#
function require_free_space() {
req_free_space=$(convert_to_bytes $1)
output=$(df -k $DIR)
found=false
i=1
for elem in $(echo "$output" | head -1); do
if [ ${elem:0:5} == "Avail" ]; then
found=true
break
else
let "i+=1"
fi
done
if [ $found = true ]; then
row=$(echo "$output" | tail -1)
free_space=$(( $(echo $row | awk "{print \$$i}")*1024 ))
else
msg "$UNITTEST_NAME: SKIP: unable to check free space"
exit 0
fi
if [ $free_space -lt $req_free_space ]; then
msg "$UNITTEST_NAME: SKIP: not enough free space"
exit 0
fi
}
#
# require_nfit_tests_enabled - check if tests using the nfit_test kernel module are not enabled
#
function require_nfit_tests_enabled() {
if [ "$ENABLE_NFIT_TESTS" != "y" ]; then
msg "$UNITTEST_NAME: SKIP: tests using the nfit_test kernel module are not enabled in testconfig.sh"
exit 0
fi
}
#
# create_recovery_file - create bad block recovery file
#
# Usage: create_recovery_file <file> [<offset_1> <length_1> ...]
#
function create_recovery_file() {
[ $# -lt 1 ] && fatal "create_recovery_file(): not enough parameters: $*"
FILE=$1
shift
rm -f $FILE
while [ $# -ge 2 ]; do
OFFSET=$1
LENGTH=$2
shift 2
echo "$(($OFFSET * 512)) $(($LENGTH * 512))" >> $FILE
done
# write the finish flag
echo "0 0" >> $FILE
}
#
# zero_blocks - zero blocks in a file
#
# Usage: zero_blocks <file> <offset> <length>
#
function zero_blocks() {
[ $# -lt 3 ] && fatal "zero_blocks(): not enough parameters: $*"
FILE=$1
shift
while [ $# -ge 2 ]; do
OFFSET=$1
LENGTH=$2
shift 2
dd if=/dev/zero of=$FILE bs=512 seek=$OFFSET count=$LENGTH conv=notrunc status=none
done
}
#
# turn_on_checking_bad_blocks -- set the compat_feature POOL_FEAT_CHECK_BAD_BLOCKS on
#
function turn_on_checking_bad_blocks()
{
FILE=$1
expect_normal_exit "$PMEMPOOL feature -e CHECK_BAD_BLOCKS $FILE &>> $PREP_LOG_FILE"
}
#
# turn_on_checking_bad_blocks_node -- set the compat_feature POOL_FEAT_CHECK_BAD_BLOCKS on
#
function turn_on_checking_bad_blocks_node()
{
FILE=$2
expect_normal_exit run_on_node $1 "../pmempool feature -e CHECK_BAD_BLOCKS $FILE &>> $PREP_LOG_FILE"
}
| 88,034 | 24.031277 | 153 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/obj_memblock/mocks_windows.h
|
/*
* Copyright 2016, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* mocks_windows.h -- redefinitions of memops functions
*
* This file is Windows-specific.
*
* This file should be included (i.e. using Forced Include) by libpmemobj
* files, when compiled for the purpose of obj_memblock test.
* It would replace default implementation with mocked functions defined
* in obj_memblock.c.
*
* These defines could be also passed as preprocessor definitions.
*/
#ifndef WRAP_REAL
#define operation_add_typed_entry __wrap_operation_add_typed_entry
#define operation_add_entry __wrap_operation_add_entry
#endif
| 2,149 | 42 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/obj_sds/mocks_windows.h
|
/*
* Copyright 2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* mocks_windows.h -- redefinitions of dimm functions
*/
#ifndef WRAP_REAL
#define os_dimm_usc __wrap_os_dimm_usc
#define os_dimm_uid __wrap_os_dimm_uid
#endif
| 1,762 | 42 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/util_sds/mocks_windows.h
|
/*
* Copyright 2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* mocks_windows.h -- redefinitions of dimm functions
*/
#ifndef WRAP_REAL
#define os_dimm_usc __wrap_os_dimm_usc
#define os_dimm_uid __wrap_os_dimm_uid
#endif
| 1,762 | 42 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/obj_tx_add_range/config.sh
|
#!/usr/bin/env bash
#
# Copyright 2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# obj_tx_add_range/config.sh -- test configuration
#
# Extend timeout for this test, as it may take a few minutes
# when run on a non-pmem file system.
CONF_GLOBAL_TIMEOUT='10m'
| 1,767 | 41.095238 | 73 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/pmem_has_auto_flush_win/mocks_windows.h
|
/*
* Copyright 2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* mocks_windows.h -- redefinitions of EnumSystemFirmwareTables and
* GetSystemFirmwareTable
*
* This file is Windows-specific.
*
* This file should be included (i.e. using Forced Include) by libpmem
* files, when compiled for the purpose of pmem_has_auto_flush_win test.
* It would replace default implementation with mocked functions defined
* in mocks_windows.c
*
* This WRAP_REAL define could be also passed as preprocessor definition.
*/
#include <windows.h>
#ifndef WRAP_REAL
#define EnumSystemFirmwareTables __wrap_EnumSystemFirmwareTables
#define GetSystemFirmwareTable __wrap_GetSystemFirmwareTable
UINT
__wrap_EnumSystemFirmwareTables(DWORD FirmwareTableProviderSignature,
PVOID pFirmwareTableEnumBuffer, DWORD BufferSize);
UINT
__wrap_GetSystemFirmwareTable(DWORD FirmwareTableProviderSignature,
DWORD FirmwareTableID, PVOID pFirmwareTableBuffer, DWORD BufferSize);
#endif
| 2,503 | 42.172414 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/pmem_has_auto_flush_win/pmem_has_auto_flush_win.h
|
/*
* Copyright 2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* pmem_has_auto_flush_win.h -- header file for windows mocks
* for pmem_has_auto_flush_win
*/
#ifndef PMDK_HAS_AUTO_FLUSH_WIN_H
#define PMDK_HAS_AUTO_FLUSH_WIN_H 1
extern size_t Is_nfit;
extern size_t Pc_type;
extern size_t Pc_capabilities;
#endif
| 1,853 | 40.2 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/vmmalloc_dummy_funcs/vmmalloc_dummy_funcs.h
|
/*
* Copyright 2015-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* vmmalloc_weakfuncs.h -- definitions for vmmalloc tests
*/
#ifndef VMMALLOC_WEAKFUNCS_H
#define VMMALLOC_WEAKFUNCS_H
#include <stddef.h>
#ifndef __FreeBSD__
#include <malloc.h>
#endif
void *aligned_alloc(size_t alignment, size_t size);
#ifdef __FreeBSD__
void *memalign(size_t boundary, size_t size);
void *pvalloc(size_t size);
/* XXX These exist only to allow the tests to compile - they are never used */
extern void (*__free_hook)(void *, const void *);
extern void *(*__malloc_hook)(size_t size, const void *);
extern void *(*__memalign_hook)(size_t alignment, size_t size, const void *);
extern void *(*__realloc_hook)(void *ptr, size_t size, const void *);
#endif
#endif
| 2,292 | 37.864407 | 78 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/obj_heap_interrupt/mocks_windows.h
|
/*
* Copyright 2016-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* mocks_windows.h -- redefinitions of memops functions
*
* This file is Windows-specific.
*
* This file should be included (i.e. using Forced Include) by libpmemobj
* files, when compiled for the purpose of obj_heap_interrupt test.
* It would replace default implementation with mocked functions defined
* in obj_heap_interrupt.c.
*
* These defines could be also passed as preprocessor definitions.
*/
#ifndef WRAP_REAL
#define operation_finish __wrap_operation_finish
#endif
| 2,093 | 41.734694 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/obj_list/mocks_windows.h
|
/*
* Copyright 2016-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* mocks_windows.h -- redefinitions of obj list functions
*
* This file is Windows-specific.
*
* This file should be included (i.e. using Forced Include) by libpmemobj
* files, when compiled for the purpose of obj_list test.
* It would replace default implementation with mocked functions defined
* in obj_list.c.
*
* These defines could be also passed as preprocessor definitions.
*/
#if defined(__cplusplus)
extern "C" {
#endif
#ifdef WRAP_REAL
#define WRAP_REAL_PMALLOC
#define WRAP_REAL_ULOG
#define WRAP_REAL_LANE
#define WRAP_REAL_HEAP
#define WRAP_REAL_PMEMOBJ
#endif
#ifndef WRAP_REAL_PMALLOC
#define pmalloc __wrap_pmalloc
#define pfree __wrap_pfree
#define pmalloc_construct __wrap_pmalloc_construct
#define prealloc __wrap_prealloc
#define prealloc_construct __wrap_prealloc_construct
#define palloc_usable_size __wrap_palloc_usable_size
#define palloc_reserve __wrap_palloc_reserve
#define palloc_publish __wrap_palloc_publish
#define palloc_defer_free __wrap_palloc_defer_free
#endif
#ifndef WRAP_REAL_ULOG
#define ulog_store __wrap_ulog_store
#define ulog_process __wrap_ulog_process
#endif
#ifndef WRAP_REAL_LANE
#define lane_hold __wrap_lane_hold
#define lane_release __wrap_lane_release
#define lane_recover_and_section_boot __wrap_lane_recover_and_section_boot
#define lane_section_cleanup __wrap_lane_section_cleanup
#endif
#ifndef WRAP_REAL_HEAP
#define heap_boot __wrap_heap_boot
#endif
#ifndef WRAP_REAL_PMEMOBJ
#define pmemobj_alloc __wrap_pmemobj_alloc
#define pmemobj_alloc_usable_size __wrap_pmemobj_alloc_usable_size
#define pmemobj_openU __wrap_pmemobj_open
#define pmemobj_close __wrap_pmemobj_close
#define pmemobj_direct __wrap_pmemobj_direct
#define pmemobj_pool_by_oid __wrap_pmemobj_pool_by_oid
#define pmemobj_pool_by_ptr __wrap_pmemobj_pool_by_ptr
#endif
#if defined(__cplusplus)
}
#endif
| 3,448 | 33.838384 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/obj_list/obj_list.h
|
/*
* Copyright 2015-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* obj_list.h -- unit tests for list module
*/
#include <stddef.h>
#include <sys/param.h>
#include "list.h"
#include "obj.h"
#include "lane.h"
#include "unittest.h"
#include "util.h"
/* offset to "in band" item */
#define OOB_OFF (sizeof(struct oob_header))
/* pmemobj initial heap offset */
#define HEAP_OFFSET 8192
TOID_DECLARE(struct item, 0);
TOID_DECLARE(struct list, 1);
TOID_DECLARE(struct oob_list, 2);
TOID_DECLARE(struct oob_item, 3);
struct item {
int id;
POBJ_LIST_ENTRY(struct item) next;
};
struct oob_header {
char data[48];
};
struct oob_item {
struct oob_header oob;
struct item item;
};
struct oob_list {
struct list_head head;
};
struct list {
POBJ_LIST_HEAD(listhead, struct item) head;
};
enum ulog_fail
{
/* don't fail at all */
NO_FAIL,
/* fail after ulog_store */
FAIL_AFTER_FINISH,
/* fail before ulog_store */
FAIL_BEFORE_FINISH,
/* fail after process */
FAIL_AFTER_PROCESS
};
/* global handle to pmemobj pool */
extern PMEMobjpool *Pop;
/* pointer to heap offset */
extern uint64_t *Heap_offset;
/* list lane section */
extern struct lane Lane;
/* actual item id */
extern int *Id;
/* fail event */
extern enum ulog_fail Ulog_fail;
/* global "in band" lists */
extern TOID(struct list) List;
extern TOID(struct list) List_sec;
/* global "out of band" lists */
extern TOID(struct oob_list) List_oob;
extern TOID(struct oob_list) List_oob_sec;
extern TOID(struct oob_item) *Item;
/* usage macros */
#define FATAL_USAGE()\
UT_FATAL("usage: obj_list <file> [PRnifr]")
#define FATAL_USAGE_PRINT()\
UT_FATAL("usage: obj_list <file> P:<list>")
#define FATAL_USAGE_PRINT_REVERSE()\
UT_FATAL("usage: obj_list <file> R:<list>")
#define FATAL_USAGE_INSERT()\
UT_FATAL("usage: obj_list <file> i:<where>:<num>")
#define FATAL_USAGE_INSERT_NEW()\
UT_FATAL("usage: obj_list <file> n:<where>:<num>:<value>")
#define FATAL_USAGE_REMOVE_FREE()\
UT_FATAL("usage: obj_list <file> f:<list>:<num>:<from>")
#define FATAL_USAGE_REMOVE()\
UT_FATAL("usage: obj_list <file> r:<num>")
#define FATAL_USAGE_MOVE()\
UT_FATAL("usage: obj_list <file> m:<num>:<where>:<num>")
#define FATAL_USAGE_FAIL()\
UT_FATAL("usage: obj_list <file> "\
"F:<after_finish|before_finish|after_process>")
| 3,829 | 28.015152 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/blk_rw_mt/config.sh
|
#!/usr/bin/env bash
#
# Copyright 2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# blk_rw_mt/config.sh -- test configuration
#
# Extend timeout for this test, as it may take a few minutes
# when run on a non-pmem file system.
CONF_GLOBAL_TIMEOUT='10m'
| 1,760 | 40.928571 | 73 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/obj_persist_count/mocks_windows.h
|
/*
* Copyright 2016-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* mocks_windows.h -- redefinitions of pmem functions
*
* This file is Windows-specific.
*
* This file should be included (i.e. using Forced Include) by libpmemobj
* files, when compiled for the purpose of obj_persist_count test.
* It would replace default implementation with mocked functions defined
* in obj_persist_count.c.
*
* These defines could be also passed as preprocessor definitions.
*/
#ifndef WRAP_REAL
#define pmem_persist __wrap_pmem_persist
#define pmem_flush __wrap_pmem_flush
#define pmem_drain __wrap_pmem_drain
#define pmem_msync __wrap_pmem_msync
#define pmem_memcpy_persist __wrap_pmem_memcpy_persist
#define pmem_memcpy_nodrain __wrap_pmem_memcpy_nodrain
#define pmem_memcpy __wrap_pmem_memcpy
#define pmem_memmove_persist __wrap_pmem_memmove_persist
#define pmem_memmove_nodrain __wrap_pmem_memmove_nodrain
#define pmem_memmove __wrap_pmem_memmove
#define pmem_memset_persist __wrap_pmem_memset_persist
#define pmem_memset_nodrain __wrap_pmem_memset_nodrain
#define pmem_memset __wrap_pmem_memset
#endif
| 2,645 | 42.377049 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/compat_incompat_features/common.sh
|
#!/usr/bin/env bash
#
# Copyright 2017-2018, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# compat_incompat_features/common.sh -- common stuff for compat/incompat feature
# flags tests
#
ERR=err${UNITTEST_NUM}.log
ERR_TEMP=err${UNITTEST_NUM}_part.log
LOG=out${UNITTEST_NUM}.log
LOG_TEMP=out${UNITTEST_NUM}_part.log
rm -f $LOG && touch $LOG
rm -f $LOG_TEMP && touch $LOG_TEMP
rm -f $ERR && touch $ERR
rm -f $ERR_TEMP && touch $ERR_TEMP
LAYOUT=OBJ_LAYOUT$SUFFIX
POOLSET=$DIR/pool.set
POOL_TYPES=(obj blk log cto)
# pmempool create arguments:
declare -A create_args
create_args[obj]="obj $POOLSET"
create_args[blk]="blk 512 $POOLSET"
create_args[log]="log $POOLSET"
create_args[cto]="cto $POOLSET"
# Known compat flags:
# Known incompat flags:
let "POOL_FEAT_SINGLEHDR = 0x0001"
let "POOL_FEAT_CKSUM_2K = 0x0002"
let "POOL_FEAT_SDS = 0x0004"
# Unknown compat flags:
UNKNOWN_COMPAT=(2 4 8 1024)
# Unknown incompat flags:
UNKNOWN_INCOMPAT=(8 15 1111)
# set compat flags in header
set_compat() {
local part=$1
local flag=$2
expect_normal_exit $PMEMSPOIL $part pool_hdr.features.compat=$flag \
"pool_hdr.checksum_gen\(\)"
}
# set incompat flags in header
set_incompat() {
local part=$1
local flag=$2
expect_normal_exit $PMEMSPOIL $part pool_hdr.features.incompat=$flag \
"pool_hdr.checksum_gen\(\)"
}
| 2,852 | 32.174419 | 80 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/util_poolset/mocks_windows.h
|
/*
* Copyright 2016-2017, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* mocks_windows.h -- redefinitions of libc functions used in util_poolset
*
* This file is Windows-specific.
*
* This file should be included (i.e. using Forced Include) by libpmem
* files, when compiled for the purpose of util_poolset test.
* It would replace default implementation with mocked functions defined
* in util_poolset.c.
*
* These defines could be also passed as preprocessor definitions.
*/
#ifndef WRAP_REAL_OPEN
#define os_open __wrap_os_open
#endif
#ifndef WRAP_REAL_FALLOCATE
#define os_posix_fallocate __wrap_os_posix_fallocate
#endif
#ifndef WRAP_REAL_PMEM
#define pmem_is_pmem __wrap_pmem_is_pmem
#endif
| 2,245 | 38.403509 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/util_poolset/mocks.h
|
/*
* Copyright 2015-2017, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MOCKS_H
#define MOCKS_H
extern const char *Open_path;
extern os_off_t Fallocate_len;
extern size_t Is_pmem_len;
#endif
| 1,731 | 41.243902 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/obj_direct/obj_direct.h
|
/*
* Copyright 2017, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* obj_direct.h -- unit test for pmemobj_direct()
*/
#ifndef OBJ_DIRECT_H
#define OBJ_DIRECT_H 1
#include "libpmemobj.h"
void *obj_direct_inline(PMEMoid oid);
void *obj_direct_non_inline(PMEMoid oid);
#endif /* OBJ_DIRECT_H */
| 1,831 | 39.711111 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/obj_tx_mt/config.sh
|
#!/usr/bin/env bash
#
# Copyright 2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# obj_tx_mt/config.sh -- test configuration
#
# Extend timeout for this test, as it may take a few minutes
# when run on a non-pmem file system.
CONF_GLOBAL_TIMEOUT='10m'
| 1,760 | 40.928571 | 73 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/pmem_map_file_win/mocks_windows.h
|
/*
* Copyright 2016-2017, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* mocks_windows.h -- redefinitions of libc functions
*
* This file is Windows-specific.
*
* This file should be included (i.e. using Forced Include) by libpmem
* files, when compiled for the purpose of pmem_map_file test.
* It would replace default implementation with mocked functions defined
* in pmem_map_file.c.
*
* These defines could be also passed as preprocessor definitions.
*/
#ifndef WRAP_REAL
#define os_posix_fallocate __wrap_os_posix_fallocate
#define os_ftruncate __wrap_os_ftruncate
#endif
| 2,123 | 41.48 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/obj_rpmem_heap_state/config.sh
|
#!/usr/bin/env bash
#
# Copyright 2016-2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# obj_rpmem_heap_state/config.sh -- test configuration
#
CONF_GLOBAL_FS_TYPE=pmem
CONF_GLOBAL_BUILD_TYPE="debug nondebug"
CONF_GLOBAL_RPMEM_PROVIDER=all
CONF_GLOBAL_RPMEM_PMETHOD=all
| 1,776 | 41.309524 | 73 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/rpmem_addr_ext/config.sh
|
#!/usr/bin/env bash
#
# Copyright 2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# rpmem_addr_ext/config.sh -- test configuration file
#
CONF_GLOBAL_FS_TYPE=any
CONF_GLOBAL_BUILD_TYPE="debug nondebug"
CONF_GLOBAL_RPMEM_PROVIDER=sockets
CONF_GLOBAL_RPMEM_PMETHOD=GPSPM
| 1,775 | 41.285714 | 73 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/vmmalloc_init/libtest.h
|
/*
* Copyright 2015-2016, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LIBTEST_H
#define LIBTEST_H
#include <stddef.h>
void *falloc(size_t size, int c);
#endif
| 1,701 | 41.55 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/rpmemd_obc/setup.sh
|
#!/usr/bin/env bash
#
# Copyright 2016-2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# src/test/rpmemd_obc/setup.sh -- common setup for rpmemd_obc tests
#
require_nodes 2
require_node_log_files 1 $RPMEM_LOG_FILE
RPMEM_CMD="\"cd ${NODE_TEST_DIR[0]} && UNITTEST_FORCE_QUIET=1"
RPMEM_CMD="$RPMEM_CMD RPMEMD_LOG_FILE=$RPMEMD_LOG_FILE"
RPMEM_CMD="$RPMEM_CMD RPMEMD_LOG_LEVEL=$RPMEMD_LOG_LEVEL"
RPMEM_CMD="$RPMEM_CMD LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$REMOTE_LD_LIBRARY_PATH:${NODE_LD_LIBRARY_PATH[0]}"
RPMEM_CMD="$RPMEM_CMD ./rpmemd_obc$EXESUFFIX\""
export_vars_node 1 RPMEM_CMD
| 2,084 | 42.4375 | 107 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/rpmemd_obc/rpmemd_obc_test_common.h
|
/*
* Copyright 2016-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* rpmemd_obc_test_common.h -- common declarations for rpmemd_obc test
*/
#include "unittest.h"
#include "librpmem.h"
#include "rpmem_proto.h"
#include "rpmem_common.h"
#include "rpmem_ssh.h"
#include "rpmem_util.h"
#include "rpmemd_log.h"
#include "rpmemd_obc.h"
#define PORT 1234
#define RKEY 0x0123456789abcdef
#define RADDR 0xfedcba9876543210
#define PERSIST_METHOD RPMEM_PM_APM
#define POOL_ATTR_INIT {\
.signature = "<RPMEM>",\
.major = 1,\
.compat_features = 2,\
.incompat_features = 3,\
.ro_compat_features = 4,\
.poolset_uuid = "POOLSET_UUID0123",\
.uuid = "UUID0123456789AB",\
.next_uuid = "NEXT_UUID0123456",\
.prev_uuid = "PREV_UUID0123456",\
.user_flags = "USER_FLAGS012345",\
}
#define POOL_ATTR_ALT {\
.signature = "<ALT>",\
.major = 5,\
.compat_features = 6,\
.incompat_features = 7,\
.ro_compat_features = 8,\
.poolset_uuid = "UUID_POOLSET_ALT",\
.uuid = "ALT_UUIDCDEFFEDC",\
.next_uuid = "456UUID_NEXT_ALT",\
.prev_uuid = "UUID012_ALT_PREV",\
.user_flags = "012345USER_FLAGS",\
}
#define POOL_SIZE 0x0001234567abcdef
#define NLANES 0x123
#define NLANES_RESP 16
#define PROVIDER RPMEM_PROV_LIBFABRIC_SOCKETS
#define POOL_DESC "pool.set"
#define BUFF_SIZE 8192
static const char pool_desc[] = POOL_DESC;
#define POOL_DESC_SIZE (sizeof(pool_desc) / sizeof(pool_desc[0]))
struct rpmem_ssh *clnt_connect(char *target);
void clnt_wait_disconnect(struct rpmem_ssh *ssh);
void clnt_send(struct rpmem_ssh *ssh, const void *buff, size_t len);
void clnt_recv(struct rpmem_ssh *ssh, void *buff, size_t len);
void clnt_close(struct rpmem_ssh *ssh);
enum conn_wait_close {
CONN_CLOSE,
CONN_WAIT_CLOSE,
};
void set_rpmem_cmd(const char *fmt, ...);
extern struct rpmemd_obc_requests REQ_CB;
struct req_cb_arg {
int resp;
unsigned long long types;
int force_ret;
int ret;
int status;
};
static const struct rpmem_msg_hdr MSG_HDR = {
.type = RPMEM_MSG_TYPE_CLOSE,
.size = sizeof(struct rpmem_msg_hdr),
};
static const struct rpmem_msg_create CREATE_MSG = {
.hdr = {
.type = RPMEM_MSG_TYPE_CREATE,
.size = sizeof(struct rpmem_msg_create),
},
.c = {
.major = RPMEM_PROTO_MAJOR,
.minor = RPMEM_PROTO_MINOR,
.pool_size = POOL_SIZE,
.nlanes = NLANES,
.provider = PROVIDER,
.buff_size = BUFF_SIZE,
},
.pool_attr = POOL_ATTR_INIT,
.pool_desc = {
.size = POOL_DESC_SIZE,
},
};
static const struct rpmem_msg_open OPEN_MSG = {
.hdr = {
.type = RPMEM_MSG_TYPE_OPEN,
.size = sizeof(struct rpmem_msg_open),
},
.c = {
.major = RPMEM_PROTO_MAJOR,
.minor = RPMEM_PROTO_MINOR,
.pool_size = POOL_SIZE,
.nlanes = NLANES,
.provider = PROVIDER,
.buff_size = BUFF_SIZE,
},
.pool_desc = {
.size = POOL_DESC_SIZE,
},
};
static const struct rpmem_msg_close CLOSE_MSG = {
.hdr = {
.type = RPMEM_MSG_TYPE_CLOSE,
.size = sizeof(struct rpmem_msg_close),
},
};
static const struct rpmem_msg_set_attr SET_ATTR_MSG = {
.hdr = {
.type = RPMEM_MSG_TYPE_SET_ATTR,
.size = sizeof(struct rpmem_msg_set_attr),
},
.pool_attr = POOL_ATTR_ALT,
};
TEST_CASE_DECLARE(server_accept_sim);
TEST_CASE_DECLARE(server_accept_sim_fork);
TEST_CASE_DECLARE(client_accept_sim);
TEST_CASE_DECLARE(server_accept_seq);
TEST_CASE_DECLARE(server_accept_seq_fork);
TEST_CASE_DECLARE(client_accept_seq);
TEST_CASE_DECLARE(client_bad_msg_hdr);
TEST_CASE_DECLARE(server_bad_msg);
TEST_CASE_DECLARE(server_msg_noresp);
TEST_CASE_DECLARE(server_msg_resp);
TEST_CASE_DECLARE(client_econnreset);
TEST_CASE_DECLARE(server_econnreset);
TEST_CASE_DECLARE(client_create);
TEST_CASE_DECLARE(server_open);
TEST_CASE_DECLARE(client_close);
TEST_CASE_DECLARE(server_close);
TEST_CASE_DECLARE(client_open);
TEST_CASE_DECLARE(client_set_attr);
| 5,306 | 27.379679 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/pmempool_rm_remote/config.sh
|
#!/usr/bin/env bash
#
# Copyright 2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# pmempool_rm_remote/config.sh -- test configuration
#
set -e
CONF_GLOBAL_FS_TYPE=any
CONF_GLOBAL_BUILD_TYPE="debug nondebug"
CONF_GLOBAL_RPMEM_PROVIDER=sockets
CONF_GLOBAL_RPMEM_PMETHOD=GPSPM
| 1,781 | 40.44186 | 73 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/obj_rpmem_basic_integration/config.sh
|
#!/usr/bin/env bash
#
# Copyright 2016-2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# obj_rpmem_basic_integration/config.sh -- test configuration
#
CONF_GLOBAL_FS_TYPE=pmem
CONF_GLOBAL_BUILD_TYPE="debug nondebug"
CONF_GLOBAL_TEST_TYPE=medium
CONF_GLOBAL_RPMEM_PROVIDER=all
CONF_GLOBAL_RPMEM_PMETHOD=all
CONF_RPMEM_PROVIDER[9]=verbs
CONF_RPMEM_PROVIDER[10]=verbs
CONF_RPMEM_PROVIDER[11]=verbs
CONF_RPMEM_PROVIDER[13]=verbs
CONF_RPMEM_PROVIDER[14]=verbs
CONF_RPMEM_PROVIDER[15]=verbs
CONF_RPMEM_PROVIDER[16]=verbs
CONF_RPMEM_PROVIDER[17]=verbs
CONF_RPMEM_PROVIDER[18]=verbs
CONF_RPMEM_VALGRIND[9]=y
CONF_RPMEM_VALGRIND[10]=y
CONF_RPMEM_VALGRIND[11]=y
CONF_RPMEM_VALGRIND[13]=y
CONF_RPMEM_VALGRIND[14]=y
CONF_RPMEM_VALGRIND[15]=y
CONF_RPMEM_VALGRIND[16]=y
CONF_RPMEM_VALGRIND[17]=y
CONF_RPMEM_VALGRIND[18]=y
| 2,316 | 35.777778 | 73 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/pmem_map_file/mocks_windows.h
|
/*
* Copyright 2016-2017, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* mocks_windows.h -- redefinitions of libc functions
*
* This file is Windows-specific.
*
* This file should be included (i.e. using Forced Include) by libpmem
* files, when compiled for the purpose of pmem_map_file test.
* It would replace default implementation with mocked functions defined
* in pmem_map_file.c.
*
* These defines could be also passed as preprocessor definitions.
*/
#ifndef WRAP_REAL
#define os_posix_fallocate __wrap_os_posix_fallocate
#define os_ftruncate __wrap_os_ftruncate
#endif
| 2,123 | 41.48 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/obj_basic_integration/config.sh
|
#!/usr/bin/env bash
#
# Copyright 2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# obj_basic_integration/config.sh -- test configuration
#
# Extend timeout for this test, as it may take a few minutes
# when run on a non-pmem file system.
CONF_GLOBAL_TIMEOUT='10m'
| 1,772 | 41.214286 | 73 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/pmempool_feature/common.sh
|
#!/usr/bin/env bash
#
# Copyright 2018, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# src/test/pmempool_feature/common.sh -- common part of pmempool_feature tests
#
# for feature values please see: pmempool feature help
PART_SIZE=$((10 * 1024 * 1024)) # 10MiB
# define files and directories
POOLSET=$DIR/testset
TEST_SET_LOCAL=testset_local
TEST_SET_REMOTE=testset_remote
LOG=grep${UNITTEST_NUM}.log
pmempool_exe=$PMEMPOOL$EXESUFFIX
exit_func=expect_normal_exit
# pmempool_feature_query -- query feature
#
# usage: pmempool_feature_query <feature> [<query-exit-type>]
function pmempool_feature_query() {
query_exit_type=${2-normal}
query_exit_func=expect_${query_exit_type}_exit
val=$($query_exit_func $pmempool_exe feature -q $1 $POOLSET 2>> $LOG)
if [ "$query_exit_type" == "normal" ]; then
echo "query $1 result is $val" &>> $LOG
fi
}
# pmempool_feature_enable -- enable feature
#
# usage: pmempool_feature_enable <feature> [no-query]
function pmempool_feature_enable() {
$exit_func $pmempool_exe feature -e $1 $POOLSET &>> $LOG
if [ "x$2" != "xno-query" ]; then
pmempool_feature_query $1
fi
}
# pmempool_feature_disable -- disable feature
#
# usage: pmempool_feature_disable <feature> [no-query]
function pmempool_feature_disable() {
$exit_func $pmempool_exe feature -d $1 $POOLSET &>> $LOG
if [ "x$2" != "xno-query" ]; then
pmempool_feature_query $1
fi
}
# pmempool_feature_create_poolset -- create poolset
#
# usage: pmempool_feature_create_poolset <poolset-type>
function pmempool_feature_create_poolset() {
POOLSET_TYPE=$1
case "$1" in
"no_dax_device")
create_poolset $POOLSET \
$PART_SIZE:$DIR/testfile11:x \
$PART_SIZE:$DIR/testfile12:x \
r \
$PART_SIZE:$DIR/testfile21:x \
$PART_SIZE:$DIR/testfile22:x \
r \
$PART_SIZE:$DIR/testfile31:x
;;
"dax_device")
create_poolset $POOLSET \
AUTO:$DEVICE_DAX_PATH
;;
"remote")
create_poolset $DIR/$TEST_SET_LOCAL \
$PART_SIZE:${NODE_DIR[1]}/testfile_local11:x \
$PART_SIZE:${NODE_DIR[1]}/testfile_local12:x \
m ${NODE_ADDR[0]}:$TEST_SET_REMOTE
create_poolset $DIR/$TEST_SET_REMOTE \
$PART_SIZE:${NODE_DIR[0]}/testfile_remote21:x \
$PART_SIZE:${NODE_DIR[0]}/testfile_remote22:x
copy_files_to_node 0 ${NODE_DIR[0]} $DIR/$TEST_SET_REMOTE
copy_files_to_node 1 ${NODE_DIR[1]} $DIR/$TEST_SET_LOCAL
rm_files_from_node 1 \
${NODE_DIR[1]}testfile_local11 ${NODE_DIR[1]}testfile_local12
rm_files_from_node 0 \
${NODE_DIR[0]}testfile_remote21 ${NODE_DIR[0]}testfile_remote22
POOLSET="${NODE_DIR[1]}/$TEST_SET_LOCAL"
;;
esac
# XXX: pmempool rm does not pass Valgrind memcheck pmem/issues#947
VALGRIND_DISABLED=y expect_normal_exit $pmempool_exe rm -f $POOLSET
# create pool
# pmempool create under valgrind pmemcheck takes too long
# it is not part of the test so it is run here without valgrind
VALGRIND_DISABLED=y expect_normal_exit $pmempool_exe create obj $POOLSET
}
# pmempool_feature_test_SINGLEHDR -- test SINGLEHDR
function pmempool_feature_test_SINGLEHDR() {
exit_func=expect_abnormal_exit
pmempool_feature_enable "SINGLEHDR" "no-query" # UNSUPPORTED
pmempool_feature_disable "SINGLEHDR" "no-query" # UNSUPPORTED
exit_func=expect_normal_exit
pmempool_feature_query "SINGLEHDR"
}
# pmempool_feature_test_CKSUM_2K -- test CKSUM_2K
function pmempool_feature_test_CKSUM_2K() {
# PMEMPOOL_FEAT_CHCKSUM_2K is enabled by default
pmempool_feature_query "CKSUM_2K"
# SHUTDOWN_STATE is disabled by default on Linux
# enable it to interfere toggling CKSUM_2K
pmempool_feature_enable SHUTDOWN_STATE "no-query"
# disable PMEMPOOL_FEAT_SHUTDOWN_STATE prior to success
exit_func=expect_abnormal_exit
pmempool_feature_disable "CKSUM_2K" # should fail
exit_func=expect_normal_exit
pmempool_feature_disable "SHUTDOWN_STATE"
pmempool_feature_disable "CKSUM_2K" # should succeed
pmempool_feature_enable "CKSUM_2K"
}
# pmempool_feature_test_SHUTDOWN_STATE -- test SHUTDOWN_STATE
function pmempool_feature_test_SHUTDOWN_STATE() {
# PMEMPOOL_FEAT_SHUTDOWN_STATE is disabled by default
pmempool_feature_query "SHUTDOWN_STATE"
# PMEMPOOL_FEAT_SHUTDOWN_STATE requires PMEMPOOL_FEAT_CHCKSUM_2K
pmempool_feature_disable "CKSUM_2K"
exit_func=expect_abnormal_exit
pmempool_feature_enable "SHUTDOWN_STATE" # should fail
exit_func=expect_normal_exit
pmempool_feature_enable "CKSUM_2K"
pmempool_feature_enable "SHUTDOWN_STATE" # should succeed
}
# pmempool_feature_test_CHECK_BAD_BLOCKS -- test SHUTDOWN_STATE
function pmempool_feature_test_CHECK_BAD_BLOCKS() {
# PMEMPOOL_FEAT_CHECK_BAD_BLOCKS is disabled by default
pmempool_feature_query "CHECK_BAD_BLOCKS"
pmempool_feature_enable "CHECK_BAD_BLOCKS"
pmempool_feature_disable "CHECK_BAD_BLOCKS"
}
# pmempool_feature_remote_init -- initialization remote replics
function pmempool_feature_remote_init() {
require_nodes 2
require_node_libfabric 0 $RPMEM_PROVIDER
require_node_libfabric 1 $RPMEM_PROVIDER
init_rpmem_on_node 1 0
pmempool_exe="run_on_node 1 ../pmempool"
}
# pmempool_feature_test_remote -- run remote tests
function pmempool_feature_test_remote() {
# create pool
expect_normal_exit $pmempool_exe rm -f $POOLSET
expect_normal_exit $pmempool_exe create obj $POOLSET
# poolset with remote replicas are not supported
exit_func=expect_abnormal_exit
pmempool_feature_enable $1 no-query
pmempool_feature_disable $1 no-query
pmempool_feature_query $1 abnormal
}
| 6,906 | 31.890476 | 78 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/pmempool_info_remote/config.sh
|
#!/usr/bin/env bash
#
# Copyright 2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# pmempool_info_remote/config.sh -- test configuration
#
set -e
CONF_GLOBAL_FS_TYPE=any
CONF_GLOBAL_BUILD_TYPE="debug nondebug"
CONF_GLOBAL_RPMEM_PROVIDER=sockets
CONF_GLOBAL_RPMEM_PMETHOD=GPSPM
| 1,783 | 40.488372 | 73 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/pmempool_transform_remote/config.sh
|
#!/usr/bin/env bash
#
# Copyright 2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# pmempool_transform_remote/config.sh -- configuration of unit tests
#
CONF_GLOBAL_FS_TYPE=any
CONF_GLOBAL_BUILD_TYPE="debug nondebug"
CONF_GLOBAL_RPMEM_PROVIDER=all
CONF_GLOBAL_RPMEM_PMETHOD=all
| 1,784 | 41.5 | 73 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/pmempool_transform_remote/common.sh
|
#!/usr/bin/env bash
#
# Copyright 2017-2018, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# pmempool_transform_remote/common.sh -- commons for pmempool transform tests
# with remote replication
#
set -e
require_nodes 2
require_node_libfabric 0 $RPMEM_PROVIDER
require_node_libfabric 1 $RPMEM_PROVIDER
setup
init_rpmem_on_node 1 0
require_node_log_files 1 pmemobj$UNITTEST_NUM.log
require_node_log_files 1 pmempool$UNITTEST_NUM.log
LOG=out${UNITTEST_NUM}.log
LOG_TEMP=out${UNITTEST_NUM}_part.log
rm -f $LOG && touch $LOG
rm -f $LOG_TEMP && touch $LOG_TEMP
rm_files_from_node 0 ${NODE_TEST_DIR[0]}/$LOG
rm_files_from_node 1 ${NODE_TEST_DIR[1]}/$LOG
LAYOUT=OBJ_LAYOUT
POOLSET_LOCAL_IN=poolset.in
POOLSET_LOCAL_OUT=poolset.out
POOLSET_REMOTE=poolset.remote
POOLSET_REMOTE1=poolset.remote1
POOLSET_REMOTE2=poolset.remote2
# CLI scripts for writing and reading some data hitting all the parts
WRITE_SCRIPT="pmemobjcli.write.script"
READ_SCRIPT="pmemobjcli.read.script"
copy_files_to_node 1 ${NODE_DIR[1]} $WRITE_SCRIPT $READ_SCRIPT
DUMP_INFO_LOG="../pmempool info"
DUMP_INFO_LOG_REMOTE="$DUMP_INFO_LOG -f obj"
DUMP_INFO_SED="sed -e '/^Checksum/d' -e '/^Creation/d' -e '/^Previous replica UUID/d' -e '/^Next replica UUID/d'"
DUMP_INFO_SED_REMOTE="$DUMP_INFO_SED -e '/^Previous part UUID/d' -e '/^Next part UUID/d'"
function dump_info_log() {
local node=$1
local poolset=$2
local name=$3
local ignore=$4
local sed_cmd="$DUMP_INFO_SED"
if [ -n "$ignore" ]; then
sed_cmd="$sed_cmd -e '/^$ignore/d'"
fi
expect_normal_exit run_on_node $node "\"$DUMP_INFO_LOG $poolset | $sed_cmd >> $name\""
}
function dump_info_log_remote() {
local node=$1
local poolset=$2
local name=$3
local ignore=$4
local sed_cmd="$DUMP_INFO_SED_REMOTE"
if [ -n "$ignore" ]; then
sed_cmd="$sed_cmd -e '/^$ignore/d'"
fi
expect_normal_exit run_on_node $node "\"$DUMP_INFO_LOG_REMOTE $poolset | $sed_cmd >> $name\""
}
function diff_log() {
local node=$1
local f1=$2
local f2=$3
expect_normal_exit run_on_node $node "\"[ -s $f1 ] && [ -s $f2 ] && diff $f1 $f2\""
}
exec_pmemobjcli_script() {
local node=$1
local script=$2
local poolset=$3
local out=$4
expect_normal_exit run_on_node $node "\"../pmemobjcli -s $script $poolset > $out \""
}
| 3,784 | 30.541667 | 113 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/pmempool_feature_remote/config.sh
|
#!/usr/bin/env bash
#
# Copyright 2018, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# pmempool_feature_remote/config.sh -- test configuration
#
CONF_GLOBAL_FS_TYPE=any
CONF_GLOBAL_BUILD_TYPE="debug nondebug"
# pmempool feature does not support poolsets with remote replicas
# unittest contains only negative scenarios so no point to loop over
# all providers and persistency methods
CONF_GLOBAL_RPMEM_PROVIDER=sockets
CONF_GLOBAL_RPMEM_PMETHOD=GPSPM
| 1,954 | 42.444444 | 73 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/rpmem_basic/common_pm_policy.sh
|
#!/usr/bin/env bash
#
# Copyright 2017-2018, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# src/test/rpmem_basic/common_pm_policy.sh -- common part for TEST[10-11] scripts
#
set -e
LOG=rpmemd$UNITTEST_NUM.log
OUT=out$UNITTEST_NUM.log
rm -f $OUT
# create poolset and upload
run_on_node 0 "rm -rf ${RPMEM_POOLSET_DIR[0]} && mkdir -p ${RPMEM_POOLSET_DIR[0]} && mkdir -p ${NODE_DIR[0]}$POOLS_PART"
create_poolset $DIR/pool.set 8M:$PART_DIR/pool.part0 8M:$PART_DIR/pool.part1
copy_files_to_node 0 ${RPMEM_POOLSET_DIR[0]} $DIR/pool.set
# create pool and close it - local pool from file
SIMPLE_ARGS="test_create 0 pool.set ${NODE_ADDR[0]} pool 8M none test_close 0"
function test_pm_policy()
{
# initialize pmem
PMEM_IS_PMEM_FORCE=$1
export_vars_node 0 PMEM_IS_PMEM_FORCE
init_rpmem_on_node 1 0
# remove rpmemd log and pool parts
run_on_node 0 "rm -rf $PART_DIR && mkdir -p $PART_DIR && rm -f $LOG"
# execute, get log
expect_normal_exit run_on_node 1 ./rpmem_basic$EXESUFFIX $SIMPLE_ARGS
copy_files_from_node 0 . ${NODE_TEST_DIR[0]}/$LOG
# extract persist method and flush function
cat $LOG | $GREP -A2 "persistency policy:" >> $OUT
}
| 2,648 | 37.955882 | 120 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/rpmem_basic/config.sh
|
#!/usr/bin/env bash
#
# Copyright 2016-2018, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# rpmem_basic/config.sh -- test configuration
#
CONF_GLOBAL_FS_TYPE=any
CONF_GLOBAL_BUILD_TYPE="debug nondebug"
CONF_GLOBAL_RPMEM_PROVIDER=all
CONF_GLOBAL_RPMEM_PMETHOD=all
CONF_RPMEM_PMETHOD[10]=APM
CONF_RPMEM_PMETHOD[11]=GPSPM
# Sockets provider does not detect fi_cq_signal so it does not return
# from fi_cq_sread. It causes this test to hang sporadically.
# https://github.com/ofiwg/libfabric/pull/3645
CONF_RPMEM_PROVIDER[12]=verbs
| 2,033 | 39.68 | 73 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/rpmem_basic/setup2to1.sh
|
#!/usr/bin/env bash
#
# Copyright 2016-2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# src/test/rpmem_basic/setup2to1.sh -- common part for TEST[7-] scripts
#
POOLS_DIR=pools
POOLS_PART=pool_parts
TEST_LOG_FILE=test$UNITTEST_NUM.log
TEST_LOG_LEVEL=3
#
# This unit test requires 4 nodes, but nodes #0 and #3 should be the same
# physical machine - they should have the same NODE[n] addresses but
# different NODE_ADDR[n] addresses in order to test "2-to-1" configuration.
# Node #1 is being replicated to the node #0 and node #2 is being replicated
# to the node #3.
#
require_nodes 4
REPLICA[1]=0
REPLICA[2]=3
for node in 1 2; do
require_node_libfabric ${node} $RPMEM_PROVIDER
require_node_libfabric ${REPLICA[${node}]} $RPMEM_PROVIDER
export_vars_node ${node} TEST_LOG_FILE
export_vars_node ${node} TEST_LOG_LEVEL
require_node_log_files ${node} $PMEM_LOG_FILE
require_node_log_files ${node} $RPMEM_LOG_FILE
require_node_log_files ${node} $TEST_LOG_FILE
require_node_log_files ${REPLICA[${node}]} $RPMEMD_LOG_FILE
REP_ADDR[${node}]=${NODE_ADDR[${REPLICA[${node}]}]}
PART_DIR[${node}]=${NODE_DIR[${REPLICA[${node}]}]}$POOLS_PART
RPMEM_POOLSET_DIR[${REPLICA[${node}]}]=${NODE_DIR[${REPLICA[${node}]}]}$POOLS_DIR
init_rpmem_on_node ${node} ${REPLICA[${node}]}
PID_FILE[${node}]="pidfile${UNITTEST_NUM}-${node}.pid"
clean_remote_node ${node} ${PID_FILE[${node}]}
done
| 2,972 | 37.115385 | 82 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/rpmem_basic/setup.sh
|
#!/usr/bin/env bash
#
# Copyright 2016-2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# src/test/rpmem_basic/setup.sh -- common part for TEST* scripts
#
set -e
require_nodes 2
require_node_libfabric 0 $RPMEM_PROVIDER $SETUP_LIBFABRIC_VERSION
require_node_libfabric 1 $RPMEM_PROVIDER $SETUP_LIBFABRIC_VERSION
require_node_log_files 0 $RPMEMD_LOG_FILE
require_node_log_files 1 $RPMEM_LOG_FILE
require_node_log_files 1 $PMEM_LOG_FILE
POOLS_DIR=pools
POOLS_PART=pool_parts
PART_DIR=${NODE_DIR[0]}/$POOLS_PART
RPMEM_POOLSET_DIR[0]=${NODE_DIR[0]}$POOLS_DIR
if [ -z "$SETUP_MANUAL_INIT_RPMEM" ]; then
init_rpmem_on_node 1 0
fi
| 2,130 | 38.462963 | 73 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/obj_rpmem_heap_interrupt/config.sh
|
#!/usr/bin/env bash
#
# Copyright 2016-2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# src/test/obj_rpmem_heap_interrupt/config.sh -- test configuration
#
CONF_GLOBAL_FS_TYPE=pmem
CONF_GLOBAL_BUILD_TYPE="debug nondebug"
CONF_GLOBAL_RPMEM_PROVIDER=all
CONF_GLOBAL_RPMEM_PMETHOD=all
| 1,789 | 41.619048 | 73 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/libpmempool_backup/config.sh
|
#!/usr/bin/env bash
#
# Copyright 2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# libpmempool_backup/config.sh -- test configuration
#
# Extend timeout for TEST0, as it may take more than a minute
# when run on a non-pmem file system.
CONF_TIMEOUT[0]='10m'
| 1,766 | 41.071429 | 73 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/libpmempool_backup/common.sh
|
#!/usr/bin/env bash
#
# Copyright 2016-2018, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# libpmempool_backup/common.sh -- functions for libpmempool_backup unittest
#
set -e
POOLSET=$DIR/pool.set
BACKUP=_backup
REPLICA=_replica
POOL_PART=$DIR/pool.part
OUT=out${UNITTEST_NUM}.log
OUT_TEMP=out${UNITTEST_NUM}_temp.log
DIFF=diff${UNITTEST_NUM}.log
rm -f $LOG $DIFF $OUT_TEMP && touch $LOG $DIFF $OUT_TEMP
# params for blk, log and obj pools
POOL_TYPES=( blk log obj )
POOL_CREATE_PARAMS=( "--write-layout 512" "" "--layout test_layout" )
POOL_CHECK_PARAMS=( "-smgB" "-s" "-soOaAbZH -l -C" )
POOL_OBJ=2
# create_poolset_variation -- create one from the tested poolset variation
# usage: create_poolset_variation <variation-id> [<suffix>]
#
function create_poolset_variation() {
local sfx=""
local variation=$1
shift
if [ $# -gt 0 ]; then
sfx=$1
fi
case "$variation"
in
1)
# valid poolset file
create_poolset $POOLSET$sfx \
20M:${POOL_PART}1$sfx:x \
20M:${POOL_PART}2$sfx:x \
20M:${POOL_PART}3$sfx:x \
20M:${POOL_PART}4$sfx:x
;;
2)
# valid poolset file with replica
create_poolset $POOLSET$sfx \
20M:${POOL_PART}1$sfx:x \
20M:${POOL_PART}2$sfx:x \
20M:${POOL_PART}3$sfx:x \
20M:${POOL_PART}4$sfx:x \
r 80M:${POOL_PART}${REPLICA}$sfx:x
;;
3)
# other number of parts
create_poolset $POOLSET$sfx \
20M:${POOL_PART}1$sfx:x \
20M:${POOL_PART}2$sfx:x \
40M:${POOL_PART}3$sfx:x
;;
4)
# no poolset
# return without check_file
return
;;
5)
# empty
create_poolset $POOLSET$sfx
;;
6)
# other size of part
create_poolset $POOLSET$sfx \
20M:${POOL_PART}1$sfx:x \
20M:${POOL_PART}2$sfx:x \
20M:${POOL_PART}3$sfx:x \
21M:${POOL_PART}4$sfx:x
;;
esac
check_file $POOLSET$sfx
}
#
# backup_and_compare -- perform backup and compare backup result with original
# if compare parameters are provided
# usage: backup_and_compare <poolset> <type> [<compare-params>]
#
function backup_and_compare () {
local poolset=$1
local type=$2
shift 2
# backup
expect_normal_exit ../libpmempool_api/libpmempool_test$EXESUFFIX \
-b $poolset$BACKUP -t $type -r 1 $poolset
cat $OUT >> $OUT_TEMP
# compare
if [ $# -gt 0 ]; then
compare_replicas "$1" $poolset $poolset$BACKUP >> $DIFF
fi
}
ALL_POOL_PARTS="${POOL_PART}1 ${POOL_PART}2 ${POOL_PART}3 ${POOL_PART}4 \
${POOL_PART}${REPLICA}"
ALL_POOL_BACKUP_PARTS="${POOL_PART}1$BACKUP ${POOL_PART}2$BACKUP \
${POOL_PART}3$BACKUP ${POOL_PART}4$BACKUP \
${POOL_PART}${BACKUP}${REPLICA}"
#
# backup_cleanup -- perform cleanup between test cases
#
function backup_cleanup() {
rm -f $POOLSET$BACKUP $ALL_POOL_PARTS $ALL_POOL_BACKUP_PARTS
}
| 4,177 | 27.421769 | 78 |
sh
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/test/obj_sync/mocks_windows.h
|
/*
* Copyright 2016-2017, Intel Corporation
* Copyright (c) 2016, Microsoft Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* mocks_windows.h -- redefinitions of pthread functions
*
* This file is Windows-specific.
*
* This file should be included (i.e. using Forced Include) by libpmemobj
* files, when compiled for the purpose of obj_sync test.
* It would replace default implementation with mocked functions defined
* in obj_sync.c.
*
* These defines could be also passed as preprocessor definitions.
*/
#ifndef WRAP_REAL
#define os_mutex_init __wrap_os_mutex_init
#define os_rwlock_init __wrap_os_rwlock_init
#define os_cond_init __wrap_os_cond_init
#endif
| 2,221 | 41.730769 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libvmmalloc/vmmalloc.h
|
/*
* Copyright 2014-2016, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* vmmalloc.h -- internal definitions for libvmmalloc
*/
#define VMMALLOC_LOG_PREFIX "libvmmalloc"
#define VMMALLOC_LOG_LEVEL_VAR "VMMALLOC_LOG_LEVEL"
#define VMMALLOC_LOG_FILE_VAR "VMMALLOC_LOG_FILE"
#define VMMALLOC_LOG_STATS_VAR "VMMALLOC_LOG_STATS"
#define VMMALLOC_POOL_DIR_VAR "VMMALLOC_POOL_DIR"
#define VMMALLOC_POOL_SIZE_VAR "VMMALLOC_POOL_SIZE"
#define VMMALLOC_FORK_VAR "VMMALLOC_FORK"
| 2,005 | 43.577778 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/rpmem_common/rpmem_fip_common.h
|
/*
* Copyright 2016-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* rpmem_fip_common.h -- common definitions for librpmem and rpmemd
*/
#ifndef RPMEM_FIP_COMMON_H
#define RPMEM_FIP_COMMON_H 1
#include <string.h>
#include <netinet/in.h>
#include <rdma/fabric.h>
#include <rdma/fi_cm.h>
#include <rdma/fi_rma.h>
#ifdef __cplusplus
extern "C" {
#endif
#define RPMEM_FIVERSION FI_VERSION(1, 4)
#define RPMEM_FIP_CQ_WAIT_MS 100
#define min(a, b) ((a) < (b) ? (a) : (b))
/*
* rpmem_fip_node -- client or server node type
*/
enum rpmem_fip_node {
RPMEM_FIP_NODE_CLIENT,
RPMEM_FIP_NODE_SERVER,
MAX_RPMEM_FIP_NODE,
};
/*
* rpmem_fip_probe -- list of providers
*/
struct rpmem_fip_probe {
unsigned providers;
};
/*
* rpmem_fip_probe -- returns true if specified provider is available
*/
static inline int
rpmem_fip_probe(struct rpmem_fip_probe probe, enum rpmem_provider provider)
{
return (probe.providers & (1U << provider)) != 0;
}
/*
* rpmem_fip_probe_any -- returns true if any provider is available
*/
static inline int
rpmem_fip_probe_any(struct rpmem_fip_probe probe)
{
return probe.providers != 0;
}
int rpmem_fip_probe_get(const char *target, struct rpmem_fip_probe *probe);
struct fi_info *rpmem_fip_get_hints(enum rpmem_provider provider);
int rpmem_fip_read_eq_check(struct fid_eq *eq, struct fi_eq_cm_entry *entry,
uint32_t exp_event, fid_t exp_fid, int timeout);
int rpmem_fip_read_eq(struct fid_eq *eq, struct fi_eq_cm_entry *entry,
uint32_t *event, int timeout);
size_t rpmem_fip_cq_size(enum rpmem_persist_method pm,
enum rpmem_fip_node node);
size_t rpmem_fip_tx_size(enum rpmem_persist_method pm,
enum rpmem_fip_node node);
size_t rpmem_fip_rx_size(enum rpmem_persist_method pm,
enum rpmem_fip_node node);
size_t rpmem_fip_max_nlanes(struct fi_info *fi);
void rpmem_fip_print_info(struct fi_info *fi);
#ifdef __cplusplus
}
#endif
#endif
| 3,428 | 28.307692 | 76 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/rpmem_common/rpmem_common_log.h
|
/*
* Copyright 2016, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* rpmem_common_log.h -- common log macros for librpmem and rpmemd
*/
#if defined(RPMEMC_LOG_RPMEM) && defined(RPMEMC_LOG_RPMEMD)
#error Both RPMEMC_LOG_RPMEM and RPMEMC_LOG_RPMEMD defined
#elif !defined(RPMEMC_LOG_RPMEM) && !defined(RPMEMC_LOG_RPMEMD)
#define RPMEMC_LOG(level, fmt, args...) do {} while (0)
#define RPMEMC_DBG(level, fmt, args...) do {} while (0)
#define RPMEMC_FATAL(fmt, args...) do {} while (0)
#define RPMEMC_ASSERT(cond) do {} while (0)
#elif defined(RPMEMC_LOG_RPMEM)
#include "out.h"
#include "rpmem_util.h"
#define RPMEMC_LOG(level, fmt, args...) RPMEM_LOG(level, fmt, ## args)
#define RPMEMC_DBG(level, fmt, args...) RPMEM_DBG(fmt, ## args)
#define RPMEMC_FATAL(fmt, args...) RPMEM_FATAL(fmt, ## args)
#define RPMEMC_ASSERT(cond) RPMEM_ASSERT(cond)
#else
#include "rpmemd_log.h"
#define RPMEMC_LOG(level, fmt, args...) RPMEMD_LOG(level, fmt, ## args)
#define RPMEMC_DBG(level, fmt, args...) RPMEMD_DBG(fmt, ## args)
#define RPMEMC_FATAL(fmt, args...) RPMEMD_FATAL(fmt, ## args)
#define RPMEMC_ASSERT(cond) RPMEMD_ASSERT(cond)
#endif
| 2,675 | 38.352941 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/rpmem_common/rpmem_common.h
|
/*
* Copyright 2016-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* rpmem_common.h -- common definitions for librpmem and rpmemd
*/
#ifndef RPMEM_COMMON_H
#define RPMEM_COMMON_H 1
/*
* Values for SO_KEEPALIVE socket option
*/
#define RPMEM_CMD_ENV "RPMEM_CMD"
#define RPMEM_SSH_ENV "RPMEM_SSH"
#define RPMEM_DEF_CMD "rpmemd"
#define RPMEM_DEF_SSH "ssh"
#define RPMEM_PROV_SOCKET_ENV "RPMEM_ENABLE_SOCKETS"
#define RPMEM_PROV_VERBS_ENV "RPMEM_ENABLE_VERBS"
#define RPMEM_MAX_NLANES_ENV "RPMEM_MAX_NLANES"
#define RPMEM_ACCEPT_TIMEOUT 30000
#define RPMEM_CONNECT_TIMEOUT 30000
#define RPMEM_MONITOR_TIMEOUT 1000
#include <stdint.h>
#include <sys/socket.h>
#include <netdb.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* rpmem_err -- error codes
*/
enum rpmem_err {
RPMEM_SUCCESS = 0,
RPMEM_ERR_BADPROTO = 1,
RPMEM_ERR_BADNAME = 2,
RPMEM_ERR_BADSIZE = 3,
RPMEM_ERR_BADNLANES = 4,
RPMEM_ERR_BADPROVIDER = 5,
RPMEM_ERR_FATAL = 6,
RPMEM_ERR_FATAL_CONN = 7,
RPMEM_ERR_BUSY = 8,
RPMEM_ERR_EXISTS = 9,
RPMEM_ERR_PROVNOSUP = 10,
RPMEM_ERR_NOEXIST = 11,
RPMEM_ERR_NOACCESS = 12,
RPMEM_ERR_POOL_CFG = 13,
MAX_RPMEM_ERR,
};
/*
* rpmem_persist_method -- remote persist operation method
*/
enum rpmem_persist_method {
RPMEM_PM_GPSPM = 1, /* General Purpose Server Persistency Method */
RPMEM_PM_APM = 2, /* Appliance Persistency Method */
MAX_RPMEM_PM,
};
const char *rpmem_persist_method_to_str(enum rpmem_persist_method pm);
/*
* rpmem_provider -- supported providers
*/
enum rpmem_provider {
RPMEM_PROV_UNKNOWN = 0,
RPMEM_PROV_LIBFABRIC_VERBS = 1,
RPMEM_PROV_LIBFABRIC_SOCKETS = 2,
MAX_RPMEM_PROV,
};
enum rpmem_provider rpmem_provider_from_str(const char *str);
const char *rpmem_provider_to_str(enum rpmem_provider provider);
/*
* rpmem_req_attr -- arguments for open/create request
*/
struct rpmem_req_attr {
size_t pool_size;
unsigned nlanes;
size_t buff_size;
enum rpmem_provider provider;
const char *pool_desc;
};
/*
* rpmem_resp_attr -- return arguments from open/create request
*/
struct rpmem_resp_attr {
unsigned short port;
uint64_t rkey;
uint64_t raddr;
unsigned nlanes;
enum rpmem_persist_method persist_method;
};
#define RPMEM_HAS_USER 0x1
#define RPMEM_HAS_SERVICE 0x2
#define RPMEM_FLAGS_USE_IPV4 0x4
#define RPMEM_MAX_USER (32 + 1) /* see useradd(8) + 1 for '\0' */
#define RPMEM_MAX_NODE (255 + 1) /* see gethostname(2) + 1 for '\0' */
#define RPMEM_MAX_SERVICE (NI_MAXSERV + 1) /* + 1 for '\0' */
#define RPMEM_HDR_SIZE 4096
#define RPMEM_CLOSE_FLAGS_REMOVE 0x1
#define RPMEM_DEF_BUFF_SIZE 8192
struct rpmem_target_info {
char user[RPMEM_MAX_USER];
char node[RPMEM_MAX_NODE];
char service[RPMEM_MAX_SERVICE];
unsigned flags;
};
extern unsigned Rpmem_max_nlanes;
extern int Rpmem_fork_unsafe;
int rpmem_b64_write(int sockfd, const void *buf, size_t len, int flags);
int rpmem_b64_read(int sockfd, void *buf, size_t len, int flags);
const char *rpmem_get_ip_str(const struct sockaddr *addr);
struct rpmem_target_info *rpmem_target_parse(const char *target);
void rpmem_target_free(struct rpmem_target_info *info);
int rpmem_xwrite(int fd, const void *buf, size_t len, int flags);
int rpmem_xread(int fd, void *buf, size_t len, int flags);
char *rpmem_get_ssh_conn_addr(void);
#ifdef __cplusplus
}
#endif
#endif
| 4,838 | 27.976048 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/rpmem_common/rpmem_proto.h
|
/*
* Copyright 2016-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* rpmem_proto.h -- rpmem protocol definitions
*/
#ifndef RPMEM_PROTO_H
#define RPMEM_PROTO_H 1
#include <stdint.h>
#include <endian.h>
#include "librpmem.h"
#ifdef __cplusplus
extern "C" {
#endif
#define PACKED __attribute__((packed))
#define RPMEM_PROTO "tcp"
#define RPMEM_PROTO_MAJOR 0
#define RPMEM_PROTO_MINOR 1
#define RPMEM_SIG_SIZE 8
#define RPMEM_UUID_SIZE 16
#define RPMEM_PROV_SIZE 32
#define RPMEM_USER_SIZE 16
/*
* rpmem_msg_type -- type of messages
*/
enum rpmem_msg_type {
RPMEM_MSG_TYPE_CREATE = 1, /* create request */
RPMEM_MSG_TYPE_CREATE_RESP = 2, /* create request response */
RPMEM_MSG_TYPE_OPEN = 3, /* open request */
RPMEM_MSG_TYPE_OPEN_RESP = 4, /* open request response */
RPMEM_MSG_TYPE_CLOSE = 5, /* close request */
RPMEM_MSG_TYPE_CLOSE_RESP = 6, /* close request response */
RPMEM_MSG_TYPE_SET_ATTR = 7, /* set attributes request */
/* set attributes request response */
RPMEM_MSG_TYPE_SET_ATTR_RESP = 8,
MAX_RPMEM_MSG_TYPE,
};
/*
* rpmem_pool_attr_packed -- a packed version
*/
struct rpmem_pool_attr_packed {
char signature[RPMEM_POOL_HDR_SIG_LEN]; /* pool signature */
uint32_t major; /* format major version number */
uint32_t compat_features; /* mask: compatible "may" features */
uint32_t incompat_features; /* mask: "must support" features */
uint32_t ro_compat_features; /* mask: force RO if unsupported */
unsigned char poolset_uuid[RPMEM_POOL_HDR_UUID_LEN]; /* pool uuid */
unsigned char uuid[RPMEM_POOL_HDR_UUID_LEN]; /* first part uuid */
unsigned char next_uuid[RPMEM_POOL_HDR_UUID_LEN]; /* next pool uuid */
unsigned char prev_uuid[RPMEM_POOL_HDR_UUID_LEN]; /* prev pool uuid */
unsigned char user_flags[RPMEM_POOL_USER_FLAGS_LEN]; /* user flags */
} PACKED;
/*
* rpmem_msg_ibc_attr -- in-band connection attributes
*
* Used by create request response and open request response.
* Contains essential information to proceed with in-band connection
* initialization.
*/
struct rpmem_msg_ibc_attr {
uint32_t port; /* RDMA connection port */
uint32_t persist_method; /* persist method */
uint64_t rkey; /* remote key */
uint64_t raddr; /* remote address */
uint32_t nlanes; /* number of lanes */
} PACKED;
/*
* rpmem_msg_pool_desc -- remote pool descriptor
*/
struct rpmem_msg_pool_desc {
uint32_t size; /* size of pool descriptor */
uint8_t desc[0]; /* pool descriptor, null-terminated string */
} PACKED;
/*
* rpmem_msg_hdr -- message header which consists of type and size of message
*
* The type must be one of the rpmem_msg_type values.
*/
struct rpmem_msg_hdr {
uint32_t type; /* type of message */
uint64_t size; /* size of message */
uint8_t body[0];
} PACKED;
/*
* rpmem_msg_hdr_resp -- message response header which consists of type, size
* and status.
*
* The type must be one of the rpmem_msg_type values.
*/
struct rpmem_msg_hdr_resp {
uint32_t status; /* response status */
uint32_t type; /* type of message */
uint64_t size; /* size of message */
} PACKED;
/*
* rpmem_msg_common -- common fields for open/create messages
*/
struct rpmem_msg_common {
uint16_t major; /* protocol version major number */
uint16_t minor; /* protocol version minor number */
uint64_t pool_size; /* minimum required size of a pool */
uint32_t nlanes; /* number of lanes used by initiator */
uint32_t provider; /* provider */
uint64_t buff_size; /* buffer size for inline persist */
} PACKED;
/*
* rpmem_msg_create -- create request message
*
* The type of message must be set to RPMEM_MSG_TYPE_CREATE.
* The size of message must be set to
* sizeof(struct rpmem_msg_create) + pool_desc_size
*/
struct rpmem_msg_create {
struct rpmem_msg_hdr hdr; /* message header */
struct rpmem_msg_common c;
struct rpmem_pool_attr_packed pool_attr; /* pool attributes */
struct rpmem_msg_pool_desc pool_desc; /* pool descriptor */
} PACKED;
/*
* rpmem_msg_create_resp -- create request response message
*
* The type of message must be set to RPMEM_MSG_TYPE_CREATE_RESP.
* The size of message must be set to sizeof(struct rpmem_msg_create_resp).
*/
struct rpmem_msg_create_resp {
struct rpmem_msg_hdr_resp hdr; /* message header */
struct rpmem_msg_ibc_attr ibc; /* in-band connection attributes */
} PACKED;
/*
* rpmem_msg_open -- open request message
*
* The type of message must be set to RPMEM_MSG_TYPE_OPEN.
* The size of message must be set to
* sizeof(struct rpmem_msg_open) + pool_desc_size
*/
struct rpmem_msg_open {
struct rpmem_msg_hdr hdr; /* message header */
struct rpmem_msg_common c;
struct rpmem_msg_pool_desc pool_desc; /* pool descriptor */
} PACKED;
/*
* rpmem_msg_open_resp -- open request response message
*
* The type of message must be set to RPMEM_MSG_TYPE_OPEN_RESP.
* The size of message must be set to sizeof(struct rpmem_msg_open_resp)
*/
struct rpmem_msg_open_resp {
struct rpmem_msg_hdr_resp hdr; /* message header */
struct rpmem_msg_ibc_attr ibc; /* in-band connection attributes */
struct rpmem_pool_attr_packed pool_attr; /* pool attributes */
} PACKED;
/*
* rpmem_msg_close -- close request message
*
* The type of message must be set to RPMEM_MSG_TYPE_CLOSE
* The size of message must be set to sizeof(struct rpmem_msg_close)
*/
struct rpmem_msg_close {
struct rpmem_msg_hdr hdr; /* message header */
uint32_t flags; /* flags */
} PACKED;
/*
* rpmem_msg_close_resp -- close request response message
*
* The type of message must be set to RPMEM_MSG_TYPE_CLOSE_RESP
* The size of message must be set to sizeof(struct rpmem_msg_close_resp)
*/
struct rpmem_msg_close_resp {
struct rpmem_msg_hdr_resp hdr; /* message header */
/* no more fields */
} PACKED;
#define RPMEM_PERSIST_WRITE 0U /* persist using RDMA WRITE */
#define RPMEM_DEEP_PERSIST 1U /* deep persist operation */
#define RPMEM_PERSIST_SEND 2U /* persist using RDMA SEND */
#define RPMEM_PERSIST_MAX 2U /* maximum valid value */
/*
* the two least significant bits
* are reserved for mode of persist
*/
#define RPMEM_PERSIST_MASK 0x3U
/*
* rpmem_msg_persist -- remote persist message
*/
struct rpmem_msg_persist {
uint32_t flags; /* lane flags */
uint32_t lane; /* lane identifier */
uint64_t addr; /* remote memory address */
uint64_t size; /* remote memory size */
uint8_t data[];
};
/*
* rpmem_msg_persist_resp -- remote persist response message
*/
struct rpmem_msg_persist_resp {
uint32_t flags; /* lane flags */
uint32_t lane; /* lane identifier */
};
/*
* rpmem_msg_set_attr -- set attributes request message
*
* The type of message must be set to RPMEM_MSG_TYPE_SET_ATTR.
* The size of message must be set to sizeof(struct rpmem_msg_set_attr)
*/
struct rpmem_msg_set_attr {
struct rpmem_msg_hdr hdr; /* message header */
struct rpmem_pool_attr_packed pool_attr; /* pool attributes */
} PACKED;
/*
* rpmem_msg_set_attr_resp -- set attributes request response message
*
* The type of message must be set to RPMEM_MSG_TYPE_SET_ATTR_RESP.
* The size of message must be set to sizeof(struct rpmem_msg_set_attr_resp).
*/
struct rpmem_msg_set_attr_resp {
struct rpmem_msg_hdr_resp hdr; /* message header */
} PACKED;
/*
* XXX Begin: Suppress gcc conversion warnings for FreeBSD be*toh macros.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
/*
* rpmem_ntoh_msg_ibc_attr -- convert rpmem_msg_ibc attr to host byte order
*/
static inline void
rpmem_ntoh_msg_ibc_attr(struct rpmem_msg_ibc_attr *ibc)
{
ibc->port = be32toh(ibc->port);
ibc->persist_method = be32toh(ibc->persist_method);
ibc->rkey = be64toh(ibc->rkey);
ibc->raddr = be64toh(ibc->raddr);
}
/*
* rpmem_ntoh_msg_pool_desc -- convert rpmem_msg_pool_desc to host byte order
*/
static inline void
rpmem_ntoh_msg_pool_desc(struct rpmem_msg_pool_desc *pool_desc)
{
pool_desc->size = be32toh(pool_desc->size);
}
/*
* rpmem_ntoh_pool_attr -- convert rpmem_pool_attr to host byte order
*/
static inline void
rpmem_ntoh_pool_attr(struct rpmem_pool_attr_packed *attr)
{
attr->major = be32toh(attr->major);
attr->ro_compat_features = be32toh(attr->ro_compat_features);
attr->incompat_features = be32toh(attr->incompat_features);
attr->compat_features = be32toh(attr->compat_features);
}
/*
* rpmem_ntoh_msg_hdr -- convert rpmem_msg_hdr to host byte order
*/
static inline void
rpmem_ntoh_msg_hdr(struct rpmem_msg_hdr *hdrp)
{
hdrp->type = be32toh(hdrp->type);
hdrp->size = be64toh(hdrp->size);
}
/*
* rpmem_hton_msg_hdr -- convert rpmem_msg_hdr to network byte order
*/
static inline void
rpmem_hton_msg_hdr(struct rpmem_msg_hdr *hdrp)
{
rpmem_ntoh_msg_hdr(hdrp);
}
/*
* rpmem_ntoh_msg_hdr_resp -- convert rpmem_msg_hdr_resp to host byte order
*/
static inline void
rpmem_ntoh_msg_hdr_resp(struct rpmem_msg_hdr_resp *hdrp)
{
hdrp->status = be32toh(hdrp->status);
hdrp->type = be32toh(hdrp->type);
hdrp->size = be64toh(hdrp->size);
}
/*
* rpmem_hton_msg_hdr_resp -- convert rpmem_msg_hdr_resp to network byte order
*/
static inline void
rpmem_hton_msg_hdr_resp(struct rpmem_msg_hdr_resp *hdrp)
{
rpmem_ntoh_msg_hdr_resp(hdrp);
}
/*
* rpmem_ntoh_msg_common -- convert rpmem_msg_common to host byte order
*/
static inline void
rpmem_ntoh_msg_common(struct rpmem_msg_common *msg)
{
msg->major = be16toh(msg->major);
msg->minor = be16toh(msg->minor);
msg->pool_size = be64toh(msg->pool_size);
msg->nlanes = be32toh(msg->nlanes);
msg->provider = be32toh(msg->provider);
msg->buff_size = be64toh(msg->buff_size);
}
/*
* rpmem_hton_msg_common -- convert rpmem_msg_common to network byte order
*/
static inline void
rpmem_hton_msg_common(struct rpmem_msg_common *msg)
{
rpmem_ntoh_msg_common(msg);
}
/*
* rpmem_ntoh_msg_create -- convert rpmem_msg_create to host byte order
*/
static inline void
rpmem_ntoh_msg_create(struct rpmem_msg_create *msg)
{
rpmem_ntoh_msg_hdr(&msg->hdr);
rpmem_ntoh_msg_common(&msg->c);
rpmem_ntoh_pool_attr(&msg->pool_attr);
rpmem_ntoh_msg_pool_desc(&msg->pool_desc);
}
/*
* rpmem_hton_msg_create -- convert rpmem_msg_create to network byte order
*/
static inline void
rpmem_hton_msg_create(struct rpmem_msg_create *msg)
{
rpmem_ntoh_msg_create(msg);
}
/*
* rpmem_ntoh_msg_create_resp -- convert rpmem_msg_create_resp to host byte
* order
*/
static inline void
rpmem_ntoh_msg_create_resp(struct rpmem_msg_create_resp *msg)
{
rpmem_ntoh_msg_hdr_resp(&msg->hdr);
rpmem_ntoh_msg_ibc_attr(&msg->ibc);
}
/*
* rpmem_hton_msg_create_resp -- convert rpmem_msg_create_resp to network byte
* order
*/
static inline void
rpmem_hton_msg_create_resp(struct rpmem_msg_create_resp *msg)
{
rpmem_ntoh_msg_create_resp(msg);
}
/*
* rpmem_ntoh_msg_open -- convert rpmem_msg_open to host byte order
*/
static inline void
rpmem_ntoh_msg_open(struct rpmem_msg_open *msg)
{
rpmem_ntoh_msg_hdr(&msg->hdr);
rpmem_ntoh_msg_common(&msg->c);
rpmem_ntoh_msg_pool_desc(&msg->pool_desc);
}
/*
* XXX End: Suppress gcc conversion warnings for FreeBSD be*toh macros
*/
#pragma GCC diagnostic pop
/*
* rpmem_hton_msg_open -- convert rpmem_msg_open to network byte order
*/
static inline void
rpmem_hton_msg_open(struct rpmem_msg_open *msg)
{
rpmem_ntoh_msg_open(msg);
}
/*
* rpmem_ntoh_msg_open_resp -- convert rpmem_msg_open_resp to host byte order
*/
static inline void
rpmem_ntoh_msg_open_resp(struct rpmem_msg_open_resp *msg)
{
rpmem_ntoh_msg_hdr_resp(&msg->hdr);
rpmem_ntoh_msg_ibc_attr(&msg->ibc);
rpmem_ntoh_pool_attr(&msg->pool_attr);
}
/*
* rpmem_hton_msg_open_resp -- convert rpmem_msg_open_resp to network byte order
*/
static inline void
rpmem_hton_msg_open_resp(struct rpmem_msg_open_resp *msg)
{
rpmem_ntoh_msg_open_resp(msg);
}
/*
* rpmem_ntoh_msg_set_attr -- convert rpmem_msg_set_attr to host byte order
*/
static inline void
rpmem_ntoh_msg_set_attr(struct rpmem_msg_set_attr *msg)
{
rpmem_ntoh_msg_hdr(&msg->hdr);
rpmem_ntoh_pool_attr(&msg->pool_attr);
}
/*
* rpmem_hton_msg_set_attr -- convert rpmem_msg_set_attr to network byte order
*/
static inline void
rpmem_hton_msg_set_attr(struct rpmem_msg_set_attr *msg)
{
rpmem_ntoh_msg_set_attr(msg);
}
/*
* rpmem_ntoh_msg_set_attr_resp -- convert rpmem_msg_set_attr_resp to host byte
* order
*/
static inline void
rpmem_ntoh_msg_set_attr_resp(struct rpmem_msg_set_attr_resp *msg)
{
rpmem_ntoh_msg_hdr_resp(&msg->hdr);
}
/*
* rpmem_hton_msg_set_attr_resp -- convert rpmem_msg_set_attr_resp to network
* byte order
*/
static inline void
rpmem_hton_msg_set_attr_resp(struct rpmem_msg_set_attr_resp *msg)
{
rpmem_hton_msg_hdr_resp(&msg->hdr);
}
/*
* rpmem_ntoh_msg_close -- convert rpmem_msg_close to host byte order
*/
static inline void
rpmem_ntoh_msg_close(struct rpmem_msg_close *msg)
{
rpmem_ntoh_msg_hdr(&msg->hdr);
}
/*
* rpmem_hton_msg_close -- convert rpmem_msg_close to network byte order
*/
static inline void
rpmem_hton_msg_close(struct rpmem_msg_close *msg)
{
rpmem_ntoh_msg_close(msg);
}
/*
* rpmem_ntoh_msg_close_resp -- convert rpmem_msg_close_resp to host byte order
*/
static inline void
rpmem_ntoh_msg_close_resp(struct rpmem_msg_close_resp *msg)
{
rpmem_ntoh_msg_hdr_resp(&msg->hdr);
}
/*
* rpmem_hton_msg_close_resp -- convert rpmem_msg_close_resp to network byte
* order
*/
static inline void
rpmem_hton_msg_close_resp(struct rpmem_msg_close_resp *msg)
{
rpmem_ntoh_msg_close_resp(msg);
}
/*
* pack_rpmem_pool_attr -- copy pool attributes to a packed structure
*/
static inline void
pack_rpmem_pool_attr(const struct rpmem_pool_attr *src,
struct rpmem_pool_attr_packed *dst)
{
memcpy(dst->signature, src->signature, sizeof(src->signature));
dst->major = src->major;
dst->compat_features = src->compat_features;
dst->incompat_features = src->incompat_features;
dst->ro_compat_features = src->ro_compat_features;
memcpy(dst->poolset_uuid, src->poolset_uuid, sizeof(dst->poolset_uuid));
memcpy(dst->uuid, src->uuid, sizeof(dst->uuid));
memcpy(dst->next_uuid, src->next_uuid, sizeof(dst->next_uuid));
memcpy(dst->prev_uuid, src->prev_uuid, sizeof(dst->prev_uuid));
memcpy(dst->user_flags, src->user_flags, sizeof(dst->user_flags));
}
/*
* unpack_rpmem_pool_attr -- copy pool attributes to an unpacked structure
*/
static inline void
unpack_rpmem_pool_attr(const struct rpmem_pool_attr_packed *src,
struct rpmem_pool_attr *dst)
{
memcpy(dst->signature, src->signature, sizeof(src->signature));
dst->major = src->major;
dst->compat_features = src->compat_features;
dst->incompat_features = src->incompat_features;
dst->ro_compat_features = src->ro_compat_features;
memcpy(dst->poolset_uuid, src->poolset_uuid, sizeof(dst->poolset_uuid));
memcpy(dst->uuid, src->uuid, sizeof(dst->uuid));
memcpy(dst->next_uuid, src->next_uuid, sizeof(dst->next_uuid));
memcpy(dst->prev_uuid, src->prev_uuid, sizeof(dst->prev_uuid));
memcpy(dst->user_flags, src->user_flags, sizeof(dst->user_flags));
}
#ifdef __cplusplus
}
#endif
#endif
| 16,448 | 27.507799 | 80 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/rpmem_common/rpmem_fip_lane.h
|
/*
* Copyright 2016-2017, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* rpmem_fip_lane.h -- rpmem fabric provider lane definition
*/
#include <sched.h>
#include <stdint.h>
#include "sys_util.h"
/*
* rpmem_fip_lane -- basic lane structure
*
* This structure consist of a synchronization object and a return value.
* It is possible to wait on the lane for specified event. The event can be
* signalled by another thread which can pass the return value if required.
*
* The sync variable can store up to 64 different events, each event on
* separate bit.
*/
struct rpmem_fip_lane {
os_spinlock_t lock;
int ret;
uint64_t sync;
};
/*
* rpmem_fip_lane_init -- initialize basic lane structure
*/
static inline int
rpmem_fip_lane_init(struct rpmem_fip_lane *lanep)
{
lanep->ret = 0;
lanep->sync = 0;
return util_spin_init(&lanep->lock, PTHREAD_PROCESS_PRIVATE);
}
/*
* rpmem_fip_lane_fini -- deinitialize basic lane structure
*/
static inline void
rpmem_fip_lane_fini(struct rpmem_fip_lane *lanep)
{
util_spin_destroy(&lanep->lock);
}
/*
* rpmem_fip_lane_busy -- return true if lane has pending events
*/
static inline int
rpmem_fip_lane_busy(struct rpmem_fip_lane *lanep)
{
util_spin_lock(&lanep->lock);
int ret = lanep->sync != 0;
util_spin_unlock(&lanep->lock);
return ret;
}
/*
* rpmem_fip_lane_begin -- begin waiting for specified event(s)
*/
static inline void
rpmem_fip_lane_begin(struct rpmem_fip_lane *lanep, uint64_t sig)
{
util_spin_lock(&lanep->lock);
lanep->ret = 0;
lanep->sync |= sig;
util_spin_unlock(&lanep->lock);
}
static inline int
rpmem_fip_lane_is_busy(struct rpmem_fip_lane *lanep, uint64_t sig)
{
util_spin_lock(&lanep->lock);
int ret = (lanep->sync & sig) != 0;
util_spin_unlock(&lanep->lock);
return ret;
}
static inline int
rpmem_fip_lane_ret(struct rpmem_fip_lane *lanep)
{
util_spin_lock(&lanep->lock);
int ret = lanep->ret;
util_spin_unlock(&lanep->lock);
return ret;
}
/*
* rpmem_fip_lane_wait -- wait for specified event(s)
*/
static inline int
rpmem_fip_lane_wait(struct rpmem_fip_lane *lanep, uint64_t sig)
{
while (rpmem_fip_lane_is_busy(lanep, sig))
sched_yield();
return rpmem_fip_lane_ret(lanep);
}
/*
* rpmem_fip_lane_signal -- signal lane about specified event
*/
static inline void
rpmem_fip_lane_signal(struct rpmem_fip_lane *lanep, uint64_t sig)
{
util_spin_lock(&lanep->lock);
lanep->sync &= ~sig;
util_spin_unlock(&lanep->lock);
}
/*
* rpmem_fip_lane_signal -- signal lane about specified event and store
* return value
*/
static inline void
rpmem_fip_lane_sigret(struct rpmem_fip_lane *lanep, uint64_t sig, int ret)
{
util_spin_lock(&lanep->lock);
lanep->ret = ret;
lanep->sync &= ~sig;
util_spin_unlock(&lanep->lock);
}
| 4,269 | 26.197452 | 75 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/rpmem_common/rpmem_fip_msg.h
|
/*
* Copyright 2016-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* rpmem_fip_msg.h -- simple wrappers for fi_rma(3) and fi_msg(3) functions
*/
#ifndef RPMEM_FIP_MSG_H
#define RPMEM_FIP_MSG_H 1
#include <rdma/fi_rma.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* rpmem_fip_rma -- helper struct for RMA operation
*/
struct rpmem_fip_rma {
struct fi_msg_rma msg; /* message structure */
struct iovec msg_iov; /* IO vector buffer */
struct fi_rma_iov rma_iov; /* RMA IO vector buffer */
void *desc; /* local memory descriptor */
uint64_t flags; /* RMA operation flags */
};
/*
* rpmem_fip_msg -- helper struct for MSG operation
*/
struct rpmem_fip_msg {
struct fi_msg msg; /* message structure */
struct iovec iov; /* IO vector buffer */
void *desc; /* local memory descriptor */
uint64_t flags; /* MSG operation flags */
};
/*
* rpmem_fip_rma_init -- initialize RMA helper struct
*/
static inline void
rpmem_fip_rma_init(struct rpmem_fip_rma *rma, void *desc,
fi_addr_t addr, uint64_t rkey, void *context, uint64_t flags)
{
memset(rma, 0, sizeof(*rma));
rma->desc = desc;
rma->flags = flags;
rma->rma_iov.key = rkey;
rma->msg.context = context;
rma->msg.addr = addr;
rma->msg.desc = &rma->desc;
rma->msg.rma_iov = &rma->rma_iov;
rma->msg.rma_iov_count = 1;
rma->msg.msg_iov = &rma->msg_iov;
rma->msg.iov_count = 1;
}
/*
* rpmem_fip_msg_init -- initialize MSG helper struct
*/
static inline void
rpmem_fip_msg_init(struct rpmem_fip_msg *msg, void *desc, fi_addr_t addr,
void *context, void *buff, size_t len, uint64_t flags)
{
memset(msg, 0, sizeof(*msg));
msg->desc = desc;
msg->flags = flags;
msg->iov.iov_base = buff;
msg->iov.iov_len = len;
msg->msg.context = context;
msg->msg.addr = addr;
msg->msg.desc = &msg->desc;
msg->msg.msg_iov = &msg->iov;
msg->msg.iov_count = 1;
}
/*
* rpmem_fip_writemsg -- wrapper for fi_writemsg
*/
static inline int
rpmem_fip_writemsg(struct fid_ep *ep, struct rpmem_fip_rma *rma,
const void *buff, size_t len, uint64_t addr)
{
rma->rma_iov.addr = addr;
rma->rma_iov.len = len;
rma->msg_iov.iov_base = (void *)buff;
rma->msg_iov.iov_len = len;
return (int)fi_writemsg(ep, &rma->msg, rma->flags);
}
/*
* rpmem_fip_readmsg -- wrapper for fi_readmsg
*/
static inline int
rpmem_fip_readmsg(struct fid_ep *ep, struct rpmem_fip_rma *rma,
void *buff, size_t len, uint64_t addr)
{
rma->rma_iov.addr = addr;
rma->rma_iov.len = len;
rma->msg_iov.iov_base = buff;
rma->msg_iov.iov_len = len;
return (int)fi_readmsg(ep, &rma->msg, rma->flags);
}
/*
* rpmem_fip_sendmsg -- wrapper for fi_sendmsg
*/
static inline int
rpmem_fip_sendmsg(struct fid_ep *ep, struct rpmem_fip_msg *msg, size_t len)
{
msg->iov.iov_len = len;
return (int)fi_sendmsg(ep, &msg->msg, msg->flags);
}
/*
* rpmem_fip_recvmsg -- wrapper for fi_recvmsg
*/
static inline int
rpmem_fip_recvmsg(struct fid_ep *ep, struct rpmem_fip_msg *msg)
{
return (int)fi_recvmsg(ep, &msg->msg, msg->flags);
}
/*
* rpmem_fip_msg_get_pmsg -- returns message buffer as a persist message
*/
static inline struct rpmem_msg_persist *
rpmem_fip_msg_get_pmsg(struct rpmem_fip_msg *msg)
{
return (struct rpmem_msg_persist *)msg->iov.iov_base;
}
/*
* rpmem_fip_msg_get_pres -- returns message buffer as a persist response
*/
static inline struct rpmem_msg_persist_resp *
rpmem_fip_msg_get_pres(struct rpmem_fip_msg *msg)
{
return (struct rpmem_msg_persist_resp *)msg->iov.iov_base;
}
#ifdef __cplusplus
}
#endif
#endif
| 5,009 | 27.465909 | 75 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmempool/replica.h
|
/*
* Copyright 2016-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* replica.h -- module for synchronizing and transforming poolset
*/
#ifndef REPLICA_H
#define REPLICA_H
#include "libpmempool.h"
#include "pool.h"
#include "os_badblock.h"
#ifdef __cplusplus
extern "C" {
#endif
#define UNDEF_REPLICA UINT_MAX
#define UNDEF_PART UINT_MAX
/*
* A part marked as broken does not exist or is damaged so that
* it cannot be opened and has to be recreated.
*/
#define IS_BROKEN (1U << 0)
/*
* A replica marked as inconsistent exists but has inconsistent metadata
* (e.g. inconsistent parts or replicas linkage)
*/
#define IS_INCONSISTENT (1U << 1)
/*
* A part or replica marked in this way has bad blocks inside.
*/
#define HAS_BAD_BLOCKS (1U << 2)
/*
* A part marked in this way has bad blocks in the header
*/
#define HAS_CORRUPTED_HEADER (1U << 3)
/*
* A flag which can be passed to sync_replica() to indicate that the function is
* called by pmempool_transform
*/
#define IS_TRANSFORMED (1U << 10)
/*
* Number of lanes utilized when working with remote replicas
*/
#define REMOTE_NLANES 1
/*
* Helping structures for storing part's health status
*/
struct part_health_status {
unsigned flags;
struct badblocks bbs; /* structure with bad blocks */
char *recovery_file_name; /* name of bad block recovery file */
int recovery_file_exists; /* bad block recovery file exists */
};
/*
* Helping structures for storing replica and poolset's health status
*/
struct replica_health_status {
unsigned nparts;
unsigned nhdrs;
/* a flag for the replica */
unsigned flags;
/* effective size of a pool, valid only for healthy replica */
size_t pool_size;
/* flags for each part */
struct part_health_status part[];
};
struct poolset_health_status {
unsigned nreplicas;
/* a flag for the poolset */
unsigned flags;
/* health statuses for each replica */
struct replica_health_status *replica[];
};
/* get index of the (r)th replica health status */
static inline unsigned
REP_HEALTHidx(struct poolset_health_status *set, unsigned r)
{
ASSERTne(set->nreplicas, 0);
return (set->nreplicas + r) % set->nreplicas;
}
/* get index of the (r + 1)th replica health status */
static inline unsigned
REPN_HEALTHidx(struct poolset_health_status *set, unsigned r)
{
ASSERTne(set->nreplicas, 0);
return (set->nreplicas + r + 1) % set->nreplicas;
}
/* get (p)th part health status */
static inline unsigned
PART_HEALTHidx(struct replica_health_status *rep, unsigned p)
{
ASSERTne(rep->nparts, 0);
return (rep->nparts + p) % rep->nparts;
}
/* get (r)th replica health status */
static inline struct replica_health_status *
REP_HEALTH(struct poolset_health_status *set, unsigned r)
{
return set->replica[REP_HEALTHidx(set, r)];
}
/* get (p)th part health status */
static inline unsigned
PART_HEALTH(struct replica_health_status *rep, unsigned p)
{
return rep->part[PART_HEALTHidx(rep, p)].flags;
}
uint64_t replica_get_part_offset(struct pool_set *set,
unsigned repn, unsigned partn);
void replica_align_badblock_offset_length(size_t *offset, size_t *length,
struct pool_set *set_in, unsigned repn, unsigned partn);
size_t replica_get_part_data_len(struct pool_set *set_in, unsigned repn,
unsigned partn);
uint64_t replica_get_part_data_offset(struct pool_set *set_in, unsigned repn,
unsigned part);
/*
* is_dry_run -- (internal) check whether only verification mode is enabled
*/
static inline bool
is_dry_run(unsigned flags)
{
/*
* PMEMPOOL_SYNC_DRY_RUN and PMEMPOOL_TRANSFORM_DRY_RUN
* have to have the same value in order to use this common function.
*/
ASSERT_COMPILE_ERROR_ON(PMEMPOOL_SYNC_DRY_RUN !=
PMEMPOOL_TRANSFORM_DRY_RUN);
return flags & PMEMPOOL_SYNC_DRY_RUN;
}
/*
* fix_bad_blocks -- (internal) fix bad blocks - it causes reading or creating
* bad blocks recovery files
* (depending on if they exist or not)
*/
static inline bool
fix_bad_blocks(unsigned flags)
{
return flags & PMEMPOOL_SYNC_FIX_BAD_BLOCKS;
}
int replica_remove_all_recovery_files(struct poolset_health_status *set_hs);
int replica_remove_part(struct pool_set *set, unsigned repn, unsigned partn,
int fix_bad_blocks);
int replica_create_poolset_health_status(struct pool_set *set,
struct poolset_health_status **set_hsp);
void replica_free_poolset_health_status(struct poolset_health_status *set_s);
int replica_check_poolset_health(struct pool_set *set,
struct poolset_health_status **set_hs,
int called_from_sync, unsigned flags);
int replica_is_part_broken(unsigned repn, unsigned partn,
struct poolset_health_status *set_hs);
int replica_has_bad_blocks(unsigned repn, struct poolset_health_status *set_hs);
int replica_part_has_bad_blocks(struct part_health_status *phs);
int replica_part_has_corrupted_header(unsigned repn, unsigned partn,
struct poolset_health_status *set_hs);
unsigned replica_find_unbroken_part(unsigned repn,
struct poolset_health_status *set_hs);
int replica_is_replica_broken(unsigned repn,
struct poolset_health_status *set_hs);
int replica_is_replica_consistent(unsigned repn,
struct poolset_health_status *set_hs);
int replica_is_replica_healthy(unsigned repn,
struct poolset_health_status *set_hs);
unsigned replica_find_healthy_replica(
struct poolset_health_status *set_hs);
unsigned replica_find_replica_healthy_header(
struct poolset_health_status *set_hs);
int replica_is_poolset_healthy(struct poolset_health_status *set_hs);
int replica_is_poolset_transformed(unsigned flags);
ssize_t replica_get_pool_size(struct pool_set *set, unsigned repn);
int replica_check_part_sizes(struct pool_set *set, size_t min_size);
int replica_check_part_dirs(struct pool_set *set);
int replica_check_local_part_dir(struct pool_set *set, unsigned repn,
unsigned partn);
int replica_open_replica_part_files(struct pool_set *set, unsigned repn);
int replica_open_poolset_part_files(struct pool_set *set);
int replica_sync(struct pool_set *set_in, struct poolset_health_status *set_hs,
unsigned flags);
int replica_transform(struct pool_set *set_in, struct pool_set *set_out,
unsigned flags);
#ifdef __cplusplus
}
#endif
#endif
| 7,734 | 30.96281 | 80 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmempool/check.h
|
/*
* Copyright 2016-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* check.h -- internal definitions for logic performing check
*/
#ifndef CHECK_H
#define CHECK_H
#ifdef __cplusplus
extern "C" {
#endif
int check_init(PMEMpoolcheck *ppc);
struct check_status *check_step(PMEMpoolcheck *ppc);
void check_fini(PMEMpoolcheck *ppc);
int check_is_end(struct check_data *data);
struct pmempool_check_status *check_status_get(struct check_status *status);
#ifdef _WIN32
void convert_status_cache(PMEMpoolcheck *ppc, char *buf, size_t size);
#endif
#ifdef __cplusplus
}
#endif
#endif
| 2,122 | 34.383333 | 76 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmempool/check_util.h
|
/*
* Copyright 2016-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* check_util.h -- internal definitions check util
*/
#ifndef CHECK_UTIL_H
#define CHECK_UTIL_H
#include <time.h>
#include <limits.h>
#include <sys/param.h>
#ifdef __cplusplus
extern "C" {
#endif
#define CHECK_STEP_COMPLETE UINT_MAX
#define CHECK_INVALID_QUESTION UINT_MAX
#define REQUIRE_ADVANCED "the following error can be fixed using " \
"PMEMPOOL_CHECK_ADVANCED flag"
#ifndef min
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif
/* check control context */
struct check_data;
struct arena;
/* queue of check statuses */
struct check_status;
/* container storing state of all check steps */
#define PREFIX_MAX_SIZE 30
typedef struct {
unsigned init_done;
unsigned step;
unsigned replica;
unsigned part;
int single_repl;
int single_part;
struct pool_set *set;
int is_dev_dax;
struct pool_hdr *hdrp;
/* copy of the pool header in host byte order */
struct pool_hdr hdr;
int hdr_valid;
/*
* If pool header has been modified this field indicates that
* the pool parameters structure requires refresh.
*/
int pool_hdr_modified;
unsigned healthy_replicas;
struct pool_hdr *next_part_hdrp;
struct pool_hdr *prev_part_hdrp;
struct pool_hdr *next_repl_hdrp;
struct pool_hdr *prev_repl_hdrp;
int next_part_hdr_valid;
int prev_part_hdr_valid;
int next_repl_hdr_valid;
int prev_repl_hdr_valid;
/* valid poolset uuid */
uuid_t *valid_puuid;
/* valid part uuid */
uuid_t *valid_uuid;
/* valid part pool header */
struct pool_hdr *valid_part_hdrp;
int valid_part_done;
unsigned valid_part_replica;
char prefix[PREFIX_MAX_SIZE];
struct arena *arenap;
uint64_t offset;
uint32_t narena;
uint8_t *bitmap;
uint8_t *dup_bitmap;
uint8_t *fbitmap;
struct list *list_inval;
struct list *list_flog_inval;
struct list *list_unmap;
struct {
int btti_header;
int btti_backup;
} valid;
struct {
struct btt_info btti;
uint64_t btti_offset;
} pool_valid;
} location;
/* check steps */
void check_bad_blocks(PMEMpoolcheck *ppc);
void check_backup(PMEMpoolcheck *ppc);
void check_pool_hdr(PMEMpoolcheck *ppc);
void check_pool_hdr_uuids(PMEMpoolcheck *ppc);
void check_sds(PMEMpoolcheck *ppc);
void check_log(PMEMpoolcheck *ppc);
void check_blk(PMEMpoolcheck *ppc);
void check_cto(PMEMpoolcheck *ppc);
void check_btt_info(PMEMpoolcheck *ppc);
void check_btt_map_flog(PMEMpoolcheck *ppc);
void check_write(PMEMpoolcheck *ppc);
struct check_data *check_data_alloc(void);
void check_data_free(struct check_data *data);
uint32_t check_step_get(struct check_data *data);
void check_step_inc(struct check_data *data);
location *check_get_step_data(struct check_data *data);
void check_end(struct check_data *data);
int check_is_end_util(struct check_data *data);
int check_status_create(PMEMpoolcheck *ppc, enum pmempool_check_msg_type type,
uint32_t arg, const char *fmt, ...) FORMAT_PRINTF(4, 5);
void check_status_release(PMEMpoolcheck *ppc, struct check_status *status);
void check_clear_status_cache(struct check_data *data);
struct check_status *check_pop_question(struct check_data *data);
struct check_status *check_pop_error(struct check_data *data);
struct check_status *check_pop_info(struct check_data *data);
bool check_has_error(struct check_data *data);
bool check_has_answer(struct check_data *data);
int check_push_answer(PMEMpoolcheck *ppc);
struct pmempool_check_status *check_status_get_util(
struct check_status *status);
int check_status_is(struct check_status *status,
enum pmempool_check_msg_type type);
/* create info status */
#define CHECK_INFO(ppc, ...)\
check_status_create(ppc, PMEMPOOL_CHECK_MSG_TYPE_INFO, 0, __VA_ARGS__)
/* create info status and append error message based on errno */
#define CHECK_INFO_ERRNO(ppc, ...)\
check_status_create(ppc, PMEMPOOL_CHECK_MSG_TYPE_INFO,\
(uint32_t)errno, __VA_ARGS__)
/* create error status */
#define CHECK_ERR(ppc, ...)\
check_status_create(ppc, PMEMPOOL_CHECK_MSG_TYPE_ERROR, 0, __VA_ARGS__)
/* create question status */
#define CHECK_ASK(ppc, question, ...)\
check_status_create(ppc, PMEMPOOL_CHECK_MSG_TYPE_QUESTION, question,\
__VA_ARGS__)
#define CHECK_NOT_COMPLETE(loc, steps)\
((loc)->step != CHECK_STEP_COMPLETE &&\
((steps)[(loc)->step].check != NULL ||\
(steps)[(loc)->step].fix != NULL))
int check_answer_loop(PMEMpoolcheck *ppc, location *data,
void *ctx, int fail_on_no,
int (*callback)(PMEMpoolcheck *, location *, uint32_t, void *ctx));
int check_questions_sequence_validate(PMEMpoolcheck *ppc);
const char *check_get_time_str(time_t time);
const char *check_get_uuid_str(uuid_t uuid);
const char *check_get_pool_type_str(enum pool_type type);
void check_insert_arena(PMEMpoolcheck *ppc, struct arena *arenap);
#ifdef _WIN32
void cache_to_utf8(struct check_data *data, char *buf, size_t size);
#endif
#define CHECK_IS(ppc, flag)\
util_flag_isset((ppc)->args.flags, PMEMPOOL_CHECK_ ## flag)
#define CHECK_IS_NOT(ppc, flag)\
util_flag_isclr((ppc)->args.flags, PMEMPOOL_CHECK_ ## flag)
#define CHECK_WITHOUT_FIXING(ppc)\
CHECK_IS_NOT(ppc, REPAIR) || CHECK_IS(ppc, DRY_RUN)
#ifdef __cplusplus
}
#endif
#endif
| 6,694 | 28.493392 | 78 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmempool/pmempool.h
|
/*
* Copyright 2016-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* pmempool.h -- internal definitions for libpmempool
*/
#ifndef PMEMPOOL_H
#define PMEMPOOL_H
#ifdef __cplusplus
extern "C" {
#endif
#define PMEMPOOL_LOG_PREFIX "libpmempool"
#define PMEMPOOL_LOG_LEVEL_VAR "PMEMPOOL_LOG_LEVEL"
#define PMEMPOOL_LOG_FILE_VAR "PMEMPOOL_LOG_FILE"
enum check_result {
CHECK_RESULT_CONSISTENT,
CHECK_RESULT_NOT_CONSISTENT,
CHECK_RESULT_ASK_QUESTIONS,
CHECK_RESULT_PROCESS_ANSWERS,
CHECK_RESULT_REPAIRED,
CHECK_RESULT_CANNOT_REPAIR,
CHECK_RESULT_ERROR,
CHECK_RESULT_INTERNAL_ERROR
};
/*
* pmempool_check_ctx -- context and arguments for check command
*/
struct pmempool_check_ctx {
struct pmempool_check_args args;
char *path;
char *backup_path;
struct check_data *data;
struct pool_data *pool;
enum check_result result;
unsigned sync_required;
};
#ifdef __cplusplus
}
#endif
#endif
| 2,442 | 30.320513 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmempool/pool.h
|
/*
* Copyright 2016-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* pool.h -- internal definitions for pool processing functions
*/
#ifndef POOL_H
#define POOL_H
#include <stdbool.h>
#include <sys/types.h>
#include "libpmemobj.h"
#include "libpmemcto.h"
#include "queue.h"
#include "set.h"
#include "log.h"
#include "blk.h"
#include "btt_layout.h"
#include "cto.h"
#ifdef __cplusplus
extern "C" {
#endif
enum pool_type {
POOL_TYPE_UNKNOWN = (1 << 0),
POOL_TYPE_LOG = (1 << 1),
POOL_TYPE_BLK = (1 << 2),
POOL_TYPE_OBJ = (1 << 3),
POOL_TYPE_BTT = (1 << 4),
POOL_TYPE_CTO = (1 << 5),
POOL_TYPE_ANY = POOL_TYPE_UNKNOWN | POOL_TYPE_LOG |
POOL_TYPE_BLK | POOL_TYPE_OBJ | POOL_TYPE_BTT | POOL_TYPE_CTO,
};
struct pool_params {
enum pool_type type;
char signature[POOL_HDR_SIG_LEN];
features_t features;
size_t size;
mode_t mode;
int is_poolset;
int is_part;
int is_dev_dax;
int is_pmem;
union {
struct {
uint64_t bsize;
} blk;
struct {
char layout[PMEMOBJ_MAX_LAYOUT];
} obj;
struct {
char layout[PMEMCTO_MAX_LAYOUT];
} cto;
};
};
struct pool_set_file {
int fd;
char *fname;
void *addr;
size_t size;
struct pool_set *poolset;
time_t mtime;
mode_t mode;
};
struct arena {
TAILQ_ENTRY(arena) next;
struct btt_info btt_info;
uint32_t id;
bool valid;
bool zeroed;
uint64_t offset;
uint8_t *flog;
size_t flogsize;
uint32_t *map;
size_t mapsize;
};
struct pool_data {
struct pool_params params;
struct pool_set_file *set_file;
int blk_no_layout;
union {
struct pool_hdr pool;
struct pmemlog log;
struct pmemblk blk;
struct pmemcto cto;
} hdr;
enum {
UUID_NOP = 0,
UUID_FROM_BTT,
UUID_NOT_FROM_BTT,
} uuid_op;
struct arena bttc;
TAILQ_HEAD(arenashead, arena) arenas;
uint32_t narenas;
};
struct pool_data *pool_data_alloc(PMEMpoolcheck *ppc);
void pool_data_free(struct pool_data *pool);
void pool_params_from_header(struct pool_params *params,
const struct pool_hdr *hdr);
int pool_set_parse(struct pool_set **setp, const char *path);
void *pool_set_file_map(struct pool_set_file *file, uint64_t offset);
int pool_read(struct pool_data *pool, void *buff, size_t nbytes,
uint64_t off);
int pool_write(struct pool_data *pool, const void *buff, size_t nbytes,
uint64_t off);
int pool_copy(struct pool_data *pool, const char *dst_path, int overwrite);
int pool_set_part_copy(struct pool_set_part *dpart,
struct pool_set_part *spart, int overwrite);
int pool_memset(struct pool_data *pool, uint64_t off, int c, size_t count);
unsigned pool_set_files_count(struct pool_set_file *file);
int pool_set_file_map_headers(struct pool_set_file *file, int rdonly, int prv);
void pool_set_file_unmap_headers(struct pool_set_file *file);
void pool_hdr_default(enum pool_type type, struct pool_hdr *hdrp);
enum pool_type pool_hdr_get_type(const struct pool_hdr *hdrp);
enum pool_type pool_set_type(struct pool_set *set);
const char *pool_get_pool_type_str(enum pool_type type);
int pool_btt_info_valid(struct btt_info *infop);
int pool_blk_get_first_valid_arena(struct pool_data *pool,
struct arena *arenap);
int pool_blk_bsize_valid(uint32_t bsize, uint64_t fsize);
uint64_t pool_next_arena_offset(struct pool_data *pool, uint64_t header_offset);
uint64_t pool_get_first_valid_btt(struct pool_data *pool,
struct btt_info *infop, uint64_t offset, bool *zeroed);
size_t pool_get_min_size(enum pool_type);
#ifdef __cplusplus
}
#endif
#endif
| 4,963 | 27.365714 | 80 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/pmem.h
|
/*
* Copyright 2014-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* pmem.h -- internal definitions for libpmem
*/
#ifndef PMEM_H
#define PMEM_H
#include <stddef.h>
#include "libpmem.h"
#include "util.h"
#ifdef __cplusplus
extern "C" {
#endif
#define PMEM_LOG_PREFIX "libpmem"
#define PMEM_LOG_LEVEL_VAR "PMEM_LOG_LEVEL"
#define PMEM_LOG_FILE_VAR "PMEM_LOG_FILE"
typedef void (*predrain_fence_func)(void);
typedef void (*flush_func)(const void *, size_t);
typedef int (*is_pmem_func)(const void *addr, size_t len);
typedef void *(*memmove_nodrain_func)(void *pmemdest, const void *src,
size_t len, unsigned flags);
typedef void *(*memset_nodrain_func)(void *pmemdest, int c, size_t len,
unsigned flags);
struct pmem_funcs {
predrain_fence_func predrain_fence;
flush_func flush;
is_pmem_func is_pmem;
memmove_nodrain_func memmove_nodrain;
memset_nodrain_func memset_nodrain;
flush_func deep_flush;
};
void pmem_init(void);
void pmem_os_init(void);
void pmem_init_funcs(struct pmem_funcs *funcs);
int is_pmem_detect(const void *addr, size_t len);
void *pmem_map_register(int fd, size_t len, const char *path, int is_dev_dax);
/*
* flush_empty_nolog -- (internal) do not flush the CPU cache
*/
static force_inline void
flush_empty_nolog(const void *addr, size_t len)
{
/* NOP */
}
/*
* flush64b_empty -- (internal) do not flush the CPU cache
*/
static force_inline void
flush64b_empty(const char *addr)
{
}
/*
* pmem_flush_flags -- internal wrapper around pmem_flush
*/
static inline void
pmem_flush_flags(const void *addr, size_t len, unsigned flags)
{
if (!(flags & PMEM_F_MEM_NOFLUSH))
pmem_flush(addr, len);
}
void *memmove_nodrain_generic(void *pmemdest, const void *src, size_t len,
unsigned flags);
void *memset_nodrain_generic(void *pmemdest, int c, size_t len, unsigned flags);
#ifdef __cplusplus
}
#endif
#endif
| 3,394 | 29.585586 | 80 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/flush.h
|
/*
* Copyright 2014-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef X86_64_FLUSH_H
#define X86_64_FLUSH_H
#include <emmintrin.h>
#include <stddef.h>
#include <stdint.h>
#include "util.h"
#define FLUSH_ALIGN ((uintptr_t)64)
#ifdef _MSC_VER
#define pmem_clflushopt _mm_clflushopt
#define pmem_clwb _mm_clwb
#else
/*
* The x86 memory instructions are new enough that the compiler
* intrinsic functions are not always available. The intrinsic
* functions are defined here in terms of asm statements for now.
*/
#define pmem_clflushopt(addr)\
asm volatile(".byte 0x66; clflush %0" : "+m" \
(*(volatile char *)(addr)));
#define pmem_clwb(addr)\
asm volatile(".byte 0x66; xsaveopt %0" : "+m" \
(*(volatile char *)(addr)));
#endif /* _MSC_VER */
/*
* flush_clflush_nolog -- flush the CPU cache, using clflush
*/
static force_inline void
flush_clflush_nolog(const void *addr, size_t len)
{
uintptr_t uptr;
/*
* Loop through cache-line-size (typically 64B) aligned chunks
* covering the given range.
*/
for (uptr = (uintptr_t)addr & ~(FLUSH_ALIGN - 1);
uptr < (uintptr_t)addr + len; uptr += FLUSH_ALIGN)
_mm_clflush((char *)uptr);
}
/*
* flush_clflushopt_nolog -- flush the CPU cache, using clflushopt
*/
static force_inline void
flush_clflushopt_nolog(const void *addr, size_t len)
{
uintptr_t uptr;
/*
* Loop through cache-line-size (typically 64B) aligned chunks
* covering the given range.
*/
for (uptr = (uintptr_t)addr & ~(FLUSH_ALIGN - 1);
uptr < (uintptr_t)addr + len; uptr += FLUSH_ALIGN) {
pmem_clflushopt((char *)uptr);
}
}
/*
* flush_clwb_nolog -- flush the CPU cache, using clwb
*/
static force_inline void
flush_clwb_nolog(const void *addr, size_t len)
{
uintptr_t uptr;
/*
* Loop through cache-line-size (typically 64B) aligned chunks
* covering the given range.
*/
for (uptr = (uintptr_t)addr & ~(FLUSH_ALIGN - 1);
uptr < (uintptr_t)addr + len; uptr += FLUSH_ALIGN) {
pmem_clwb((char *)uptr);
}
}
#endif
| 3,520 | 29.885965 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/cpu.h
|
/*
* Copyright 2016-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PMDK_CPU_H
#define PMDK_CPU_H 1
/*
* cpu.h -- definitions for "cpu" module
*/
int is_cpu_genuine_intel(void);
int is_cpu_clflush_present(void);
int is_cpu_clflushopt_present(void);
int is_cpu_clwb_present(void);
int is_cpu_avx_present(void);
int is_cpu_avx512f_present(void);
#endif
| 1,898 | 38.5625 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/avx.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PMEM_AVX_H
#define PMEM_AVX_H
#include <immintrin.h>
#include "util.h"
/*
* avx_zeroupper -- _mm256_zeroupper wrapper
*
* _mm256_zeroupper clears upper parts of avx registers.
*
* It's needed for 2 reasons:
* - it improves performance of non-avx code after avx
* - it works around problem discovered by Valgrind
*
* In optimized builds gcc inserts VZEROUPPER automatically before
* calling non-avx code (or at the end of the function). But in release
* builds it doesn't, so if we don't do this by ourselves, then when
* someone memcpy'ies uninitialized data, Valgrind complains whenever
* someone reads those registers.
*
* One notable example is loader, which tries to detect whether it
* needs to save whole ymm registers by looking at their current
* (possibly uninitialized) value.
*
* Valgrind complains like that:
* Conditional jump or move depends on uninitialised value(s)
* at 0x4015CC9: _dl_runtime_resolve_avx_slow
* (in /lib/x86_64-linux-gnu/ld-2.24.so)
* by 0x10B531: test_realloc_api (obj_basic_integration.c:185)
* by 0x10F1EE: main (obj_basic_integration.c:594)
*
* Note: We have to be careful to not read AVX registers after this
* intrinsic, because of this stupid gcc bug:
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82735
*/
static force_inline void
avx_zeroupper(void)
{
_mm256_zeroupper();
}
static force_inline __m128i
m256_get16b(__m256i ymm)
{
return _mm256_extractf128_si256(ymm, 0);
}
#ifdef _MSC_VER
static force_inline uint64_t
m256_get8b(__m256i ymm)
{
return (uint64_t)_mm_extract_epi64(m256_get16b(ymm), 0);
}
static force_inline uint32_t
m256_get4b(__m256i ymm)
{
return (uint32_t)m256_get8b(ymm);
}
static force_inline uint16_t
m256_get2b(__m256i ymm)
{
return (uint16_t)m256_get8b(ymm);
}
#else
static force_inline uint64_t
m256_get8b(__m256i ymm)
{
return (uint64_t)_mm256_extract_epi64(ymm, 0);
}
static force_inline uint32_t
m256_get4b(__m256i ymm)
{
return (uint32_t)_mm256_extract_epi32(ymm, 0);
}
static force_inline uint16_t
m256_get2b(__m256i ymm)
{
return (uint16_t)_mm256_extract_epi16(ymm, 0);
}
#endif
#endif
| 3,753 | 31.362069 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memcpy_memset.h
|
/*
* Copyright 2014-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MEMCPY_MEMSET_H
#define MEMCPY_MEMSET_H
#include <stddef.h>
#include <xmmintrin.h>
#include "pmem.h"
static inline void
barrier_after_ntstores(void)
{
/*
* In this configuration pmem_drain does not contain sfence, so we have
* to serialize non-temporal store instructions.
*/
_mm_sfence();
}
static inline void
no_barrier_after_ntstores(void)
{
/*
* In this configuration pmem_drain contains sfence, so we don't have
* to serialize non-temporal store instructions
*/
}
#ifndef AVX512F_AVAILABLE
/* XXX not supported in MSVC version we currently use */
#ifdef _MSC_VER
#define AVX512F_AVAILABLE 0
#else
#define AVX512F_AVAILABLE 1
#endif
#endif
#ifndef AVX_AVAILABLE
#define AVX_AVAILABLE 1
#endif
#ifndef SSE2_AVAILABLE
#define SSE2_AVAILABLE 1
#endif
#if SSE2_AVAILABLE
void memmove_mov_sse2_clflush(char *dest, const char *src, size_t len);
void memmove_mov_sse2_clflushopt(char *dest, const char *src, size_t len);
void memmove_mov_sse2_clwb(char *dest, const char *src, size_t len);
void memmove_mov_sse2_empty(char *dest, const char *src, size_t len);
void memmove_movnt_sse2_clflush(char *dest, const char *src, size_t len);
void memmove_movnt_sse2_clflushopt(char *dest, const char *src, size_t len);
void memmove_movnt_sse2_clwb(char *dest, const char *src, size_t len);
void memmove_movnt_sse2_empty(char *dest, const char *src, size_t len);
void memset_mov_sse2_clflush(char *dest, int c, size_t len);
void memset_mov_sse2_clflushopt(char *dest, int c, size_t len);
void memset_mov_sse2_clwb(char *dest, int c, size_t len);
void memset_mov_sse2_empty(char *dest, int c, size_t len);
void memset_movnt_sse2_clflush(char *dest, int c, size_t len);
void memset_movnt_sse2_clflushopt(char *dest, int c, size_t len);
void memset_movnt_sse2_clwb(char *dest, int c, size_t len);
void memset_movnt_sse2_empty(char *dest, int c, size_t len);
#endif
#if AVX_AVAILABLE
void memmove_mov_avx_clflush(char *dest, const char *src, size_t len);
void memmove_mov_avx_clflushopt(char *dest, const char *src, size_t len);
void memmove_mov_avx_clwb(char *dest, const char *src, size_t len);
void memmove_mov_avx_empty(char *dest, const char *src, size_t len);
void memmove_movnt_avx_clflush(char *dest, const char *src, size_t len);
void memmove_movnt_avx_clflushopt(char *dest, const char *src, size_t len);
void memmove_movnt_avx_clwb(char *dest, const char *src, size_t len);
void memmove_movnt_avx_empty(char *dest, const char *src, size_t len);
void memset_mov_avx_clflush(char *dest, int c, size_t len);
void memset_mov_avx_clflushopt(char *dest, int c, size_t len);
void memset_mov_avx_clwb(char *dest, int c, size_t len);
void memset_mov_avx_empty(char *dest, int c, size_t len);
void memset_movnt_avx_clflush(char *dest, int c, size_t len);
void memset_movnt_avx_clflushopt(char *dest, int c, size_t len);
void memset_movnt_avx_clwb(char *dest, int c, size_t len);
void memset_movnt_avx_empty(char *dest, int c, size_t len);
#endif
#if AVX512F_AVAILABLE
void memmove_mov_avx512f_clflush(char *dest, const char *src, size_t len);
void memmove_mov_avx512f_clflushopt(char *dest, const char *src, size_t len);
void memmove_mov_avx512f_clwb(char *dest, const char *src, size_t len);
void memmove_mov_avx512f_empty(char *dest, const char *src, size_t len);
void memmove_movnt_avx512f_clflush(char *dest, const char *src, size_t len);
void memmove_movnt_avx512f_clflushopt(char *dest, const char *src, size_t len);
void memmove_movnt_avx512f_clwb(char *dest, const char *src, size_t len);
void memmove_movnt_avx512f_empty(char *dest, const char *src, size_t len);
void memset_mov_avx512f_clflush(char *dest, int c, size_t len);
void memset_mov_avx512f_clflushopt(char *dest, int c, size_t len);
void memset_mov_avx512f_clwb(char *dest, int c, size_t len);
void memset_mov_avx512f_empty(char *dest, int c, size_t len);
void memset_movnt_avx512f_clflush(char *dest, int c, size_t len);
void memset_movnt_avx512f_clflushopt(char *dest, int c, size_t len);
void memset_movnt_avx512f_clwb(char *dest, int c, size_t len);
void memset_movnt_avx512f_empty(char *dest, int c, size_t len);
#endif
extern size_t Movnt_threshold;
#endif
| 5,754 | 41.316176 | 79 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memset/memset_avx512f.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PMEM_MEMSET_AVX512F_H
#define PMEM_MEMSET_AVX512F_H
#include <stddef.h>
#include "memset_avx.h"
static force_inline void
memset_small_avx512f(char *dest, __m256i ymm, size_t len)
{
/* We can't do better than AVX here. */
memset_small_avx(dest, ymm, len);
}
#endif
| 1,880 | 38.1875 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memset/memset_nt_sse2.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <immintrin.h>
#include <stddef.h>
#include <stdint.h>
#include "pmem.h"
#include "flush.h"
#include "libpmem.h"
#include "memcpy_memset.h"
#include "memset_sse2.h"
#include "out.h"
#include "valgrind_internal.h"
static force_inline void
memset_movnt4x64b(char *dest, __m128i xmm)
{
_mm_stream_si128((__m128i *)dest + 0, xmm);
_mm_stream_si128((__m128i *)dest + 1, xmm);
_mm_stream_si128((__m128i *)dest + 2, xmm);
_mm_stream_si128((__m128i *)dest + 3, xmm);
_mm_stream_si128((__m128i *)dest + 4, xmm);
_mm_stream_si128((__m128i *)dest + 5, xmm);
_mm_stream_si128((__m128i *)dest + 6, xmm);
_mm_stream_si128((__m128i *)dest + 7, xmm);
_mm_stream_si128((__m128i *)dest + 8, xmm);
_mm_stream_si128((__m128i *)dest + 9, xmm);
_mm_stream_si128((__m128i *)dest + 10, xmm);
_mm_stream_si128((__m128i *)dest + 11, xmm);
_mm_stream_si128((__m128i *)dest + 12, xmm);
_mm_stream_si128((__m128i *)dest + 13, xmm);
_mm_stream_si128((__m128i *)dest + 14, xmm);
_mm_stream_si128((__m128i *)dest + 15, xmm);
VALGRIND_DO_FLUSH(dest, 4 * 64);
}
static force_inline void
memset_movnt2x64b(char *dest, __m128i xmm)
{
_mm_stream_si128((__m128i *)dest + 0, xmm);
_mm_stream_si128((__m128i *)dest + 1, xmm);
_mm_stream_si128((__m128i *)dest + 2, xmm);
_mm_stream_si128((__m128i *)dest + 3, xmm);
_mm_stream_si128((__m128i *)dest + 4, xmm);
_mm_stream_si128((__m128i *)dest + 5, xmm);
_mm_stream_si128((__m128i *)dest + 6, xmm);
_mm_stream_si128((__m128i *)dest + 7, xmm);
VALGRIND_DO_FLUSH(dest, 2 * 64);
}
static force_inline void
memset_movnt1x64b(char *dest, __m128i xmm)
{
_mm_stream_si128((__m128i *)dest + 0, xmm);
_mm_stream_si128((__m128i *)dest + 1, xmm);
_mm_stream_si128((__m128i *)dest + 2, xmm);
_mm_stream_si128((__m128i *)dest + 3, xmm);
VALGRIND_DO_FLUSH(dest, 64);
}
static force_inline void
memset_movnt1x32b(char *dest, __m128i xmm)
{
_mm_stream_si128((__m128i *)dest + 0, xmm);
_mm_stream_si128((__m128i *)dest + 1, xmm);
VALGRIND_DO_FLUSH(dest, 32);
}
static force_inline void
memset_movnt1x16b(char *dest, __m128i xmm)
{
_mm_stream_si128((__m128i *)dest, xmm);
VALGRIND_DO_FLUSH(dest, 16);
}
static force_inline void
memset_movnt1x8b(char *dest, __m128i xmm)
{
uint64_t x = (uint64_t)_mm_cvtsi128_si64(xmm);
_mm_stream_si64((long long *)dest, (long long)x);
VALGRIND_DO_FLUSH(dest, 8);
}
static force_inline void
memset_movnt1x4b(char *dest, __m128i xmm)
{
uint32_t x = (uint32_t)_mm_cvtsi128_si32(xmm);
_mm_stream_si32((int *)dest, (int)x);
VALGRIND_DO_FLUSH(dest, 4);
}
void
EXPORTED_SYMBOL(char *dest, int c, size_t len)
{
__m128i xmm = _mm_set1_epi8((char)c);
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
cnt = 64 - cnt;
if (cnt > len)
cnt = len;
memset_small_sse2(dest, xmm, cnt);
dest += cnt;
len -= cnt;
}
while (len >= 4 * 64) {
memset_movnt4x64b(dest, xmm);
dest += 4 * 64;
len -= 4 * 64;
}
if (len >= 2 * 64) {
memset_movnt2x64b(dest, xmm);
dest += 2 * 64;
len -= 2 * 64;
}
if (len >= 1 * 64) {
memset_movnt1x64b(dest, xmm);
dest += 1 * 64;
len -= 1 * 64;
}
if (len == 0)
goto end;
/* There's no point in using more than 1 nt store for 1 cache line. */
if (util_is_pow2(len)) {
if (len == 32)
memset_movnt1x32b(dest, xmm);
else if (len == 16)
memset_movnt1x16b(dest, xmm);
else if (len == 8)
memset_movnt1x8b(dest, xmm);
else if (len == 4)
memset_movnt1x4b(dest, xmm);
else
goto nonnt;
goto end;
}
nonnt:
memset_small_sse2(dest, xmm, len);
end:
maybe_barrier();
}
| 5,136 | 25.755208 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memset/memset_t_sse2.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <immintrin.h>
#include <stddef.h>
#include <stdint.h>
#include "pmem.h"
#include "flush.h"
#include "memcpy_memset.h"
#include "memset_sse2.h"
static force_inline void
memset_mov4x64b(char *dest, __m128i xmm)
{
_mm_store_si128((__m128i *)dest + 0, xmm);
_mm_store_si128((__m128i *)dest + 1, xmm);
_mm_store_si128((__m128i *)dest + 2, xmm);
_mm_store_si128((__m128i *)dest + 3, xmm);
_mm_store_si128((__m128i *)dest + 4, xmm);
_mm_store_si128((__m128i *)dest + 5, xmm);
_mm_store_si128((__m128i *)dest + 6, xmm);
_mm_store_si128((__m128i *)dest + 7, xmm);
_mm_store_si128((__m128i *)dest + 8, xmm);
_mm_store_si128((__m128i *)dest + 9, xmm);
_mm_store_si128((__m128i *)dest + 10, xmm);
_mm_store_si128((__m128i *)dest + 11, xmm);
_mm_store_si128((__m128i *)dest + 12, xmm);
_mm_store_si128((__m128i *)dest + 13, xmm);
_mm_store_si128((__m128i *)dest + 14, xmm);
_mm_store_si128((__m128i *)dest + 15, xmm);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
flush64b(dest + 2 * 64);
flush64b(dest + 3 * 64);
}
static force_inline void
memset_mov2x64b(char *dest, __m128i xmm)
{
_mm_store_si128((__m128i *)dest + 0, xmm);
_mm_store_si128((__m128i *)dest + 1, xmm);
_mm_store_si128((__m128i *)dest + 2, xmm);
_mm_store_si128((__m128i *)dest + 3, xmm);
_mm_store_si128((__m128i *)dest + 4, xmm);
_mm_store_si128((__m128i *)dest + 5, xmm);
_mm_store_si128((__m128i *)dest + 6, xmm);
_mm_store_si128((__m128i *)dest + 7, xmm);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
}
static force_inline void
memset_mov1x64b(char *dest, __m128i xmm)
{
_mm_store_si128((__m128i *)dest + 0, xmm);
_mm_store_si128((__m128i *)dest + 1, xmm);
_mm_store_si128((__m128i *)dest + 2, xmm);
_mm_store_si128((__m128i *)dest + 3, xmm);
flush64b(dest + 0 * 64);
}
void
EXPORTED_SYMBOL(char *dest, int c, size_t len)
{
__m128i xmm = _mm_set1_epi8((char)c);
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
cnt = 64 - cnt;
if (cnt > len)
cnt = len;
memset_small_sse2(dest, xmm, cnt);
dest += cnt;
len -= cnt;
}
while (len >= 4 * 64) {
memset_mov4x64b(dest, xmm);
dest += 4 * 64;
len -= 4 * 64;
}
if (len >= 2 * 64) {
memset_mov2x64b(dest, xmm);
dest += 2 * 64;
len -= 2 * 64;
}
if (len >= 1 * 64) {
memset_mov1x64b(dest, xmm);
dest += 1 * 64;
len -= 1 * 64;
}
if (len)
memset_small_sse2(dest, xmm, len);
}
| 3,985 | 28.525926 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memset/memset_nt_avx.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <immintrin.h>
#include <stddef.h>
#include <stdint.h>
#include "pmem.h"
#include "avx.h"
#include "flush.h"
#include "libpmem.h"
#include "memset_avx.h"
#include "memcpy_memset.h"
#include "out.h"
#include "valgrind_internal.h"
static force_inline void
memset_movnt8x64b(char *dest, __m256i ymm)
{
_mm256_stream_si256((__m256i *)dest + 0, ymm);
_mm256_stream_si256((__m256i *)dest + 1, ymm);
_mm256_stream_si256((__m256i *)dest + 2, ymm);
_mm256_stream_si256((__m256i *)dest + 3, ymm);
_mm256_stream_si256((__m256i *)dest + 4, ymm);
_mm256_stream_si256((__m256i *)dest + 5, ymm);
_mm256_stream_si256((__m256i *)dest + 6, ymm);
_mm256_stream_si256((__m256i *)dest + 7, ymm);
_mm256_stream_si256((__m256i *)dest + 8, ymm);
_mm256_stream_si256((__m256i *)dest + 9, ymm);
_mm256_stream_si256((__m256i *)dest + 10, ymm);
_mm256_stream_si256((__m256i *)dest + 11, ymm);
_mm256_stream_si256((__m256i *)dest + 12, ymm);
_mm256_stream_si256((__m256i *)dest + 13, ymm);
_mm256_stream_si256((__m256i *)dest + 14, ymm);
_mm256_stream_si256((__m256i *)dest + 15, ymm);
VALGRIND_DO_FLUSH(dest, 8 * 64);
}
static force_inline void
memset_movnt4x64b(char *dest, __m256i ymm)
{
_mm256_stream_si256((__m256i *)dest + 0, ymm);
_mm256_stream_si256((__m256i *)dest + 1, ymm);
_mm256_stream_si256((__m256i *)dest + 2, ymm);
_mm256_stream_si256((__m256i *)dest + 3, ymm);
_mm256_stream_si256((__m256i *)dest + 4, ymm);
_mm256_stream_si256((__m256i *)dest + 5, ymm);
_mm256_stream_si256((__m256i *)dest + 6, ymm);
_mm256_stream_si256((__m256i *)dest + 7, ymm);
VALGRIND_DO_FLUSH(dest, 4 * 64);
}
static force_inline void
memset_movnt2x64b(char *dest, __m256i ymm)
{
_mm256_stream_si256((__m256i *)dest + 0, ymm);
_mm256_stream_si256((__m256i *)dest + 1, ymm);
_mm256_stream_si256((__m256i *)dest + 2, ymm);
_mm256_stream_si256((__m256i *)dest + 3, ymm);
VALGRIND_DO_FLUSH(dest, 2 * 64);
}
static force_inline void
memset_movnt1x64b(char *dest, __m256i ymm)
{
_mm256_stream_si256((__m256i *)dest + 0, ymm);
_mm256_stream_si256((__m256i *)dest + 1, ymm);
VALGRIND_DO_FLUSH(dest, 64);
}
static force_inline void
memset_movnt1x32b(char *dest, __m256i ymm)
{
_mm256_stream_si256((__m256i *)dest, ymm);
VALGRIND_DO_FLUSH(dest, 32);
}
static force_inline void
memset_movnt1x16b(char *dest, __m256i ymm)
{
__m128i xmm0 = m256_get16b(ymm);
_mm_stream_si128((__m128i *)dest, xmm0);
VALGRIND_DO_FLUSH(dest - 16, 16);
}
static force_inline void
memset_movnt1x8b(char *dest, __m256i ymm)
{
uint64_t x = m256_get8b(ymm);
_mm_stream_si64((long long *)dest, (long long)x);
VALGRIND_DO_FLUSH(dest, 8);
}
static force_inline void
memset_movnt1x4b(char *dest, __m256i ymm)
{
uint32_t x = m256_get4b(ymm);
_mm_stream_si32((int *)dest, (int)x);
VALGRIND_DO_FLUSH(dest, 4);
}
void
EXPORTED_SYMBOL(char *dest, int c, size_t len)
{
__m256i ymm = _mm256_set1_epi8((char)c);
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
cnt = 64 - cnt;
if (cnt > len)
cnt = len;
memset_small_avx(dest, ymm, cnt);
dest += cnt;
len -= cnt;
}
while (len >= 8 * 64) {
memset_movnt8x64b(dest, ymm);
dest += 8 * 64;
len -= 8 * 64;
}
if (len >= 4 * 64) {
memset_movnt4x64b(dest, ymm);
dest += 4 * 64;
len -= 4 * 64;
}
if (len >= 2 * 64) {
memset_movnt2x64b(dest, ymm);
dest += 2 * 64;
len -= 2 * 64;
}
if (len >= 1 * 64) {
memset_movnt1x64b(dest, ymm);
dest += 1 * 64;
len -= 1 * 64;
}
if (len == 0)
goto end;
/* There's no point in using more than 1 nt store for 1 cache line. */
if (util_is_pow2(len)) {
if (len == 32)
memset_movnt1x32b(dest, ymm);
else if (len == 16)
memset_movnt1x16b(dest, ymm);
else if (len == 8)
memset_movnt1x8b(dest, ymm);
else if (len == 4)
memset_movnt1x4b(dest, ymm);
else
goto nonnt;
goto end;
}
nonnt:
memset_small_avx(dest, ymm, len);
end:
avx_zeroupper();
maybe_barrier();
}
| 5,514 | 25.137441 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memset/memset_avx.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PMEM_MEMSET_AVX_H
#define PMEM_MEMSET_AVX_H
#include <immintrin.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "avx.h"
#include "libpmem.h"
#include "out.h"
static force_inline void
memset_small_avx_noflush(char *dest, __m256i ymm, size_t len)
{
ASSERT(len <= 64);
if (len <= 8)
goto le8;
if (len <= 32)
goto le32;
/* 33..64 */
_mm256_storeu_si256((__m256i *)dest, ymm);
_mm256_storeu_si256((__m256i *)(dest + len - 32), ymm);
return;
le32:
if (len > 16) {
/* 17..32 */
__m128i xmm = m256_get16b(ymm);
_mm_storeu_si128((__m128i *)dest, xmm);
_mm_storeu_si128((__m128i *)(dest + len - 16), xmm);
return;
}
/* 9..16 */
uint64_t d8 = m256_get8b(ymm);
*(uint64_t *)dest = d8;
*(uint64_t *)(dest + len - 8) = d8;
return;
le8:
if (len <= 2)
goto le2;
if (len > 4) {
/* 5..8 */
uint32_t d = m256_get4b(ymm);
*(uint32_t *)dest = d;
*(uint32_t *)(dest + len - 4) = d;
return;
}
/* 3..4 */
uint16_t d2 = m256_get2b(ymm);
*(uint16_t *)dest = d2;
*(uint16_t *)(dest + len - 2) = d2;
return;
le2:
if (len == 2) {
uint16_t d2 = m256_get2b(ymm);
*(uint16_t *)dest = d2;
return;
}
*(uint8_t *)dest = (uint8_t)m256_get2b(ymm);
}
static force_inline void
memset_small_avx(char *dest, __m256i ymm, size_t len)
{
memset_small_avx_noflush(dest, ymm, len);
flush(dest, len);
}
#endif
| 2,975 | 24.655172 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memset/memset_t_avx.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <immintrin.h>
#include <stddef.h>
#include <stdint.h>
#include "pmem.h"
#include "avx.h"
#include "flush.h"
#include "memset_avx.h"
#include "memcpy_memset.h"
static force_inline void
memset_mov8x64b(char *dest, __m256i ymm)
{
_mm256_store_si256((__m256i *)dest + 0, ymm);
_mm256_store_si256((__m256i *)dest + 1, ymm);
_mm256_store_si256((__m256i *)dest + 2, ymm);
_mm256_store_si256((__m256i *)dest + 3, ymm);
_mm256_store_si256((__m256i *)dest + 4, ymm);
_mm256_store_si256((__m256i *)dest + 5, ymm);
_mm256_store_si256((__m256i *)dest + 6, ymm);
_mm256_store_si256((__m256i *)dest + 7, ymm);
_mm256_store_si256((__m256i *)dest + 8, ymm);
_mm256_store_si256((__m256i *)dest + 9, ymm);
_mm256_store_si256((__m256i *)dest + 10, ymm);
_mm256_store_si256((__m256i *)dest + 11, ymm);
_mm256_store_si256((__m256i *)dest + 12, ymm);
_mm256_store_si256((__m256i *)dest + 13, ymm);
_mm256_store_si256((__m256i *)dest + 14, ymm);
_mm256_store_si256((__m256i *)dest + 15, ymm);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
flush64b(dest + 2 * 64);
flush64b(dest + 3 * 64);
flush64b(dest + 4 * 64);
flush64b(dest + 5 * 64);
flush64b(dest + 6 * 64);
flush64b(dest + 7 * 64);
}
static force_inline void
memset_mov4x64b(char *dest, __m256i ymm)
{
_mm256_store_si256((__m256i *)dest + 0, ymm);
_mm256_store_si256((__m256i *)dest + 1, ymm);
_mm256_store_si256((__m256i *)dest + 2, ymm);
_mm256_store_si256((__m256i *)dest + 3, ymm);
_mm256_store_si256((__m256i *)dest + 4, ymm);
_mm256_store_si256((__m256i *)dest + 5, ymm);
_mm256_store_si256((__m256i *)dest + 6, ymm);
_mm256_store_si256((__m256i *)dest + 7, ymm);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
flush64b(dest + 2 * 64);
flush64b(dest + 3 * 64);
}
static force_inline void
memset_mov2x64b(char *dest, __m256i ymm)
{
_mm256_store_si256((__m256i *)dest + 0, ymm);
_mm256_store_si256((__m256i *)dest + 1, ymm);
_mm256_store_si256((__m256i *)dest + 2, ymm);
_mm256_store_si256((__m256i *)dest + 3, ymm);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
}
static force_inline void
memset_mov1x64b(char *dest, __m256i ymm)
{
_mm256_store_si256((__m256i *)dest + 0, ymm);
_mm256_store_si256((__m256i *)dest + 1, ymm);
flush64b(dest + 0 * 64);
}
void
EXPORTED_SYMBOL(char *dest, int c, size_t len)
{
__m256i ymm = _mm256_set1_epi8((char)c);
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
cnt = 64 - cnt;
if (cnt > len)
cnt = len;
memset_small_avx(dest, ymm, cnt);
dest += cnt;
len -= cnt;
}
while (len >= 8 * 64) {
memset_mov8x64b(dest, ymm);
dest += 8 * 64;
len -= 8 * 64;
}
if (len >= 4 * 64) {
memset_mov4x64b(dest, ymm);
dest += 4 * 64;
len -= 4 * 64;
}
if (len >= 2 * 64) {
memset_mov2x64b(dest, ymm);
dest += 2 * 64;
len -= 2 * 64;
}
if (len >= 1 * 64) {
memset_mov1x64b(dest, ymm);
dest += 1 * 64;
len -= 1 * 64;
}
if (len)
memset_small_avx(dest, ymm, len);
avx_zeroupper();
}
| 4,570 | 27.56875 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memset/memset_t_avx512f.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <immintrin.h>
#include <stddef.h>
#include <stdint.h>
#include "pmem.h"
#include "avx.h"
#include "flush.h"
#include "memset_avx512f.h"
#include "memcpy_memset.h"
static force_inline void
memset_mov32x64b(char *dest, __m512i zmm)
{
_mm512_store_si512((__m512i *)dest + 0, zmm);
_mm512_store_si512((__m512i *)dest + 1, zmm);
_mm512_store_si512((__m512i *)dest + 2, zmm);
_mm512_store_si512((__m512i *)dest + 3, zmm);
_mm512_store_si512((__m512i *)dest + 4, zmm);
_mm512_store_si512((__m512i *)dest + 5, zmm);
_mm512_store_si512((__m512i *)dest + 6, zmm);
_mm512_store_si512((__m512i *)dest + 7, zmm);
_mm512_store_si512((__m512i *)dest + 8, zmm);
_mm512_store_si512((__m512i *)dest + 9, zmm);
_mm512_store_si512((__m512i *)dest + 10, zmm);
_mm512_store_si512((__m512i *)dest + 11, zmm);
_mm512_store_si512((__m512i *)dest + 12, zmm);
_mm512_store_si512((__m512i *)dest + 13, zmm);
_mm512_store_si512((__m512i *)dest + 14, zmm);
_mm512_store_si512((__m512i *)dest + 15, zmm);
_mm512_store_si512((__m512i *)dest + 16, zmm);
_mm512_store_si512((__m512i *)dest + 17, zmm);
_mm512_store_si512((__m512i *)dest + 18, zmm);
_mm512_store_si512((__m512i *)dest + 19, zmm);
_mm512_store_si512((__m512i *)dest + 20, zmm);
_mm512_store_si512((__m512i *)dest + 21, zmm);
_mm512_store_si512((__m512i *)dest + 22, zmm);
_mm512_store_si512((__m512i *)dest + 23, zmm);
_mm512_store_si512((__m512i *)dest + 24, zmm);
_mm512_store_si512((__m512i *)dest + 25, zmm);
_mm512_store_si512((__m512i *)dest + 26, zmm);
_mm512_store_si512((__m512i *)dest + 27, zmm);
_mm512_store_si512((__m512i *)dest + 28, zmm);
_mm512_store_si512((__m512i *)dest + 29, zmm);
_mm512_store_si512((__m512i *)dest + 30, zmm);
_mm512_store_si512((__m512i *)dest + 31, zmm);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
flush64b(dest + 2 * 64);
flush64b(dest + 3 * 64);
flush64b(dest + 4 * 64);
flush64b(dest + 5 * 64);
flush64b(dest + 6 * 64);
flush64b(dest + 7 * 64);
flush64b(dest + 8 * 64);
flush64b(dest + 9 * 64);
flush64b(dest + 10 * 64);
flush64b(dest + 11 * 64);
flush64b(dest + 12 * 64);
flush64b(dest + 13 * 64);
flush64b(dest + 14 * 64);
flush64b(dest + 15 * 64);
flush64b(dest + 16 * 64);
flush64b(dest + 17 * 64);
flush64b(dest + 18 * 64);
flush64b(dest + 19 * 64);
flush64b(dest + 20 * 64);
flush64b(dest + 21 * 64);
flush64b(dest + 22 * 64);
flush64b(dest + 23 * 64);
flush64b(dest + 24 * 64);
flush64b(dest + 25 * 64);
flush64b(dest + 26 * 64);
flush64b(dest + 27 * 64);
flush64b(dest + 28 * 64);
flush64b(dest + 29 * 64);
flush64b(dest + 30 * 64);
flush64b(dest + 31 * 64);
}
static force_inline void
memset_mov16x64b(char *dest, __m512i zmm)
{
_mm512_store_si512((__m512i *)dest + 0, zmm);
_mm512_store_si512((__m512i *)dest + 1, zmm);
_mm512_store_si512((__m512i *)dest + 2, zmm);
_mm512_store_si512((__m512i *)dest + 3, zmm);
_mm512_store_si512((__m512i *)dest + 4, zmm);
_mm512_store_si512((__m512i *)dest + 5, zmm);
_mm512_store_si512((__m512i *)dest + 6, zmm);
_mm512_store_si512((__m512i *)dest + 7, zmm);
_mm512_store_si512((__m512i *)dest + 8, zmm);
_mm512_store_si512((__m512i *)dest + 9, zmm);
_mm512_store_si512((__m512i *)dest + 10, zmm);
_mm512_store_si512((__m512i *)dest + 11, zmm);
_mm512_store_si512((__m512i *)dest + 12, zmm);
_mm512_store_si512((__m512i *)dest + 13, zmm);
_mm512_store_si512((__m512i *)dest + 14, zmm);
_mm512_store_si512((__m512i *)dest + 15, zmm);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
flush64b(dest + 2 * 64);
flush64b(dest + 3 * 64);
flush64b(dest + 4 * 64);
flush64b(dest + 5 * 64);
flush64b(dest + 6 * 64);
flush64b(dest + 7 * 64);
flush64b(dest + 8 * 64);
flush64b(dest + 9 * 64);
flush64b(dest + 10 * 64);
flush64b(dest + 11 * 64);
flush64b(dest + 12 * 64);
flush64b(dest + 13 * 64);
flush64b(dest + 14 * 64);
flush64b(dest + 15 * 64);
}
static force_inline void
memset_mov8x64b(char *dest, __m512i zmm)
{
_mm512_store_si512((__m512i *)dest + 0, zmm);
_mm512_store_si512((__m512i *)dest + 1, zmm);
_mm512_store_si512((__m512i *)dest + 2, zmm);
_mm512_store_si512((__m512i *)dest + 3, zmm);
_mm512_store_si512((__m512i *)dest + 4, zmm);
_mm512_store_si512((__m512i *)dest + 5, zmm);
_mm512_store_si512((__m512i *)dest + 6, zmm);
_mm512_store_si512((__m512i *)dest + 7, zmm);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
flush64b(dest + 2 * 64);
flush64b(dest + 3 * 64);
flush64b(dest + 4 * 64);
flush64b(dest + 5 * 64);
flush64b(dest + 6 * 64);
flush64b(dest + 7 * 64);
}
static force_inline void
memset_mov4x64b(char *dest, __m512i zmm)
{
_mm512_store_si512((__m512i *)dest + 0, zmm);
_mm512_store_si512((__m512i *)dest + 1, zmm);
_mm512_store_si512((__m512i *)dest + 2, zmm);
_mm512_store_si512((__m512i *)dest + 3, zmm);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
flush64b(dest + 2 * 64);
flush64b(dest + 3 * 64);
}
static force_inline void
memset_mov2x64b(char *dest, __m512i zmm)
{
_mm512_store_si512((__m512i *)dest + 0, zmm);
_mm512_store_si512((__m512i *)dest + 1, zmm);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
}
static force_inline void
memset_mov1x64b(char *dest, __m512i zmm)
{
_mm512_store_si512((__m512i *)dest + 0, zmm);
flush64b(dest + 0 * 64);
}
void
EXPORTED_SYMBOL(char *dest, int c, size_t len)
{
__m512i zmm = _mm512_set1_epi8((char)c);
/* See comment in memset_movnt_avx512f */
__m256i ymm = _mm256_set1_epi8((char)c);
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
cnt = 64 - cnt;
if (cnt > len)
cnt = len;
memset_small_avx512f(dest, ymm, cnt);
dest += cnt;
len -= cnt;
}
while (len >= 32 * 64) {
memset_mov32x64b(dest, zmm);
dest += 32 * 64;
len -= 32 * 64;
}
if (len >= 16 * 64) {
memset_mov16x64b(dest, zmm);
dest += 16 * 64;
len -= 16 * 64;
}
if (len >= 8 * 64) {
memset_mov8x64b(dest, zmm);
dest += 8 * 64;
len -= 8 * 64;
}
if (len >= 4 * 64) {
memset_mov4x64b(dest, zmm);
dest += 4 * 64;
len -= 4 * 64;
}
if (len >= 2 * 64) {
memset_mov2x64b(dest, zmm);
dest += 2 * 64;
len -= 2 * 64;
}
if (len >= 1 * 64) {
memset_mov1x64b(dest, zmm);
dest += 1 * 64;
len -= 1 * 64;
}
if (len)
memset_small_avx512f(dest, ymm, len);
avx_zeroupper();
}
| 7,852 | 28.411985 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memset/memset_sse2.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PMEM_MEMSET_SSE2_H
#define PMEM_MEMSET_SSE2_H
#include <xmmintrin.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "libpmem.h"
#include "out.h"
static force_inline void
memset_small_sse2_noflush(char *dest, __m128i xmm, size_t len)
{
ASSERT(len <= 64);
if (len <= 8)
goto le8;
if (len <= 32)
goto le32;
if (len > 48) {
/* 49..64 */
_mm_storeu_si128((__m128i *)(dest + 0), xmm);
_mm_storeu_si128((__m128i *)(dest + 16), xmm);
_mm_storeu_si128((__m128i *)(dest + 32), xmm);
_mm_storeu_si128((__m128i *)(dest + len - 16), xmm);
return;
}
/* 33..48 */
_mm_storeu_si128((__m128i *)(dest + 0), xmm);
_mm_storeu_si128((__m128i *)(dest + 16), xmm);
_mm_storeu_si128((__m128i *)(dest + len - 16), xmm);
return;
le32:
if (len > 16) {
/* 17..32 */
_mm_storeu_si128((__m128i *)(dest + 0), xmm);
_mm_storeu_si128((__m128i *)(dest + len - 16), xmm);
return;
}
/* 9..16 */
uint64_t d8 = (uint64_t)_mm_cvtsi128_si64(xmm);
*(uint64_t *)dest = d8;
*(uint64_t *)(dest + len - 8) = d8;
return;
le8:
if (len <= 2)
goto le2;
if (len > 4) {
/* 5..8 */
uint32_t d4 = (uint32_t)_mm_cvtsi128_si32(xmm);
*(uint32_t *)dest = d4;
*(uint32_t *)(dest + len - 4) = d4;
return;
}
/* 3..4 */
uint16_t d2 = (uint16_t)(uint32_t)_mm_cvtsi128_si32(xmm);
*(uint16_t *)dest = d2;
*(uint16_t *)(dest + len - 2) = d2;
return;
le2:
if (len == 2) {
uint16_t d2 = (uint16_t)(uint32_t)_mm_cvtsi128_si32(xmm);
*(uint16_t *)dest = d2;
return;
}
*(uint8_t *)dest = (uint8_t)_mm_cvtsi128_si32(xmm);
}
static force_inline void
memset_small_sse2(char *dest, __m128i xmm, size_t len)
{
memset_small_sse2_noflush(dest, xmm, len);
flush(dest, len);
}
#endif
| 3,327 | 26.056911 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memset/memset_nt_avx512f.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <immintrin.h>
#include <stddef.h>
#include <stdint.h>
#include "pmem.h"
#include "avx.h"
#include "flush.h"
#include "libpmem.h"
#include "memcpy_memset.h"
#include "memset_avx512f.h"
#include "out.h"
#include "util.h"
#include "valgrind_internal.h"
static force_inline void
memset_movnt32x64b(char *dest, __m512i zmm)
{
_mm512_stream_si512((__m512i *)dest + 0, zmm);
_mm512_stream_si512((__m512i *)dest + 1, zmm);
_mm512_stream_si512((__m512i *)dest + 2, zmm);
_mm512_stream_si512((__m512i *)dest + 3, zmm);
_mm512_stream_si512((__m512i *)dest + 4, zmm);
_mm512_stream_si512((__m512i *)dest + 5, zmm);
_mm512_stream_si512((__m512i *)dest + 6, zmm);
_mm512_stream_si512((__m512i *)dest + 7, zmm);
_mm512_stream_si512((__m512i *)dest + 8, zmm);
_mm512_stream_si512((__m512i *)dest + 9, zmm);
_mm512_stream_si512((__m512i *)dest + 10, zmm);
_mm512_stream_si512((__m512i *)dest + 11, zmm);
_mm512_stream_si512((__m512i *)dest + 12, zmm);
_mm512_stream_si512((__m512i *)dest + 13, zmm);
_mm512_stream_si512((__m512i *)dest + 14, zmm);
_mm512_stream_si512((__m512i *)dest + 15, zmm);
_mm512_stream_si512((__m512i *)dest + 16, zmm);
_mm512_stream_si512((__m512i *)dest + 17, zmm);
_mm512_stream_si512((__m512i *)dest + 18, zmm);
_mm512_stream_si512((__m512i *)dest + 19, zmm);
_mm512_stream_si512((__m512i *)dest + 20, zmm);
_mm512_stream_si512((__m512i *)dest + 21, zmm);
_mm512_stream_si512((__m512i *)dest + 22, zmm);
_mm512_stream_si512((__m512i *)dest + 23, zmm);
_mm512_stream_si512((__m512i *)dest + 24, zmm);
_mm512_stream_si512((__m512i *)dest + 25, zmm);
_mm512_stream_si512((__m512i *)dest + 26, zmm);
_mm512_stream_si512((__m512i *)dest + 27, zmm);
_mm512_stream_si512((__m512i *)dest + 28, zmm);
_mm512_stream_si512((__m512i *)dest + 29, zmm);
_mm512_stream_si512((__m512i *)dest + 30, zmm);
_mm512_stream_si512((__m512i *)dest + 31, zmm);
VALGRIND_DO_FLUSH(dest, 32 * 64);
}
static force_inline void
memset_movnt16x64b(char *dest, __m512i zmm)
{
_mm512_stream_si512((__m512i *)dest + 0, zmm);
_mm512_stream_si512((__m512i *)dest + 1, zmm);
_mm512_stream_si512((__m512i *)dest + 2, zmm);
_mm512_stream_si512((__m512i *)dest + 3, zmm);
_mm512_stream_si512((__m512i *)dest + 4, zmm);
_mm512_stream_si512((__m512i *)dest + 5, zmm);
_mm512_stream_si512((__m512i *)dest + 6, zmm);
_mm512_stream_si512((__m512i *)dest + 7, zmm);
_mm512_stream_si512((__m512i *)dest + 8, zmm);
_mm512_stream_si512((__m512i *)dest + 9, zmm);
_mm512_stream_si512((__m512i *)dest + 10, zmm);
_mm512_stream_si512((__m512i *)dest + 11, zmm);
_mm512_stream_si512((__m512i *)dest + 12, zmm);
_mm512_stream_si512((__m512i *)dest + 13, zmm);
_mm512_stream_si512((__m512i *)dest + 14, zmm);
_mm512_stream_si512((__m512i *)dest + 15, zmm);
VALGRIND_DO_FLUSH(dest, 16 * 64);
}
static force_inline void
memset_movnt8x64b(char *dest, __m512i zmm)
{
_mm512_stream_si512((__m512i *)dest + 0, zmm);
_mm512_stream_si512((__m512i *)dest + 1, zmm);
_mm512_stream_si512((__m512i *)dest + 2, zmm);
_mm512_stream_si512((__m512i *)dest + 3, zmm);
_mm512_stream_si512((__m512i *)dest + 4, zmm);
_mm512_stream_si512((__m512i *)dest + 5, zmm);
_mm512_stream_si512((__m512i *)dest + 6, zmm);
_mm512_stream_si512((__m512i *)dest + 7, zmm);
VALGRIND_DO_FLUSH(dest, 8 * 64);
}
static force_inline void
memset_movnt4x64b(char *dest, __m512i zmm)
{
_mm512_stream_si512((__m512i *)dest + 0, zmm);
_mm512_stream_si512((__m512i *)dest + 1, zmm);
_mm512_stream_si512((__m512i *)dest + 2, zmm);
_mm512_stream_si512((__m512i *)dest + 3, zmm);
VALGRIND_DO_FLUSH(dest, 4 * 64);
}
static force_inline void
memset_movnt2x64b(char *dest, __m512i zmm)
{
_mm512_stream_si512((__m512i *)dest + 0, zmm);
_mm512_stream_si512((__m512i *)dest + 1, zmm);
VALGRIND_DO_FLUSH(dest, 2 * 64);
}
static force_inline void
memset_movnt1x64b(char *dest, __m512i zmm)
{
_mm512_stream_si512((__m512i *)dest + 0, zmm);
VALGRIND_DO_FLUSH(dest, 64);
}
static force_inline void
memset_movnt1x32b(char *dest, __m256i ymm)
{
_mm256_stream_si256((__m256i *)dest, ymm);
VALGRIND_DO_FLUSH(dest, 32);
}
static force_inline void
memset_movnt1x16b(char *dest, __m256i ymm)
{
__m128i xmm = _mm256_extracti128_si256(ymm, 0);
_mm_stream_si128((__m128i *)dest, xmm);
VALGRIND_DO_FLUSH(dest, 16);
}
static force_inline void
memset_movnt1x8b(char *dest, __m256i ymm)
{
uint64_t x = m256_get8b(ymm);
_mm_stream_si64((long long *)dest, (long long)x);
VALGRIND_DO_FLUSH(dest, 8);
}
static force_inline void
memset_movnt1x4b(char *dest, __m256i ymm)
{
uint32_t x = m256_get4b(ymm);
_mm_stream_si32((int *)dest, (int)x);
VALGRIND_DO_FLUSH(dest, 4);
}
void
EXPORTED_SYMBOL(char *dest, int c, size_t len)
{
__m512i zmm = _mm512_set1_epi8((char)c);
/*
* Can't use _mm512_extracti64x4_epi64, because some versions of gcc
* crash. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887
*/
__m256i ymm = _mm256_set1_epi8((char)c);
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
cnt = 64 - cnt;
if (cnt > len)
cnt = len;
memset_small_avx512f(dest, ymm, cnt);
dest += cnt;
len -= cnt;
}
while (len >= 32 * 64) {
memset_movnt32x64b(dest, zmm);
dest += 32 * 64;
len -= 32 * 64;
}
if (len >= 16 * 64) {
memset_movnt16x64b(dest, zmm);
dest += 16 * 64;
len -= 16 * 64;
}
if (len >= 8 * 64) {
memset_movnt8x64b(dest, zmm);
dest += 8 * 64;
len -= 8 * 64;
}
if (len >= 4 * 64) {
memset_movnt4x64b(dest, zmm);
dest += 4 * 64;
len -= 4 * 64;
}
if (len >= 2 * 64) {
memset_movnt2x64b(dest, zmm);
dest += 2 * 64;
len -= 2 * 64;
}
if (len >= 1 * 64) {
memset_movnt1x64b(dest, zmm);
dest += 1 * 64;
len -= 1 * 64;
}
if (len == 0)
goto end;
/* There's no point in using more than 1 nt store for 1 cache line. */
if (util_is_pow2(len)) {
if (len == 32)
memset_movnt1x32b(dest, ymm);
else if (len == 16)
memset_movnt1x16b(dest, ymm);
else if (len == 8)
memset_movnt1x8b(dest, ymm);
else if (len == 4)
memset_movnt1x4b(dest, ymm);
else
goto nonnt;
goto end;
}
nonnt:
memset_small_avx512f(dest, ymm, len);
end:
avx_zeroupper();
maybe_barrier();
}
| 7,756 | 27.105072 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memcpy/memcpy_avx.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PMEM_MEMCPY_AVX_H
#define PMEM_MEMCPY_AVX_H
#include <immintrin.h>
#include <stddef.h>
#include <stdint.h>
#include "libpmem.h"
#include "out.h"
static force_inline void
memmove_small_avx_noflush(char *dest, const char *src, size_t len)
{
ASSERT(len <= 64);
if (len <= 8)
goto le8;
if (len <= 32)
goto le32;
/* 33..64 */
__m256i ymm0 = _mm256_loadu_si256((__m256i *)src);
__m256i ymm1 = _mm256_loadu_si256((__m256i *)(src + len - 32));
_mm256_storeu_si256((__m256i *)dest, ymm0);
_mm256_storeu_si256((__m256i *)(dest + len - 32), ymm1);
return;
le32:
if (len > 16) {
/* 17..32 */
__m128i xmm0 = _mm_loadu_si128((__m128i *)src);
__m128i xmm1 = _mm_loadu_si128((__m128i *)(src + len - 16));
_mm_storeu_si128((__m128i *)dest, xmm0);
_mm_storeu_si128((__m128i *)(dest + len - 16), xmm1);
return;
}
/* 9..16 */
uint64_t d80 = *(uint64_t *)src;
uint64_t d81 = *(uint64_t *)(src + len - 8);
*(uint64_t *)dest = d80;
*(uint64_t *)(dest + len - 8) = d81;
return;
le8:
if (len <= 2)
goto le2;
if (len > 4) {
/* 5..8 */
uint32_t d40 = *(uint32_t *)src;
uint32_t d41 = *(uint32_t *)(src + len - 4);
*(uint32_t *)dest = d40;
*(uint32_t *)(dest + len - 4) = d41;
return;
}
/* 3..4 */
uint16_t d20 = *(uint16_t *)src;
uint16_t d21 = *(uint16_t *)(src + len - 2);
*(uint16_t *)dest = d20;
*(uint16_t *)(dest + len - 2) = d21;
return;
le2:
if (len == 2) {
*(uint16_t *)dest = *(uint16_t *)src;
return;
}
*(uint8_t *)dest = *(uint8_t *)src;
}
static force_inline void
memmove_small_avx(char *dest, const char *src, size_t len)
{
memmove_small_avx_noflush(dest, src, len);
flush(dest, len);
}
#endif
| 3,275 | 26.529412 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memcpy/memcpy_sse2.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PMEM_MEMCPY_SSE2_H
#define PMEM_MEMCPY_SSE2_H
#include <xmmintrin.h>
#include <stddef.h>
#include <stdint.h>
#include "libpmem.h"
#include "out.h"
static force_inline void
memmove_small_sse2_noflush(char *dest, const char *src, size_t len)
{
ASSERT(len <= 64);
if (len <= 8)
goto le8;
if (len <= 32)
goto le32;
if (len > 48) {
/* 49..64 */
__m128i xmm0 = _mm_loadu_si128((__m128i *)src);
__m128i xmm1 = _mm_loadu_si128((__m128i *)(src + 16));
__m128i xmm2 = _mm_loadu_si128((__m128i *)(src + 32));
__m128i xmm3 = _mm_loadu_si128((__m128i *)(src + len - 16));
_mm_storeu_si128((__m128i *)dest, xmm0);
_mm_storeu_si128((__m128i *)(dest + 16), xmm1);
_mm_storeu_si128((__m128i *)(dest + 32), xmm2);
_mm_storeu_si128((__m128i *)(dest + len - 16), xmm3);
return;
}
/* 33..48 */
__m128i xmm0 = _mm_loadu_si128((__m128i *)src);
__m128i xmm1 = _mm_loadu_si128((__m128i *)(src + 16));
__m128i xmm2 = _mm_loadu_si128((__m128i *)(src + len - 16));
_mm_storeu_si128((__m128i *)dest, xmm0);
_mm_storeu_si128((__m128i *)(dest + 16), xmm1);
_mm_storeu_si128((__m128i *)(dest + len - 16), xmm2);
return;
le32:
if (len > 16) {
/* 17..32 */
__m128i xmm0 = _mm_loadu_si128((__m128i *)src);
__m128i xmm1 = _mm_loadu_si128((__m128i *)(src + len - 16));
_mm_storeu_si128((__m128i *)dest, xmm0);
_mm_storeu_si128((__m128i *)(dest + len - 16), xmm1);
return;
}
/* 9..16 */
uint64_t d80 = *(uint64_t *)src;
uint64_t d81 = *(uint64_t *)(src + len - 8);
*(uint64_t *)dest = d80;
*(uint64_t *)(dest + len - 8) = d81;
return;
le8:
if (len <= 2)
goto le2;
if (len > 4) {
/* 5..8 */
uint32_t d40 = *(uint32_t *)src;
uint32_t d41 = *(uint32_t *)(src + len - 4);
*(uint32_t *)dest = d40;
*(uint32_t *)(dest + len - 4) = d41;
return;
}
/* 3..4 */
uint16_t d20 = *(uint16_t *)src;
uint16_t d21 = *(uint16_t *)(src + len - 2);
*(uint16_t *)dest = d20;
*(uint16_t *)(dest + len - 2) = d21;
return;
le2:
if (len == 2) {
*(uint16_t *)dest = *(uint16_t *)src;
return;
}
*(uint8_t *)dest = *(uint8_t *)src;
}
static force_inline void
memmove_small_sse2(char *dest, const char *src, size_t len)
{
memmove_small_sse2_noflush(dest, src, len);
flush(dest, len);
}
#endif
| 3,846 | 27.496296 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memcpy/memcpy_t_sse2.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <immintrin.h>
#include <stddef.h>
#include <stdint.h>
#include "pmem.h"
#include "flush.h"
#include "memcpy_memset.h"
#include "memcpy_sse2.h"
static force_inline void
memmove_mov4x64b(char *dest, const char *src)
{
__m128i xmm0 = _mm_loadu_si128((__m128i *)src + 0);
__m128i xmm1 = _mm_loadu_si128((__m128i *)src + 1);
__m128i xmm2 = _mm_loadu_si128((__m128i *)src + 2);
__m128i xmm3 = _mm_loadu_si128((__m128i *)src + 3);
__m128i xmm4 = _mm_loadu_si128((__m128i *)src + 4);
__m128i xmm5 = _mm_loadu_si128((__m128i *)src + 5);
__m128i xmm6 = _mm_loadu_si128((__m128i *)src + 6);
__m128i xmm7 = _mm_loadu_si128((__m128i *)src + 7);
__m128i xmm8 = _mm_loadu_si128((__m128i *)src + 8);
__m128i xmm9 = _mm_loadu_si128((__m128i *)src + 9);
__m128i xmm10 = _mm_loadu_si128((__m128i *)src + 10);
__m128i xmm11 = _mm_loadu_si128((__m128i *)src + 11);
__m128i xmm12 = _mm_loadu_si128((__m128i *)src + 12);
__m128i xmm13 = _mm_loadu_si128((__m128i *)src + 13);
__m128i xmm14 = _mm_loadu_si128((__m128i *)src + 14);
__m128i xmm15 = _mm_loadu_si128((__m128i *)src + 15);
_mm_store_si128((__m128i *)dest + 0, xmm0);
_mm_store_si128((__m128i *)dest + 1, xmm1);
_mm_store_si128((__m128i *)dest + 2, xmm2);
_mm_store_si128((__m128i *)dest + 3, xmm3);
_mm_store_si128((__m128i *)dest + 4, xmm4);
_mm_store_si128((__m128i *)dest + 5, xmm5);
_mm_store_si128((__m128i *)dest + 6, xmm6);
_mm_store_si128((__m128i *)dest + 7, xmm7);
_mm_store_si128((__m128i *)dest + 8, xmm8);
_mm_store_si128((__m128i *)dest + 9, xmm9);
_mm_store_si128((__m128i *)dest + 10, xmm10);
_mm_store_si128((__m128i *)dest + 11, xmm11);
_mm_store_si128((__m128i *)dest + 12, xmm12);
_mm_store_si128((__m128i *)dest + 13, xmm13);
_mm_store_si128((__m128i *)dest + 14, xmm14);
_mm_store_si128((__m128i *)dest + 15, xmm15);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
flush64b(dest + 2 * 64);
flush64b(dest + 3 * 64);
}
static force_inline void
memmove_mov2x64b(char *dest, const char *src)
{
__m128i xmm0 = _mm_loadu_si128((__m128i *)src + 0);
__m128i xmm1 = _mm_loadu_si128((__m128i *)src + 1);
__m128i xmm2 = _mm_loadu_si128((__m128i *)src + 2);
__m128i xmm3 = _mm_loadu_si128((__m128i *)src + 3);
__m128i xmm4 = _mm_loadu_si128((__m128i *)src + 4);
__m128i xmm5 = _mm_loadu_si128((__m128i *)src + 5);
__m128i xmm6 = _mm_loadu_si128((__m128i *)src + 6);
__m128i xmm7 = _mm_loadu_si128((__m128i *)src + 7);
_mm_store_si128((__m128i *)dest + 0, xmm0);
_mm_store_si128((__m128i *)dest + 1, xmm1);
_mm_store_si128((__m128i *)dest + 2, xmm2);
_mm_store_si128((__m128i *)dest + 3, xmm3);
_mm_store_si128((__m128i *)dest + 4, xmm4);
_mm_store_si128((__m128i *)dest + 5, xmm5);
_mm_store_si128((__m128i *)dest + 6, xmm6);
_mm_store_si128((__m128i *)dest + 7, xmm7);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
}
static force_inline void
memmove_mov1x64b(char *dest, const char *src)
{
__m128i xmm0 = _mm_loadu_si128((__m128i *)src + 0);
__m128i xmm1 = _mm_loadu_si128((__m128i *)src + 1);
__m128i xmm2 = _mm_loadu_si128((__m128i *)src + 2);
__m128i xmm3 = _mm_loadu_si128((__m128i *)src + 3);
_mm_store_si128((__m128i *)dest + 0, xmm0);
_mm_store_si128((__m128i *)dest + 1, xmm1);
_mm_store_si128((__m128i *)dest + 2, xmm2);
_mm_store_si128((__m128i *)dest + 3, xmm3);
flush64b(dest + 0 * 64);
}
static force_inline void
memmove_mov_sse_fw(char *dest, const char *src, size_t len)
{
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
cnt = 64 - cnt;
if (cnt > len)
cnt = len;
memmove_small_sse2(dest, src, cnt);
dest += cnt;
src += cnt;
len -= cnt;
}
while (len >= 4 * 64) {
memmove_mov4x64b(dest, src);
dest += 4 * 64;
src += 4 * 64;
len -= 4 * 64;
}
if (len >= 2 * 64) {
memmove_mov2x64b(dest, src);
dest += 2 * 64;
src += 2 * 64;
len -= 2 * 64;
}
if (len >= 1 * 64) {
memmove_mov1x64b(dest, src);
dest += 1 * 64;
src += 1 * 64;
len -= 1 * 64;
}
if (len)
memmove_small_sse2(dest, src, len);
}
static force_inline void
memmove_mov_sse_bw(char *dest, const char *src, size_t len)
{
dest += len;
src += len;
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
if (cnt > len)
cnt = len;
dest -= cnt;
src -= cnt;
len -= cnt;
memmove_small_sse2(dest, src, cnt);
}
while (len >= 4 * 64) {
dest -= 4 * 64;
src -= 4 * 64;
len -= 4 * 64;
memmove_mov4x64b(dest, src);
}
if (len >= 2 * 64) {
dest -= 2 * 64;
src -= 2 * 64;
len -= 2 * 64;
memmove_mov2x64b(dest, src);
}
if (len >= 1 * 64) {
dest -= 1 * 64;
src -= 1 * 64;
len -= 1 * 64;
memmove_mov1x64b(dest, src);
}
if (len)
memmove_small_sse2(dest - len, src - len, len);
}
void
EXPORTED_SYMBOL(char *dest, const char *src, size_t len)
{
if ((uintptr_t)dest - (uintptr_t)src >= len)
memmove_mov_sse_fw(dest, src, len);
else
memmove_mov_sse_bw(dest, src, len);
}
| 6,467 | 28.534247 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memcpy/memcpy_t_avx512f.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <immintrin.h>
#include <stddef.h>
#include <stdint.h>
#include "pmem.h"
#include "avx.h"
#include "flush.h"
#include "memcpy_avx512f.h"
#include "memcpy_memset.h"
static force_inline void
memmove_mov32x64b(char *dest, const char *src)
{
__m512i zmm0 = _mm512_loadu_si512((__m512i *)src + 0);
__m512i zmm1 = _mm512_loadu_si512((__m512i *)src + 1);
__m512i zmm2 = _mm512_loadu_si512((__m512i *)src + 2);
__m512i zmm3 = _mm512_loadu_si512((__m512i *)src + 3);
__m512i zmm4 = _mm512_loadu_si512((__m512i *)src + 4);
__m512i zmm5 = _mm512_loadu_si512((__m512i *)src + 5);
__m512i zmm6 = _mm512_loadu_si512((__m512i *)src + 6);
__m512i zmm7 = _mm512_loadu_si512((__m512i *)src + 7);
__m512i zmm8 = _mm512_loadu_si512((__m512i *)src + 8);
__m512i zmm9 = _mm512_loadu_si512((__m512i *)src + 9);
__m512i zmm10 = _mm512_loadu_si512((__m512i *)src + 10);
__m512i zmm11 = _mm512_loadu_si512((__m512i *)src + 11);
__m512i zmm12 = _mm512_loadu_si512((__m512i *)src + 12);
__m512i zmm13 = _mm512_loadu_si512((__m512i *)src + 13);
__m512i zmm14 = _mm512_loadu_si512((__m512i *)src + 14);
__m512i zmm15 = _mm512_loadu_si512((__m512i *)src + 15);
__m512i zmm16 = _mm512_loadu_si512((__m512i *)src + 16);
__m512i zmm17 = _mm512_loadu_si512((__m512i *)src + 17);
__m512i zmm18 = _mm512_loadu_si512((__m512i *)src + 18);
__m512i zmm19 = _mm512_loadu_si512((__m512i *)src + 19);
__m512i zmm20 = _mm512_loadu_si512((__m512i *)src + 20);
__m512i zmm21 = _mm512_loadu_si512((__m512i *)src + 21);
__m512i zmm22 = _mm512_loadu_si512((__m512i *)src + 22);
__m512i zmm23 = _mm512_loadu_si512((__m512i *)src + 23);
__m512i zmm24 = _mm512_loadu_si512((__m512i *)src + 24);
__m512i zmm25 = _mm512_loadu_si512((__m512i *)src + 25);
__m512i zmm26 = _mm512_loadu_si512((__m512i *)src + 26);
__m512i zmm27 = _mm512_loadu_si512((__m512i *)src + 27);
__m512i zmm28 = _mm512_loadu_si512((__m512i *)src + 28);
__m512i zmm29 = _mm512_loadu_si512((__m512i *)src + 29);
__m512i zmm30 = _mm512_loadu_si512((__m512i *)src + 30);
__m512i zmm31 = _mm512_loadu_si512((__m512i *)src + 31);
_mm512_store_si512((__m512i *)dest + 0, zmm0);
_mm512_store_si512((__m512i *)dest + 1, zmm1);
_mm512_store_si512((__m512i *)dest + 2, zmm2);
_mm512_store_si512((__m512i *)dest + 3, zmm3);
_mm512_store_si512((__m512i *)dest + 4, zmm4);
_mm512_store_si512((__m512i *)dest + 5, zmm5);
_mm512_store_si512((__m512i *)dest + 6, zmm6);
_mm512_store_si512((__m512i *)dest + 7, zmm7);
_mm512_store_si512((__m512i *)dest + 8, zmm8);
_mm512_store_si512((__m512i *)dest + 9, zmm9);
_mm512_store_si512((__m512i *)dest + 10, zmm10);
_mm512_store_si512((__m512i *)dest + 11, zmm11);
_mm512_store_si512((__m512i *)dest + 12, zmm12);
_mm512_store_si512((__m512i *)dest + 13, zmm13);
_mm512_store_si512((__m512i *)dest + 14, zmm14);
_mm512_store_si512((__m512i *)dest + 15, zmm15);
_mm512_store_si512((__m512i *)dest + 16, zmm16);
_mm512_store_si512((__m512i *)dest + 17, zmm17);
_mm512_store_si512((__m512i *)dest + 18, zmm18);
_mm512_store_si512((__m512i *)dest + 19, zmm19);
_mm512_store_si512((__m512i *)dest + 20, zmm20);
_mm512_store_si512((__m512i *)dest + 21, zmm21);
_mm512_store_si512((__m512i *)dest + 22, zmm22);
_mm512_store_si512((__m512i *)dest + 23, zmm23);
_mm512_store_si512((__m512i *)dest + 24, zmm24);
_mm512_store_si512((__m512i *)dest + 25, zmm25);
_mm512_store_si512((__m512i *)dest + 26, zmm26);
_mm512_store_si512((__m512i *)dest + 27, zmm27);
_mm512_store_si512((__m512i *)dest + 28, zmm28);
_mm512_store_si512((__m512i *)dest + 29, zmm29);
_mm512_store_si512((__m512i *)dest + 30, zmm30);
_mm512_store_si512((__m512i *)dest + 31, zmm31);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
flush64b(dest + 2 * 64);
flush64b(dest + 3 * 64);
flush64b(dest + 4 * 64);
flush64b(dest + 5 * 64);
flush64b(dest + 6 * 64);
flush64b(dest + 7 * 64);
flush64b(dest + 8 * 64);
flush64b(dest + 9 * 64);
flush64b(dest + 10 * 64);
flush64b(dest + 11 * 64);
flush64b(dest + 12 * 64);
flush64b(dest + 13 * 64);
flush64b(dest + 14 * 64);
flush64b(dest + 15 * 64);
flush64b(dest + 16 * 64);
flush64b(dest + 17 * 64);
flush64b(dest + 18 * 64);
flush64b(dest + 19 * 64);
flush64b(dest + 20 * 64);
flush64b(dest + 21 * 64);
flush64b(dest + 22 * 64);
flush64b(dest + 23 * 64);
flush64b(dest + 24 * 64);
flush64b(dest + 25 * 64);
flush64b(dest + 26 * 64);
flush64b(dest + 27 * 64);
flush64b(dest + 28 * 64);
flush64b(dest + 29 * 64);
flush64b(dest + 30 * 64);
flush64b(dest + 31 * 64);
}
static force_inline void
memmove_mov16x64b(char *dest, const char *src)
{
__m512i zmm0 = _mm512_loadu_si512((__m512i *)src + 0);
__m512i zmm1 = _mm512_loadu_si512((__m512i *)src + 1);
__m512i zmm2 = _mm512_loadu_si512((__m512i *)src + 2);
__m512i zmm3 = _mm512_loadu_si512((__m512i *)src + 3);
__m512i zmm4 = _mm512_loadu_si512((__m512i *)src + 4);
__m512i zmm5 = _mm512_loadu_si512((__m512i *)src + 5);
__m512i zmm6 = _mm512_loadu_si512((__m512i *)src + 6);
__m512i zmm7 = _mm512_loadu_si512((__m512i *)src + 7);
__m512i zmm8 = _mm512_loadu_si512((__m512i *)src + 8);
__m512i zmm9 = _mm512_loadu_si512((__m512i *)src + 9);
__m512i zmm10 = _mm512_loadu_si512((__m512i *)src + 10);
__m512i zmm11 = _mm512_loadu_si512((__m512i *)src + 11);
__m512i zmm12 = _mm512_loadu_si512((__m512i *)src + 12);
__m512i zmm13 = _mm512_loadu_si512((__m512i *)src + 13);
__m512i zmm14 = _mm512_loadu_si512((__m512i *)src + 14);
__m512i zmm15 = _mm512_loadu_si512((__m512i *)src + 15);
_mm512_store_si512((__m512i *)dest + 0, zmm0);
_mm512_store_si512((__m512i *)dest + 1, zmm1);
_mm512_store_si512((__m512i *)dest + 2, zmm2);
_mm512_store_si512((__m512i *)dest + 3, zmm3);
_mm512_store_si512((__m512i *)dest + 4, zmm4);
_mm512_store_si512((__m512i *)dest + 5, zmm5);
_mm512_store_si512((__m512i *)dest + 6, zmm6);
_mm512_store_si512((__m512i *)dest + 7, zmm7);
_mm512_store_si512((__m512i *)dest + 8, zmm8);
_mm512_store_si512((__m512i *)dest + 9, zmm9);
_mm512_store_si512((__m512i *)dest + 10, zmm10);
_mm512_store_si512((__m512i *)dest + 11, zmm11);
_mm512_store_si512((__m512i *)dest + 12, zmm12);
_mm512_store_si512((__m512i *)dest + 13, zmm13);
_mm512_store_si512((__m512i *)dest + 14, zmm14);
_mm512_store_si512((__m512i *)dest + 15, zmm15);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
flush64b(dest + 2 * 64);
flush64b(dest + 3 * 64);
flush64b(dest + 4 * 64);
flush64b(dest + 5 * 64);
flush64b(dest + 6 * 64);
flush64b(dest + 7 * 64);
flush64b(dest + 8 * 64);
flush64b(dest + 9 * 64);
flush64b(dest + 10 * 64);
flush64b(dest + 11 * 64);
flush64b(dest + 12 * 64);
flush64b(dest + 13 * 64);
flush64b(dest + 14 * 64);
flush64b(dest + 15 * 64);
}
static force_inline void
memmove_mov8x64b(char *dest, const char *src)
{
__m512i zmm0 = _mm512_loadu_si512((__m512i *)src + 0);
__m512i zmm1 = _mm512_loadu_si512((__m512i *)src + 1);
__m512i zmm2 = _mm512_loadu_si512((__m512i *)src + 2);
__m512i zmm3 = _mm512_loadu_si512((__m512i *)src + 3);
__m512i zmm4 = _mm512_loadu_si512((__m512i *)src + 4);
__m512i zmm5 = _mm512_loadu_si512((__m512i *)src + 5);
__m512i zmm6 = _mm512_loadu_si512((__m512i *)src + 6);
__m512i zmm7 = _mm512_loadu_si512((__m512i *)src + 7);
_mm512_store_si512((__m512i *)dest + 0, zmm0);
_mm512_store_si512((__m512i *)dest + 1, zmm1);
_mm512_store_si512((__m512i *)dest + 2, zmm2);
_mm512_store_si512((__m512i *)dest + 3, zmm3);
_mm512_store_si512((__m512i *)dest + 4, zmm4);
_mm512_store_si512((__m512i *)dest + 5, zmm5);
_mm512_store_si512((__m512i *)dest + 6, zmm6);
_mm512_store_si512((__m512i *)dest + 7, zmm7);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
flush64b(dest + 2 * 64);
flush64b(dest + 3 * 64);
flush64b(dest + 4 * 64);
flush64b(dest + 5 * 64);
flush64b(dest + 6 * 64);
flush64b(dest + 7 * 64);
}
static force_inline void
memmove_mov4x64b(char *dest, const char *src)
{
__m512i zmm0 = _mm512_loadu_si512((__m512i *)src + 0);
__m512i zmm1 = _mm512_loadu_si512((__m512i *)src + 1);
__m512i zmm2 = _mm512_loadu_si512((__m512i *)src + 2);
__m512i zmm3 = _mm512_loadu_si512((__m512i *)src + 3);
_mm512_store_si512((__m512i *)dest + 0, zmm0);
_mm512_store_si512((__m512i *)dest + 1, zmm1);
_mm512_store_si512((__m512i *)dest + 2, zmm2);
_mm512_store_si512((__m512i *)dest + 3, zmm3);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
flush64b(dest + 2 * 64);
flush64b(dest + 3 * 64);
}
static force_inline void
memmove_mov2x64b(char *dest, const char *src)
{
__m512i zmm0 = _mm512_loadu_si512((__m512i *)src + 0);
__m512i zmm1 = _mm512_loadu_si512((__m512i *)src + 1);
_mm512_store_si512((__m512i *)dest + 0, zmm0);
_mm512_store_si512((__m512i *)dest + 1, zmm1);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
}
static force_inline void
memmove_mov1x64b(char *dest, const char *src)
{
__m512i zmm0 = _mm512_loadu_si512((__m512i *)src + 0);
_mm512_store_si512((__m512i *)dest + 0, zmm0);
flush64b(dest + 0 * 64);
}
static force_inline void
memmove_mov_avx512f_fw(char *dest, const char *src, size_t len)
{
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
cnt = 64 - cnt;
if (cnt > len)
cnt = len;
memmove_small_avx512f(dest, src, cnt);
dest += cnt;
src += cnt;
len -= cnt;
}
while (len >= 32 * 64) {
memmove_mov32x64b(dest, src);
dest += 32 * 64;
src += 32 * 64;
len -= 32 * 64;
}
if (len >= 16 * 64) {
memmove_mov16x64b(dest, src);
dest += 16 * 64;
src += 16 * 64;
len -= 16 * 64;
}
if (len >= 8 * 64) {
memmove_mov8x64b(dest, src);
dest += 8 * 64;
src += 8 * 64;
len -= 8 * 64;
}
if (len >= 4 * 64) {
memmove_mov4x64b(dest, src);
dest += 4 * 64;
src += 4 * 64;
len -= 4 * 64;
}
if (len >= 2 * 64) {
memmove_mov2x64b(dest, src);
dest += 2 * 64;
src += 2 * 64;
len -= 2 * 64;
}
if (len >= 1 * 64) {
memmove_mov1x64b(dest, src);
dest += 1 * 64;
src += 1 * 64;
len -= 1 * 64;
}
if (len)
memmove_small_avx512f(dest, src, len);
}
static force_inline void
memmove_mov_avx512f_bw(char *dest, const char *src, size_t len)
{
dest += len;
src += len;
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
if (cnt > len)
cnt = len;
dest -= cnt;
src -= cnt;
len -= cnt;
memmove_small_avx512f(dest, src, cnt);
}
while (len >= 32 * 64) {
dest -= 32 * 64;
src -= 32 * 64;
len -= 32 * 64;
memmove_mov32x64b(dest, src);
}
if (len >= 16 * 64) {
dest -= 16 * 64;
src -= 16 * 64;
len -= 16 * 64;
memmove_mov16x64b(dest, src);
}
if (len >= 8 * 64) {
dest -= 8 * 64;
src -= 8 * 64;
len -= 8 * 64;
memmove_mov8x64b(dest, src);
}
if (len >= 4 * 64) {
dest -= 4 * 64;
src -= 4 * 64;
len -= 4 * 64;
memmove_mov4x64b(dest, src);
}
if (len >= 2 * 64) {
dest -= 2 * 64;
src -= 2 * 64;
len -= 2 * 64;
memmove_mov2x64b(dest, src);
}
if (len >= 1 * 64) {
dest -= 1 * 64;
src -= 1 * 64;
len -= 1 * 64;
memmove_mov1x64b(dest, src);
}
if (len)
memmove_small_avx512f(dest - len, src - len, len);
}
void
EXPORTED_SYMBOL(char *dest, const char *src, size_t len)
{
if ((uintptr_t)dest - (uintptr_t)src >= len)
memmove_mov_avx512f_fw(dest, src, len);
else
memmove_mov_avx512f_bw(dest, src, len);
avx_zeroupper();
}
| 12,825 | 30.131068 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memcpy/memcpy_t_avx.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <immintrin.h>
#include <stddef.h>
#include <stdint.h>
#include "pmem.h"
#include "avx.h"
#include "flush.h"
#include "memcpy_avx.h"
#include "memcpy_memset.h"
static force_inline void
memmove_mov8x64b(char *dest, const char *src)
{
__m256i ymm0 = _mm256_loadu_si256((__m256i *)src + 0);
__m256i ymm1 = _mm256_loadu_si256((__m256i *)src + 1);
__m256i ymm2 = _mm256_loadu_si256((__m256i *)src + 2);
__m256i ymm3 = _mm256_loadu_si256((__m256i *)src + 3);
__m256i ymm4 = _mm256_loadu_si256((__m256i *)src + 4);
__m256i ymm5 = _mm256_loadu_si256((__m256i *)src + 5);
__m256i ymm6 = _mm256_loadu_si256((__m256i *)src + 6);
__m256i ymm7 = _mm256_loadu_si256((__m256i *)src + 7);
__m256i ymm8 = _mm256_loadu_si256((__m256i *)src + 8);
__m256i ymm9 = _mm256_loadu_si256((__m256i *)src + 9);
__m256i ymm10 = _mm256_loadu_si256((__m256i *)src + 10);
__m256i ymm11 = _mm256_loadu_si256((__m256i *)src + 11);
__m256i ymm12 = _mm256_loadu_si256((__m256i *)src + 12);
__m256i ymm13 = _mm256_loadu_si256((__m256i *)src + 13);
__m256i ymm14 = _mm256_loadu_si256((__m256i *)src + 14);
__m256i ymm15 = _mm256_loadu_si256((__m256i *)src + 15);
_mm256_store_si256((__m256i *)dest + 0, ymm0);
_mm256_store_si256((__m256i *)dest + 1, ymm1);
_mm256_store_si256((__m256i *)dest + 2, ymm2);
_mm256_store_si256((__m256i *)dest + 3, ymm3);
_mm256_store_si256((__m256i *)dest + 4, ymm4);
_mm256_store_si256((__m256i *)dest + 5, ymm5);
_mm256_store_si256((__m256i *)dest + 6, ymm6);
_mm256_store_si256((__m256i *)dest + 7, ymm7);
_mm256_store_si256((__m256i *)dest + 8, ymm8);
_mm256_store_si256((__m256i *)dest + 9, ymm9);
_mm256_store_si256((__m256i *)dest + 10, ymm10);
_mm256_store_si256((__m256i *)dest + 11, ymm11);
_mm256_store_si256((__m256i *)dest + 12, ymm12);
_mm256_store_si256((__m256i *)dest + 13, ymm13);
_mm256_store_si256((__m256i *)dest + 14, ymm14);
_mm256_store_si256((__m256i *)dest + 15, ymm15);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
flush64b(dest + 2 * 64);
flush64b(dest + 3 * 64);
flush64b(dest + 4 * 64);
flush64b(dest + 5 * 64);
flush64b(dest + 6 * 64);
flush64b(dest + 7 * 64);
}
static force_inline void
memmove_mov4x64b(char *dest, const char *src)
{
__m256i ymm0 = _mm256_loadu_si256((__m256i *)src + 0);
__m256i ymm1 = _mm256_loadu_si256((__m256i *)src + 1);
__m256i ymm2 = _mm256_loadu_si256((__m256i *)src + 2);
__m256i ymm3 = _mm256_loadu_si256((__m256i *)src + 3);
__m256i ymm4 = _mm256_loadu_si256((__m256i *)src + 4);
__m256i ymm5 = _mm256_loadu_si256((__m256i *)src + 5);
__m256i ymm6 = _mm256_loadu_si256((__m256i *)src + 6);
__m256i ymm7 = _mm256_loadu_si256((__m256i *)src + 7);
_mm256_store_si256((__m256i *)dest + 0, ymm0);
_mm256_store_si256((__m256i *)dest + 1, ymm1);
_mm256_store_si256((__m256i *)dest + 2, ymm2);
_mm256_store_si256((__m256i *)dest + 3, ymm3);
_mm256_store_si256((__m256i *)dest + 4, ymm4);
_mm256_store_si256((__m256i *)dest + 5, ymm5);
_mm256_store_si256((__m256i *)dest + 6, ymm6);
_mm256_store_si256((__m256i *)dest + 7, ymm7);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
flush64b(dest + 2 * 64);
flush64b(dest + 3 * 64);
}
static force_inline void
memmove_mov2x64b(char *dest, const char *src)
{
__m256i ymm0 = _mm256_loadu_si256((__m256i *)src + 0);
__m256i ymm1 = _mm256_loadu_si256((__m256i *)src + 1);
__m256i ymm2 = _mm256_loadu_si256((__m256i *)src + 2);
__m256i ymm3 = _mm256_loadu_si256((__m256i *)src + 3);
_mm256_store_si256((__m256i *)dest + 0, ymm0);
_mm256_store_si256((__m256i *)dest + 1, ymm1);
_mm256_store_si256((__m256i *)dest + 2, ymm2);
_mm256_store_si256((__m256i *)dest + 3, ymm3);
flush64b(dest + 0 * 64);
flush64b(dest + 1 * 64);
}
static force_inline void
memmove_mov1x64b(char *dest, const char *src)
{
__m256i ymm0 = _mm256_loadu_si256((__m256i *)src + 0);
__m256i ymm1 = _mm256_loadu_si256((__m256i *)src + 1);
_mm256_store_si256((__m256i *)dest + 0, ymm0);
_mm256_store_si256((__m256i *)dest + 1, ymm1);
flush64b(dest + 0 * 64);
}
static force_inline void
memmove_mov_avx_fw(char *dest, const char *src, size_t len)
{
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
cnt = 64 - cnt;
if (cnt > len)
cnt = len;
memmove_small_avx(dest, src, cnt);
dest += cnt;
src += cnt;
len -= cnt;
}
while (len >= 8 * 64) {
memmove_mov8x64b(dest, src);
dest += 8 * 64;
src += 8 * 64;
len -= 8 * 64;
}
if (len >= 4 * 64) {
memmove_mov4x64b(dest, src);
dest += 4 * 64;
src += 4 * 64;
len -= 4 * 64;
}
if (len >= 2 * 64) {
memmove_mov2x64b(dest, src);
dest += 2 * 64;
src += 2 * 64;
len -= 2 * 64;
}
if (len >= 1 * 64) {
memmove_mov1x64b(dest, src);
dest += 1 * 64;
src += 1 * 64;
len -= 1 * 64;
}
if (len)
memmove_small_avx(dest, src, len);
}
static force_inline void
memmove_mov_avx_bw(char *dest, const char *src, size_t len)
{
dest += len;
src += len;
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
if (cnt > len)
cnt = len;
dest -= cnt;
src -= cnt;
len -= cnt;
memmove_small_avx(dest, src, cnt);
}
while (len >= 8 * 64) {
dest -= 8 * 64;
src -= 8 * 64;
len -= 8 * 64;
memmove_mov8x64b(dest, src);
}
if (len >= 4 * 64) {
dest -= 4 * 64;
src -= 4 * 64;
len -= 4 * 64;
memmove_mov4x64b(dest, src);
}
if (len >= 2 * 64) {
dest -= 2 * 64;
src -= 2 * 64;
len -= 2 * 64;
memmove_mov2x64b(dest, src);
}
if (len >= 1 * 64) {
dest -= 1 * 64;
src -= 1 * 64;
len -= 1 * 64;
memmove_mov1x64b(dest, src);
}
if (len)
memmove_small_avx(dest - len, src - len, len);
}
void
EXPORTED_SYMBOL(char *dest, const char *src, size_t len)
{
if ((uintptr_t)dest - (uintptr_t)src >= len)
memmove_mov_avx_fw(dest, src, len);
else
memmove_mov_avx_bw(dest, src, len);
avx_zeroupper();
}
| 7,378 | 27.937255 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memcpy/memcpy_avx512f.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PMEM_MEMCPY_AVX512F_H
#define PMEM_MEMCPY_AVX512F_H
#include <stddef.h>
#include "memcpy_avx.h"
static force_inline void
memmove_small_avx512f(char *dest, const char *src, size_t len)
{
/* We can't do better than AVX here. */
memmove_small_avx(dest, src, len);
}
#endif
| 1,886 | 38.3125 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memcpy/memcpy_nt_avx512f.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <immintrin.h>
#include <stddef.h>
#include <stdint.h>
#include "pmem.h"
#include "avx.h"
#include "flush.h"
#include "memcpy_avx512f.h"
#include "memcpy_memset.h"
#include "libpmem.h"
#include "valgrind_internal.h"
static force_inline void
memmove_movnt32x64b(char *dest, const char *src)
{
__m512i zmm0 = _mm512_loadu_si512((__m512i *)src + 0);
__m512i zmm1 = _mm512_loadu_si512((__m512i *)src + 1);
__m512i zmm2 = _mm512_loadu_si512((__m512i *)src + 2);
__m512i zmm3 = _mm512_loadu_si512((__m512i *)src + 3);
__m512i zmm4 = _mm512_loadu_si512((__m512i *)src + 4);
__m512i zmm5 = _mm512_loadu_si512((__m512i *)src + 5);
__m512i zmm6 = _mm512_loadu_si512((__m512i *)src + 6);
__m512i zmm7 = _mm512_loadu_si512((__m512i *)src + 7);
__m512i zmm8 = _mm512_loadu_si512((__m512i *)src + 8);
__m512i zmm9 = _mm512_loadu_si512((__m512i *)src + 9);
__m512i zmm10 = _mm512_loadu_si512((__m512i *)src + 10);
__m512i zmm11 = _mm512_loadu_si512((__m512i *)src + 11);
__m512i zmm12 = _mm512_loadu_si512((__m512i *)src + 12);
__m512i zmm13 = _mm512_loadu_si512((__m512i *)src + 13);
__m512i zmm14 = _mm512_loadu_si512((__m512i *)src + 14);
__m512i zmm15 = _mm512_loadu_si512((__m512i *)src + 15);
__m512i zmm16 = _mm512_loadu_si512((__m512i *)src + 16);
__m512i zmm17 = _mm512_loadu_si512((__m512i *)src + 17);
__m512i zmm18 = _mm512_loadu_si512((__m512i *)src + 18);
__m512i zmm19 = _mm512_loadu_si512((__m512i *)src + 19);
__m512i zmm20 = _mm512_loadu_si512((__m512i *)src + 20);
__m512i zmm21 = _mm512_loadu_si512((__m512i *)src + 21);
__m512i zmm22 = _mm512_loadu_si512((__m512i *)src + 22);
__m512i zmm23 = _mm512_loadu_si512((__m512i *)src + 23);
__m512i zmm24 = _mm512_loadu_si512((__m512i *)src + 24);
__m512i zmm25 = _mm512_loadu_si512((__m512i *)src + 25);
__m512i zmm26 = _mm512_loadu_si512((__m512i *)src + 26);
__m512i zmm27 = _mm512_loadu_si512((__m512i *)src + 27);
__m512i zmm28 = _mm512_loadu_si512((__m512i *)src + 28);
__m512i zmm29 = _mm512_loadu_si512((__m512i *)src + 29);
__m512i zmm30 = _mm512_loadu_si512((__m512i *)src + 30);
__m512i zmm31 = _mm512_loadu_si512((__m512i *)src + 31);
_mm512_stream_si512((__m512i *)dest + 0, zmm0);
_mm512_stream_si512((__m512i *)dest + 1, zmm1);
_mm512_stream_si512((__m512i *)dest + 2, zmm2);
_mm512_stream_si512((__m512i *)dest + 3, zmm3);
_mm512_stream_si512((__m512i *)dest + 4, zmm4);
_mm512_stream_si512((__m512i *)dest + 5, zmm5);
_mm512_stream_si512((__m512i *)dest + 6, zmm6);
_mm512_stream_si512((__m512i *)dest + 7, zmm7);
_mm512_stream_si512((__m512i *)dest + 8, zmm8);
_mm512_stream_si512((__m512i *)dest + 9, zmm9);
_mm512_stream_si512((__m512i *)dest + 10, zmm10);
_mm512_stream_si512((__m512i *)dest + 11, zmm11);
_mm512_stream_si512((__m512i *)dest + 12, zmm12);
_mm512_stream_si512((__m512i *)dest + 13, zmm13);
_mm512_stream_si512((__m512i *)dest + 14, zmm14);
_mm512_stream_si512((__m512i *)dest + 15, zmm15);
_mm512_stream_si512((__m512i *)dest + 16, zmm16);
_mm512_stream_si512((__m512i *)dest + 17, zmm17);
_mm512_stream_si512((__m512i *)dest + 18, zmm18);
_mm512_stream_si512((__m512i *)dest + 19, zmm19);
_mm512_stream_si512((__m512i *)dest + 20, zmm20);
_mm512_stream_si512((__m512i *)dest + 21, zmm21);
_mm512_stream_si512((__m512i *)dest + 22, zmm22);
_mm512_stream_si512((__m512i *)dest + 23, zmm23);
_mm512_stream_si512((__m512i *)dest + 24, zmm24);
_mm512_stream_si512((__m512i *)dest + 25, zmm25);
_mm512_stream_si512((__m512i *)dest + 26, zmm26);
_mm512_stream_si512((__m512i *)dest + 27, zmm27);
_mm512_stream_si512((__m512i *)dest + 28, zmm28);
_mm512_stream_si512((__m512i *)dest + 29, zmm29);
_mm512_stream_si512((__m512i *)dest + 30, zmm30);
_mm512_stream_si512((__m512i *)dest + 31, zmm31);
VALGRIND_DO_FLUSH(dest, 32 * 64);
}
static force_inline void
memmove_movnt16x64b(char *dest, const char *src)
{
__m512i zmm0 = _mm512_loadu_si512((__m512i *)src + 0);
__m512i zmm1 = _mm512_loadu_si512((__m512i *)src + 1);
__m512i zmm2 = _mm512_loadu_si512((__m512i *)src + 2);
__m512i zmm3 = _mm512_loadu_si512((__m512i *)src + 3);
__m512i zmm4 = _mm512_loadu_si512((__m512i *)src + 4);
__m512i zmm5 = _mm512_loadu_si512((__m512i *)src + 5);
__m512i zmm6 = _mm512_loadu_si512((__m512i *)src + 6);
__m512i zmm7 = _mm512_loadu_si512((__m512i *)src + 7);
__m512i zmm8 = _mm512_loadu_si512((__m512i *)src + 8);
__m512i zmm9 = _mm512_loadu_si512((__m512i *)src + 9);
__m512i zmm10 = _mm512_loadu_si512((__m512i *)src + 10);
__m512i zmm11 = _mm512_loadu_si512((__m512i *)src + 11);
__m512i zmm12 = _mm512_loadu_si512((__m512i *)src + 12);
__m512i zmm13 = _mm512_loadu_si512((__m512i *)src + 13);
__m512i zmm14 = _mm512_loadu_si512((__m512i *)src + 14);
__m512i zmm15 = _mm512_loadu_si512((__m512i *)src + 15);
_mm512_stream_si512((__m512i *)dest + 0, zmm0);
_mm512_stream_si512((__m512i *)dest + 1, zmm1);
_mm512_stream_si512((__m512i *)dest + 2, zmm2);
_mm512_stream_si512((__m512i *)dest + 3, zmm3);
_mm512_stream_si512((__m512i *)dest + 4, zmm4);
_mm512_stream_si512((__m512i *)dest + 5, zmm5);
_mm512_stream_si512((__m512i *)dest + 6, zmm6);
_mm512_stream_si512((__m512i *)dest + 7, zmm7);
_mm512_stream_si512((__m512i *)dest + 8, zmm8);
_mm512_stream_si512((__m512i *)dest + 9, zmm9);
_mm512_stream_si512((__m512i *)dest + 10, zmm10);
_mm512_stream_si512((__m512i *)dest + 11, zmm11);
_mm512_stream_si512((__m512i *)dest + 12, zmm12);
_mm512_stream_si512((__m512i *)dest + 13, zmm13);
_mm512_stream_si512((__m512i *)dest + 14, zmm14);
_mm512_stream_si512((__m512i *)dest + 15, zmm15);
VALGRIND_DO_FLUSH(dest, 16 * 64);
}
static force_inline void
memmove_movnt8x64b(char *dest, const char *src)
{
__m512i zmm0 = _mm512_loadu_si512((__m512i *)src + 0);
__m512i zmm1 = _mm512_loadu_si512((__m512i *)src + 1);
__m512i zmm2 = _mm512_loadu_si512((__m512i *)src + 2);
__m512i zmm3 = _mm512_loadu_si512((__m512i *)src + 3);
__m512i zmm4 = _mm512_loadu_si512((__m512i *)src + 4);
__m512i zmm5 = _mm512_loadu_si512((__m512i *)src + 5);
__m512i zmm6 = _mm512_loadu_si512((__m512i *)src + 6);
__m512i zmm7 = _mm512_loadu_si512((__m512i *)src + 7);
_mm512_stream_si512((__m512i *)dest + 0, zmm0);
_mm512_stream_si512((__m512i *)dest + 1, zmm1);
_mm512_stream_si512((__m512i *)dest + 2, zmm2);
_mm512_stream_si512((__m512i *)dest + 3, zmm3);
_mm512_stream_si512((__m512i *)dest + 4, zmm4);
_mm512_stream_si512((__m512i *)dest + 5, zmm5);
_mm512_stream_si512((__m512i *)dest + 6, zmm6);
_mm512_stream_si512((__m512i *)dest + 7, zmm7);
VALGRIND_DO_FLUSH(dest, 8 * 64);
}
static force_inline void
memmove_movnt4x64b(char *dest, const char *src)
{
__m512i zmm0 = _mm512_loadu_si512((__m512i *)src + 0);
__m512i zmm1 = _mm512_loadu_si512((__m512i *)src + 1);
__m512i zmm2 = _mm512_loadu_si512((__m512i *)src + 2);
__m512i zmm3 = _mm512_loadu_si512((__m512i *)src + 3);
_mm512_stream_si512((__m512i *)dest + 0, zmm0);
_mm512_stream_si512((__m512i *)dest + 1, zmm1);
_mm512_stream_si512((__m512i *)dest + 2, zmm2);
_mm512_stream_si512((__m512i *)dest + 3, zmm3);
VALGRIND_DO_FLUSH(dest, 4 * 64);
}
static force_inline void
memmove_movnt2x64b(char *dest, const char *src)
{
__m512i zmm0 = _mm512_loadu_si512((__m512i *)src + 0);
__m512i zmm1 = _mm512_loadu_si512((__m512i *)src + 1);
_mm512_stream_si512((__m512i *)dest + 0, zmm0);
_mm512_stream_si512((__m512i *)dest + 1, zmm1);
VALGRIND_DO_FLUSH(dest, 2 * 64);
}
static force_inline void
memmove_movnt1x64b(char *dest, const char *src)
{
__m512i zmm0 = _mm512_loadu_si512((__m512i *)src + 0);
_mm512_stream_si512((__m512i *)dest + 0, zmm0);
VALGRIND_DO_FLUSH(dest, 64);
}
static force_inline void
memmove_movnt1x32b(char *dest, const char *src)
{
__m256i zmm0 = _mm256_loadu_si256((__m256i *)src);
_mm256_stream_si256((__m256i *)dest, zmm0);
VALGRIND_DO_FLUSH(dest, 32);
}
static force_inline void
memmove_movnt1x16b(char *dest, const char *src)
{
__m128i ymm0 = _mm_loadu_si128((__m128i *)src);
_mm_stream_si128((__m128i *)dest, ymm0);
VALGRIND_DO_FLUSH(dest, 16);
}
static force_inline void
memmove_movnt1x8b(char *dest, const char *src)
{
_mm_stream_si64((long long *)dest, *(long long *)src);
VALGRIND_DO_FLUSH(dest, 8);
}
static force_inline void
memmove_movnt1x4b(char *dest, const char *src)
{
_mm_stream_si32((int *)dest, *(int *)src);
VALGRIND_DO_FLUSH(dest, 4);
}
static force_inline void
memmove_movnt_avx512f_fw(char *dest, const char *src, size_t len)
{
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
cnt = 64 - cnt;
if (cnt > len)
cnt = len;
memmove_small_avx512f(dest, src, cnt);
dest += cnt;
src += cnt;
len -= cnt;
}
while (len >= 32 * 64) {
memmove_movnt32x64b(dest, src);
dest += 32 * 64;
src += 32 * 64;
len -= 32 * 64;
}
if (len >= 16 * 64) {
memmove_movnt16x64b(dest, src);
dest += 16 * 64;
src += 16 * 64;
len -= 16 * 64;
}
if (len >= 8 * 64) {
memmove_movnt8x64b(dest, src);
dest += 8 * 64;
src += 8 * 64;
len -= 8 * 64;
}
if (len >= 4 * 64) {
memmove_movnt4x64b(dest, src);
dest += 4 * 64;
src += 4 * 64;
len -= 4 * 64;
}
if (len >= 2 * 64) {
memmove_movnt2x64b(dest, src);
dest += 2 * 64;
src += 2 * 64;
len -= 2 * 64;
}
if (len >= 1 * 64) {
memmove_movnt1x64b(dest, src);
dest += 1 * 64;
src += 1 * 64;
len -= 1 * 64;
}
if (len == 0)
goto end;
/* There's no point in using more than 1 nt store for 1 cache line. */
if (util_is_pow2(len)) {
if (len == 32)
memmove_movnt1x32b(dest, src);
else if (len == 16)
memmove_movnt1x16b(dest, src);
else if (len == 8)
memmove_movnt1x8b(dest, src);
else if (len == 4)
memmove_movnt1x4b(dest, src);
else
goto nonnt;
goto end;
}
nonnt:
memmove_small_avx512f(dest, src, len);
end:
avx_zeroupper();
}
static force_inline void
memmove_movnt_avx512f_bw(char *dest, const char *src, size_t len)
{
dest += len;
src += len;
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
if (cnt > len)
cnt = len;
dest -= cnt;
src -= cnt;
len -= cnt;
memmove_small_avx512f(dest, src, cnt);
}
while (len >= 32 * 64) {
dest -= 32 * 64;
src -= 32 * 64;
len -= 32 * 64;
memmove_movnt32x64b(dest, src);
}
if (len >= 16 * 64) {
dest -= 16 * 64;
src -= 16 * 64;
len -= 16 * 64;
memmove_movnt16x64b(dest, src);
}
if (len >= 8 * 64) {
dest -= 8 * 64;
src -= 8 * 64;
len -= 8 * 64;
memmove_movnt8x64b(dest, src);
}
if (len >= 4 * 64) {
dest -= 4 * 64;
src -= 4 * 64;
len -= 4 * 64;
memmove_movnt4x64b(dest, src);
}
if (len >= 2 * 64) {
dest -= 2 * 64;
src -= 2 * 64;
len -= 2 * 64;
memmove_movnt2x64b(dest, src);
}
if (len >= 1 * 64) {
dest -= 1 * 64;
src -= 1 * 64;
len -= 1 * 64;
memmove_movnt1x64b(dest, src);
}
if (len == 0)
goto end;
/* There's no point in using more than 1 nt store for 1 cache line. */
if (util_is_pow2(len)) {
if (len == 32) {
dest -= 32;
src -= 32;
memmove_movnt1x32b(dest, src);
} else if (len == 16) {
dest -= 16;
src -= 16;
memmove_movnt1x16b(dest, src);
} else if (len == 8) {
dest -= 8;
src -= 8;
memmove_movnt1x8b(dest, src);
} else if (len == 4) {
dest -= 4;
src -= 4;
memmove_movnt1x4b(dest, src);
} else {
goto nonnt;
}
goto end;
}
nonnt:
dest -= len;
src -= len;
memmove_small_avx512f(dest, src, len);
end:
avx_zeroupper();
}
void
EXPORTED_SYMBOL(char *dest, const char *src, size_t len)
{
if ((uintptr_t)dest - (uintptr_t)src >= len)
memmove_movnt_avx512f_fw(dest, src, len);
else
memmove_movnt_avx512f_bw(dest, src, len);
maybe_barrier();
}
| 13,191 | 28.446429 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memcpy/memcpy_nt_sse2.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <immintrin.h>
#include <stddef.h>
#include <stdint.h>
#include "pmem.h"
#include "flush.h"
#include "memcpy_memset.h"
#include "memcpy_sse2.h"
#include "valgrind_internal.h"
static force_inline void
memmove_movnt4x64b(char *dest, const char *src)
{
__m128i xmm0 = _mm_loadu_si128((__m128i *)src + 0);
__m128i xmm1 = _mm_loadu_si128((__m128i *)src + 1);
__m128i xmm2 = _mm_loadu_si128((__m128i *)src + 2);
__m128i xmm3 = _mm_loadu_si128((__m128i *)src + 3);
__m128i xmm4 = _mm_loadu_si128((__m128i *)src + 4);
__m128i xmm5 = _mm_loadu_si128((__m128i *)src + 5);
__m128i xmm6 = _mm_loadu_si128((__m128i *)src + 6);
__m128i xmm7 = _mm_loadu_si128((__m128i *)src + 7);
__m128i xmm8 = _mm_loadu_si128((__m128i *)src + 8);
__m128i xmm9 = _mm_loadu_si128((__m128i *)src + 9);
__m128i xmm10 = _mm_loadu_si128((__m128i *)src + 10);
__m128i xmm11 = _mm_loadu_si128((__m128i *)src + 11);
__m128i xmm12 = _mm_loadu_si128((__m128i *)src + 12);
__m128i xmm13 = _mm_loadu_si128((__m128i *)src + 13);
__m128i xmm14 = _mm_loadu_si128((__m128i *)src + 14);
__m128i xmm15 = _mm_loadu_si128((__m128i *)src + 15);
_mm_stream_si128((__m128i *)dest + 0, xmm0);
_mm_stream_si128((__m128i *)dest + 1, xmm1);
_mm_stream_si128((__m128i *)dest + 2, xmm2);
_mm_stream_si128((__m128i *)dest + 3, xmm3);
_mm_stream_si128((__m128i *)dest + 4, xmm4);
_mm_stream_si128((__m128i *)dest + 5, xmm5);
_mm_stream_si128((__m128i *)dest + 6, xmm6);
_mm_stream_si128((__m128i *)dest + 7, xmm7);
_mm_stream_si128((__m128i *)dest + 8, xmm8);
_mm_stream_si128((__m128i *)dest + 9, xmm9);
_mm_stream_si128((__m128i *)dest + 10, xmm10);
_mm_stream_si128((__m128i *)dest + 11, xmm11);
_mm_stream_si128((__m128i *)dest + 12, xmm12);
_mm_stream_si128((__m128i *)dest + 13, xmm13);
_mm_stream_si128((__m128i *)dest + 14, xmm14);
_mm_stream_si128((__m128i *)dest + 15, xmm15);
VALGRIND_DO_FLUSH(dest, 4 * 64);
}
static force_inline void
memmove_movnt2x64b(char *dest, const char *src)
{
__m128i xmm0 = _mm_loadu_si128((__m128i *)src + 0);
__m128i xmm1 = _mm_loadu_si128((__m128i *)src + 1);
__m128i xmm2 = _mm_loadu_si128((__m128i *)src + 2);
__m128i xmm3 = _mm_loadu_si128((__m128i *)src + 3);
__m128i xmm4 = _mm_loadu_si128((__m128i *)src + 4);
__m128i xmm5 = _mm_loadu_si128((__m128i *)src + 5);
__m128i xmm6 = _mm_loadu_si128((__m128i *)src + 6);
__m128i xmm7 = _mm_loadu_si128((__m128i *)src + 7);
_mm_stream_si128((__m128i *)dest + 0, xmm0);
_mm_stream_si128((__m128i *)dest + 1, xmm1);
_mm_stream_si128((__m128i *)dest + 2, xmm2);
_mm_stream_si128((__m128i *)dest + 3, xmm3);
_mm_stream_si128((__m128i *)dest + 4, xmm4);
_mm_stream_si128((__m128i *)dest + 5, xmm5);
_mm_stream_si128((__m128i *)dest + 6, xmm6);
_mm_stream_si128((__m128i *)dest + 7, xmm7);
VALGRIND_DO_FLUSH(dest, 2 * 64);
}
static force_inline void
memmove_movnt1x64b(char *dest, const char *src)
{
__m128i xmm0 = _mm_loadu_si128((__m128i *)src + 0);
__m128i xmm1 = _mm_loadu_si128((__m128i *)src + 1);
__m128i xmm2 = _mm_loadu_si128((__m128i *)src + 2);
__m128i xmm3 = _mm_loadu_si128((__m128i *)src + 3);
_mm_stream_si128((__m128i *)dest + 0, xmm0);
_mm_stream_si128((__m128i *)dest + 1, xmm1);
_mm_stream_si128((__m128i *)dest + 2, xmm2);
_mm_stream_si128((__m128i *)dest + 3, xmm3);
VALGRIND_DO_FLUSH(dest, 64);
}
static force_inline void
memmove_movnt1x32b(char *dest, const char *src)
{
__m128i xmm0 = _mm_loadu_si128((__m128i *)src + 0);
__m128i xmm1 = _mm_loadu_si128((__m128i *)src + 1);
_mm_stream_si128((__m128i *)dest + 0, xmm0);
_mm_stream_si128((__m128i *)dest + 1, xmm1);
VALGRIND_DO_FLUSH(dest, 32);
}
static force_inline void
memmove_movnt1x16b(char *dest, const char *src)
{
__m128i xmm0 = _mm_loadu_si128((__m128i *)src);
_mm_stream_si128((__m128i *)dest, xmm0);
VALGRIND_DO_FLUSH(dest, 16);
}
static force_inline void
memmove_movnt1x8b(char *dest, const char *src)
{
_mm_stream_si64((long long *)dest, *(long long *)src);
VALGRIND_DO_FLUSH(dest, 8);
}
static force_inline void
memmove_movnt1x4b(char *dest, const char *src)
{
_mm_stream_si32((int *)dest, *(int *)src);
VALGRIND_DO_FLUSH(dest, 4);
}
static force_inline void
memmove_movnt_sse_fw(char *dest, const char *src, size_t len)
{
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
cnt = 64 - cnt;
if (cnt > len)
cnt = len;
memmove_small_sse2(dest, src, cnt);
dest += cnt;
src += cnt;
len -= cnt;
}
while (len >= 4 * 64) {
memmove_movnt4x64b(dest, src);
dest += 4 * 64;
src += 4 * 64;
len -= 4 * 64;
}
if (len >= 2 * 64) {
memmove_movnt2x64b(dest, src);
dest += 2 * 64;
src += 2 * 64;
len -= 2 * 64;
}
if (len >= 1 * 64) {
memmove_movnt1x64b(dest, src);
dest += 1 * 64;
src += 1 * 64;
len -= 1 * 64;
}
if (len == 0)
return;
/* There's no point in using more than 1 nt store for 1 cache line. */
if (util_is_pow2(len)) {
if (len == 32)
memmove_movnt1x32b(dest, src);
else if (len == 16)
memmove_movnt1x16b(dest, src);
else if (len == 8)
memmove_movnt1x8b(dest, src);
else if (len == 4)
memmove_movnt1x4b(dest, src);
else
goto nonnt;
return;
}
nonnt:
memmove_small_sse2(dest, src, len);
}
static force_inline void
memmove_movnt_sse_bw(char *dest, const char *src, size_t len)
{
dest += len;
src += len;
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
if (cnt > len)
cnt = len;
dest -= cnt;
src -= cnt;
len -= cnt;
memmove_small_sse2(dest, src, cnt);
}
while (len >= 4 * 64) {
dest -= 4 * 64;
src -= 4 * 64;
len -= 4 * 64;
memmove_movnt4x64b(dest, src);
}
if (len >= 2 * 64) {
dest -= 2 * 64;
src -= 2 * 64;
len -= 2 * 64;
memmove_movnt2x64b(dest, src);
}
if (len >= 1 * 64) {
dest -= 1 * 64;
src -= 1 * 64;
len -= 1 * 64;
memmove_movnt1x64b(dest, src);
}
if (len == 0)
return;
/* There's no point in using more than 1 nt store for 1 cache line. */
if (util_is_pow2(len)) {
if (len == 32) {
dest -= 32;
src -= 32;
memmove_movnt1x32b(dest, src);
} else if (len == 16) {
dest -= 16;
src -= 16;
memmove_movnt1x16b(dest, src);
} else if (len == 8) {
dest -= 8;
src -= 8;
memmove_movnt1x8b(dest, src);
} else if (len == 4) {
dest -= 4;
src -= 4;
memmove_movnt1x4b(dest, src);
} else {
goto nonnt;
}
return;
}
nonnt:
dest -= len;
src -= len;
memmove_small_sse2(dest, src, len);
}
void
EXPORTED_SYMBOL(char *dest, const char *src, size_t len)
{
if ((uintptr_t)dest - (uintptr_t)src >= len)
memmove_movnt_sse_fw(dest, src, len);
else
memmove_movnt_sse_bw(dest, src, len);
maybe_barrier();
}
| 8,204 | 25.813725 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/x86_64/memcpy/memcpy_nt_avx.h
|
/*
* Copyright 2017-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <immintrin.h>
#include <stddef.h>
#include <stdint.h>
#include "pmem.h"
#include "avx.h"
#include "flush.h"
#include "memcpy_avx.h"
#include "memcpy_memset.h"
#include "valgrind_internal.h"
static force_inline void
memmove_movnt8x64b(char *dest, const char *src)
{
__m256i ymm0 = _mm256_loadu_si256((__m256i *)src + 0);
__m256i ymm1 = _mm256_loadu_si256((__m256i *)src + 1);
__m256i ymm2 = _mm256_loadu_si256((__m256i *)src + 2);
__m256i ymm3 = _mm256_loadu_si256((__m256i *)src + 3);
__m256i ymm4 = _mm256_loadu_si256((__m256i *)src + 4);
__m256i ymm5 = _mm256_loadu_si256((__m256i *)src + 5);
__m256i ymm6 = _mm256_loadu_si256((__m256i *)src + 6);
__m256i ymm7 = _mm256_loadu_si256((__m256i *)src + 7);
__m256i ymm8 = _mm256_loadu_si256((__m256i *)src + 8);
__m256i ymm9 = _mm256_loadu_si256((__m256i *)src + 9);
__m256i ymm10 = _mm256_loadu_si256((__m256i *)src + 10);
__m256i ymm11 = _mm256_loadu_si256((__m256i *)src + 11);
__m256i ymm12 = _mm256_loadu_si256((__m256i *)src + 12);
__m256i ymm13 = _mm256_loadu_si256((__m256i *)src + 13);
__m256i ymm14 = _mm256_loadu_si256((__m256i *)src + 14);
__m256i ymm15 = _mm256_loadu_si256((__m256i *)src + 15);
_mm256_stream_si256((__m256i *)dest + 0, ymm0);
_mm256_stream_si256((__m256i *)dest + 1, ymm1);
_mm256_stream_si256((__m256i *)dest + 2, ymm2);
_mm256_stream_si256((__m256i *)dest + 3, ymm3);
_mm256_stream_si256((__m256i *)dest + 4, ymm4);
_mm256_stream_si256((__m256i *)dest + 5, ymm5);
_mm256_stream_si256((__m256i *)dest + 6, ymm6);
_mm256_stream_si256((__m256i *)dest + 7, ymm7);
_mm256_stream_si256((__m256i *)dest + 8, ymm8);
_mm256_stream_si256((__m256i *)dest + 9, ymm9);
_mm256_stream_si256((__m256i *)dest + 10, ymm10);
_mm256_stream_si256((__m256i *)dest + 11, ymm11);
_mm256_stream_si256((__m256i *)dest + 12, ymm12);
_mm256_stream_si256((__m256i *)dest + 13, ymm13);
_mm256_stream_si256((__m256i *)dest + 14, ymm14);
_mm256_stream_si256((__m256i *)dest + 15, ymm15);
VALGRIND_DO_FLUSH(dest, 8 * 64);
}
static force_inline void
memmove_movnt4x64b(char *dest, const char *src)
{
__m256i ymm0 = _mm256_loadu_si256((__m256i *)src + 0);
__m256i ymm1 = _mm256_loadu_si256((__m256i *)src + 1);
__m256i ymm2 = _mm256_loadu_si256((__m256i *)src + 2);
__m256i ymm3 = _mm256_loadu_si256((__m256i *)src + 3);
__m256i ymm4 = _mm256_loadu_si256((__m256i *)src + 4);
__m256i ymm5 = _mm256_loadu_si256((__m256i *)src + 5);
__m256i ymm6 = _mm256_loadu_si256((__m256i *)src + 6);
__m256i ymm7 = _mm256_loadu_si256((__m256i *)src + 7);
_mm256_stream_si256((__m256i *)dest + 0, ymm0);
_mm256_stream_si256((__m256i *)dest + 1, ymm1);
_mm256_stream_si256((__m256i *)dest + 2, ymm2);
_mm256_stream_si256((__m256i *)dest + 3, ymm3);
_mm256_stream_si256((__m256i *)dest + 4, ymm4);
_mm256_stream_si256((__m256i *)dest + 5, ymm5);
_mm256_stream_si256((__m256i *)dest + 6, ymm6);
_mm256_stream_si256((__m256i *)dest + 7, ymm7);
VALGRIND_DO_FLUSH(dest, 4 * 64);
}
static force_inline void
memmove_movnt2x64b(char *dest, const char *src)
{
__m256i ymm0 = _mm256_loadu_si256((__m256i *)src + 0);
__m256i ymm1 = _mm256_loadu_si256((__m256i *)src + 1);
__m256i ymm2 = _mm256_loadu_si256((__m256i *)src + 2);
__m256i ymm3 = _mm256_loadu_si256((__m256i *)src + 3);
_mm256_stream_si256((__m256i *)dest + 0, ymm0);
_mm256_stream_si256((__m256i *)dest + 1, ymm1);
_mm256_stream_si256((__m256i *)dest + 2, ymm2);
_mm256_stream_si256((__m256i *)dest + 3, ymm3);
VALGRIND_DO_FLUSH(dest, 2 * 64);
}
static force_inline void
memmove_movnt1x64b(char *dest, const char *src)
{
__m256i ymm0 = _mm256_loadu_si256((__m256i *)src + 0);
__m256i ymm1 = _mm256_loadu_si256((__m256i *)src + 1);
_mm256_stream_si256((__m256i *)dest + 0, ymm0);
_mm256_stream_si256((__m256i *)dest + 1, ymm1);
VALGRIND_DO_FLUSH(dest, 64);
}
static force_inline void
memmove_movnt1x32b(char *dest, const char *src)
{
__m256i ymm0 = _mm256_loadu_si256((__m256i *)src);
_mm256_stream_si256((__m256i *)dest, ymm0);
VALGRIND_DO_FLUSH(dest, 32);
}
static force_inline void
memmove_movnt1x16b(char *dest, const char *src)
{
__m128i xmm0 = _mm_loadu_si128((__m128i *)src);
_mm_stream_si128((__m128i *)dest, xmm0);
VALGRIND_DO_FLUSH(dest, 16);
}
static force_inline void
memmove_movnt1x8b(char *dest, const char *src)
{
_mm_stream_si64((long long *)dest, *(long long *)src);
VALGRIND_DO_FLUSH(dest, 8);
}
static force_inline void
memmove_movnt1x4b(char *dest, const char *src)
{
_mm_stream_si32((int *)dest, *(int *)src);
VALGRIND_DO_FLUSH(dest, 4);
}
static force_inline void
memmove_movnt_avx_fw(char *dest, const char *src, size_t len)
{
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
cnt = 64 - cnt;
if (cnt > len)
cnt = len;
memmove_small_avx(dest, src, cnt);
dest += cnt;
src += cnt;
len -= cnt;
}
while (len >= 8 * 64) {
memmove_movnt8x64b(dest, src);
dest += 8 * 64;
src += 8 * 64;
len -= 8 * 64;
}
if (len >= 4 * 64) {
memmove_movnt4x64b(dest, src);
dest += 4 * 64;
src += 4 * 64;
len -= 4 * 64;
}
if (len >= 2 * 64) {
memmove_movnt2x64b(dest, src);
dest += 2 * 64;
src += 2 * 64;
len -= 2 * 64;
}
if (len >= 1 * 64) {
memmove_movnt1x64b(dest, src);
dest += 1 * 64;
src += 1 * 64;
len -= 1 * 64;
}
if (len == 0)
goto end;
/* There's no point in using more than 1 nt store for 1 cache line. */
if (util_is_pow2(len)) {
if (len == 32)
memmove_movnt1x32b(dest, src);
else if (len == 16)
memmove_movnt1x16b(dest, src);
else if (len == 8)
memmove_movnt1x8b(dest, src);
else if (len == 4)
memmove_movnt1x4b(dest, src);
else
goto nonnt;
goto end;
}
nonnt:
memmove_small_avx(dest, src, len);
end:
avx_zeroupper();
}
static force_inline void
memmove_movnt_avx_bw(char *dest, const char *src, size_t len)
{
dest += len;
src += len;
size_t cnt = (uint64_t)dest & 63;
if (cnt > 0) {
if (cnt > len)
cnt = len;
dest -= cnt;
src -= cnt;
len -= cnt;
memmove_small_avx(dest, src, cnt);
}
while (len >= 8 * 64) {
dest -= 8 * 64;
src -= 8 * 64;
len -= 8 * 64;
memmove_movnt8x64b(dest, src);
}
if (len >= 4 * 64) {
dest -= 4 * 64;
src -= 4 * 64;
len -= 4 * 64;
memmove_movnt4x64b(dest, src);
}
if (len >= 2 * 64) {
dest -= 2 * 64;
src -= 2 * 64;
len -= 2 * 64;
memmove_movnt2x64b(dest, src);
}
if (len >= 1 * 64) {
dest -= 1 * 64;
src -= 1 * 64;
len -= 1 * 64;
memmove_movnt1x64b(dest, src);
}
if (len == 0)
goto end;
/* There's no point in using more than 1 nt store for 1 cache line. */
if (util_is_pow2(len)) {
if (len == 32) {
dest -= 32;
src -= 32;
memmove_movnt1x32b(dest, src);
} else if (len == 16) {
dest -= 16;
src -= 16;
memmove_movnt1x16b(dest, src);
} else if (len == 8) {
dest -= 8;
src -= 8;
memmove_movnt1x8b(dest, src);
} else if (len == 4) {
dest -= 4;
src -= 4;
memmove_movnt1x4b(dest, src);
} else {
goto nonnt;
}
goto end;
}
nonnt:
dest -= len;
src -= len;
memmove_small_avx(dest, src, len);
end:
avx_zeroupper();
}
void
EXPORTED_SYMBOL(char *dest, const char *src, size_t len)
{
if ((uintptr_t)dest - (uintptr_t)src >= len)
memmove_movnt_avx_fw(dest, src, len);
else
memmove_movnt_avx_bw(dest, src, len);
maybe_barrier();
}
| 8,883 | 25.519403 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/aarch64/flush.h
|
/*
* Copyright 2014-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ARM64_FLUSH_H
#define ARM64_FLUSH_H
#include <stdint.h>
#include "arm_cacheops.h"
#include "util.h"
#define FLUSH_ALIGN ((uintptr_t)64)
/*
* flush_clflushopt_nolog -- flush the CPU cache, using
* arm_clean_and_invalidate_va_to_poc (see arm_cacheops.h) {DC CIVAC}
*/
static force_inline void
flush_dcache_invalidate_opt_nolog(const void *addr, size_t len)
{
uintptr_t uptr;
arm_data_memory_barrier();
for (uptr = (uintptr_t)addr & ~(FLUSH_ALIGN - 1);
uptr < (uintptr_t)addr + len; uptr += FLUSH_ALIGN) {
arm_clean_and_invalidate_va_to_poc((char *)uptr);
}
arm_data_memory_barrier();
}
/*
* flush_dcache_nolog -- flush the CPU cache, using DC CVAC
*/
static force_inline void
flush_dcache_nolog(const void *addr, size_t len)
{
uintptr_t uptr;
/*
* Loop through cache-line-size (typically 64B) aligned chunks
* covering the given range.
*/
for (uptr = (uintptr_t)addr & ~(FLUSH_ALIGN - 1);
uptr < (uintptr_t)addr + len; uptr += FLUSH_ALIGN) {
arm_clean_va_to_poc((char *)uptr);
}
}
#endif
| 2,631 | 32.74359 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libpmem/aarch64/arm_cacheops.h
|
/*
* Copyright 2014-2017, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* ARM inline assembly to flush and invalidate caches
* clwb => dc cvac
* clflush | clflushopt => dc civac
* fence => dmb ish
*/
#ifndef AARCH64_CACHEOPS_H
#define AARCH64_CACHEOPS_H
#include <stdlib.h>
static inline void
arm_clean_va_to_poc(void const *p __attribute__((unused)))
{
asm volatile("dc cvac, %0" : : "r" (p) : "memory");
}
static inline void
arm_data_memory_barrier(void)
{
asm volatile("dmb ish" : : : "memory");
}
static inline void
arm_clean_and_invalidate_va_to_poc(const void *addr)
{
asm volatile("dc civac, %0" : : "r" (addr) : "memory");
}
#endif
| 2,185 | 34.258065 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/libvmem/vmem.h
|
/*
* Copyright 2014-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* vmem.h -- internal definitions for libvmem
*/
#ifndef VMEM_H
#define VMEM_H 1
#include <stddef.h>
#include "pool_hdr.h"
#ifdef __cplusplus
extern "C" {
#endif
#define VMEM_LOG_PREFIX "libvmem"
#define VMEM_LOG_LEVEL_VAR "VMEM_LOG_LEVEL"
#define VMEM_LOG_FILE_VAR "VMEM_LOG_FILE"
/* attributes of the vmem memory pool format for the pool header */
#define VMEM_HDR_SIG "VMEM " /* must be 8 bytes including '\0' */
#define VMEM_FORMAT_MAJOR 1
struct vmem {
struct pool_hdr hdr; /* memory pool header */
void *addr; /* mapped region */
size_t size; /* size of mapped region */
int caller_mapped;
};
void vmem_construct(void);
#ifdef __cplusplus
}
#endif
#endif
| 2,284 | 31.183099 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/getopt/getopt.h
|
/*
* *Copyright (c) 2012, Kim Gräsman
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Kim Gräsman nor the
* names of contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef INCLUDED_GETOPT_PORT_H
#define INCLUDED_GETOPT_PORT_H
#if defined(__cplusplus)
extern "C" {
#endif
#define no_argument 0
#define required_argument 1
#define optional_argument 2
extern char* optarg;
extern int optind, opterr, optopt;
struct option {
const char* name;
int has_arg;
int* flag;
int val;
};
int getopt(int argc, char* const argv[], const char* optstring);
int getopt_long(int argc, char* const argv[],
const char* optstring, const struct option* longopts, int* longindex);
#if defined(__cplusplus)
}
#endif
#endif // INCLUDED_GETOPT_PORT_H
| 2,137 | 35.237288 | 79 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/jemalloc_gen/include/jemalloc/jemalloc_defs.h
|
/* ./../windows/jemalloc_gen/include/jemalloc/jemalloc_defs.h. Generated from jemalloc_defs.h.in by configure. */
/* Defined if __attribute__((...)) syntax is supported. */
/* #undef JEMALLOC_HAVE_ATTR */
/* Defined if alloc_size attribute is supported. */
/* #undef JEMALLOC_HAVE_ATTR_ALLOC_SIZE */
/* Defined if format(gnu_printf, ...) attribute is supported. */
/* #undef JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF */
/* Defined if format(printf, ...) attribute is supported. */
/* #undef JEMALLOC_HAVE_ATTR_FORMAT_PRINTF */
/*
* Define overrides for non-standard allocator-related functions if they are
* present on the system.
*/
/* #undef JEMALLOC_OVERRIDE_MEMALIGN */
/* #undef JEMALLOC_OVERRIDE_VALLOC */
/*
* At least Linux omits the "const" in:
*
* size_t malloc_usable_size(const void *ptr);
*
* Match the operating system's prototype.
*/
#define JEMALLOC_USABLE_SIZE_CONST const
/*
* If defined, specify throw() for the public function prototypes when compiling
* with C++. The only justification for this is to match the prototypes that
* glibc defines.
*/
/* #undef JEMALLOC_USE_CXX_THROW */
#ifdef _MSC_VER
# ifdef _WIN64
# define LG_SIZEOF_PTR_WIN 3
# else
# define LG_SIZEOF_PTR_WIN 2
# endif
#endif
/* sizeof(void *) == 2^LG_SIZEOF_PTR. */
#define LG_SIZEOF_PTR LG_SIZEOF_PTR_WIN
| 1,327 | 27.255319 | 115 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/jemalloc_gen/include/jemalloc/jemalloc_mangle_jet.h
|
/*
* By default application code must explicitly refer to mangled symbol names,
* so that it is possible to use jemalloc in conjunction with another allocator
* in the same application. Define JEMALLOC_MANGLE in order to cause automatic
* name mangling that matches the API prefixing that happened as a result of
* --with-mangling and/or --with-jemalloc-prefix configuration settings.
*/
#ifdef JEMALLOC_MANGLE
# ifndef JEMALLOC_NO_DEMANGLE
# define JEMALLOC_NO_DEMANGLE
# endif
# define pool_create jet_pool_create
# define pool_delete jet_pool_delete
# define pool_malloc jet_pool_malloc
# define pool_calloc jet_pool_calloc
# define pool_ralloc jet_pool_ralloc
# define pool_aligned_alloc jet_pool_aligned_alloc
# define pool_free jet_pool_free
# define pool_malloc_usable_size jet_pool_malloc_usable_size
# define pool_malloc_stats_print jet_pool_malloc_stats_print
# define pool_extend jet_pool_extend
# define pool_set_alloc_funcs jet_pool_set_alloc_funcs
# define pool_check jet_pool_check
# define malloc_conf jet_malloc_conf
# define malloc_message jet_malloc_message
# define malloc jet_malloc
# define calloc jet_calloc
# define posix_memalign jet_posix_memalign
# define aligned_alloc jet_aligned_alloc
# define realloc jet_realloc
# define free jet_free
# define mallocx jet_mallocx
# define rallocx jet_rallocx
# define xallocx jet_xallocx
# define sallocx jet_sallocx
# define dallocx jet_dallocx
# define nallocx jet_nallocx
# define mallctl jet_mallctl
# define mallctlnametomib jet_mallctlnametomib
# define mallctlbymib jet_mallctlbymib
# define navsnprintf jet_navsnprintf
# define malloc_stats_print jet_malloc_stats_print
# define malloc_usable_size jet_malloc_usable_size
#endif
/*
* The jet_* macros can be used as stable alternative names for the
* public jemalloc API if JEMALLOC_NO_DEMANGLE is defined. This is primarily
* meant for use in jemalloc itself, but it can be used by application code to
* provide isolation from the name mangling specified via --with-mangling
* and/or --with-jemalloc-prefix.
*/
#ifndef JEMALLOC_NO_DEMANGLE
# undef jet_pool_create
# undef jet_pool_delete
# undef jet_pool_malloc
# undef jet_pool_calloc
# undef jet_pool_ralloc
# undef jet_pool_aligned_alloc
# undef jet_pool_free
# undef jet_pool_malloc_usable_size
# undef jet_pool_malloc_stats_print
# undef jet_pool_extend
# undef jet_pool_set_alloc_funcs
# undef jet_pool_check
# undef jet_malloc_conf
# undef jet_malloc_message
# undef jet_malloc
# undef jet_calloc
# undef jet_posix_memalign
# undef jet_aligned_alloc
# undef jet_realloc
# undef jet_free
# undef jet_mallocx
# undef jet_rallocx
# undef jet_xallocx
# undef jet_sallocx
# undef jet_dallocx
# undef jet_nallocx
# undef jet_mallctl
# undef jet_mallctlnametomib
# undef jet_mallctlbymib
# undef jet_navsnprintf
# undef jet_malloc_stats_print
# undef jet_malloc_usable_size
#endif
| 2,939 | 32.793103 | 79 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/jemalloc_gen/include/jemalloc/jemalloc_protos_jet.h
|
/*
* The jet_ prefix on the following public symbol declarations is an artifact
* of namespace management, and should be omitted in application code unless
* JEMALLOC_NO_DEMANGLE is defined (see jemalloc_mangle@[email protected]).
*/
extern JEMALLOC_EXPORT const char *jet_malloc_conf;
extern JEMALLOC_EXPORT void (*jet_malloc_message)(void *cbopaque,
const char *s);
typedef struct pool_s pool_t;
JEMALLOC_EXPORT pool_t *jet_pool_create(void *addr, size_t size, int zeroed);
JEMALLOC_EXPORT int jet_pool_delete(pool_t *pool);
JEMALLOC_EXPORT size_t jet_pool_extend(pool_t *pool, void *addr,
size_t size, int zeroed);
JEMALLOC_EXPORT void *jet_pool_malloc(pool_t *pool, size_t size);
JEMALLOC_EXPORT void *jet_pool_calloc(pool_t *pool, size_t nmemb, size_t size);
JEMALLOC_EXPORT void *jet_pool_ralloc(pool_t *pool, void *ptr, size_t size);
JEMALLOC_EXPORT void *jet_pool_aligned_alloc(pool_t *pool, size_t alignment, size_t size);
JEMALLOC_EXPORT void jet_pool_free(pool_t *pool, void *ptr);
JEMALLOC_EXPORT size_t jet_pool_malloc_usable_size(pool_t *pool, void *ptr);
JEMALLOC_EXPORT void jet_pool_malloc_stats_print(pool_t *pool,
void (*write_cb)(void *, const char *),
void *cbopaque, const char *opts);
JEMALLOC_EXPORT void jet_pool_set_alloc_funcs(void *(*malloc_func)(size_t),
void (*free_func)(void *));
JEMALLOC_EXPORT int jet_pool_check(pool_t *pool);
JEMALLOC_EXPORT void *jet_malloc(size_t size) JEMALLOC_ATTR(malloc);
JEMALLOC_EXPORT void *jet_calloc(size_t num, size_t size)
JEMALLOC_ATTR(malloc);
JEMALLOC_EXPORT int jet_posix_memalign(void **memptr, size_t alignment,
size_t size) JEMALLOC_ATTR(nonnull(1));
JEMALLOC_EXPORT void *jet_aligned_alloc(size_t alignment, size_t size)
JEMALLOC_ATTR(malloc);
JEMALLOC_EXPORT void *jet_realloc(void *ptr, size_t size);
JEMALLOC_EXPORT void jet_free(void *ptr);
JEMALLOC_EXPORT void *jet_mallocx(size_t size, int flags);
JEMALLOC_EXPORT void *jet_rallocx(void *ptr, size_t size, int flags);
JEMALLOC_EXPORT size_t jet_xallocx(void *ptr, size_t size, size_t extra,
int flags);
JEMALLOC_EXPORT size_t jet_sallocx(const void *ptr, int flags);
JEMALLOC_EXPORT void jet_dallocx(void *ptr, int flags);
JEMALLOC_EXPORT size_t jet_nallocx(size_t size, int flags);
JEMALLOC_EXPORT int jet_mallctl(const char *name, void *oldp,
size_t *oldlenp, void *newp, size_t newlen);
JEMALLOC_EXPORT int jet_mallctlnametomib(const char *name, size_t *mibp,
size_t *miblenp);
JEMALLOC_EXPORT int jet_mallctlbymib(const size_t *mib, size_t miblen,
void *oldp, size_t *oldlenp, void *newp, size_t newlen);
JEMALLOC_EXPORT void jet_malloc_stats_print(void (*write_cb)(void *,
const char *), void *jet_cbopaque, const char *opts);
JEMALLOC_EXPORT size_t jet_malloc_usable_size(
JEMALLOC_USABLE_SIZE_CONST void *ptr);
JEMALLOC_EXPORT int jet_navsnprintf(char *str, size_t size,
const char *format, va_list ap);
#ifdef JEMALLOC_OVERRIDE_MEMALIGN
JEMALLOC_EXPORT void * jet_memalign(size_t alignment, size_t size)
JEMALLOC_ATTR(malloc);
#endif
#ifdef JEMALLOC_OVERRIDE_VALLOC
JEMALLOC_EXPORT void * jet_valloc(size_t size) JEMALLOC_ATTR(malloc);
#endif
| 3,176 | 45.043478 | 91 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/jemalloc_gen/include/jemalloc/jemalloc_rename.h
|
/*
* Name mangling for public symbols is controlled by --with-mangling and
* --with-jemalloc-prefix. With default settings the je_ prefix is stripped by
* these macro definitions.
*/
#ifndef JEMALLOC_NO_RENAME
# define je_pool_create je_vmem_pool_create
# define je_pool_delete je_vmem_pool_delete
# define je_pool_malloc je_vmem_pool_malloc
# define je_pool_calloc je_vmem_pool_calloc
# define je_pool_ralloc je_vmem_pool_ralloc
# define je_pool_aligned_alloc je_vmem_pool_aligned_alloc
# define je_pool_free je_vmem_pool_free
# define je_pool_malloc_usable_size je_vmem_pool_malloc_usable_size
# define je_pool_malloc_stats_print je_vmem_pool_malloc_stats_print
# define je_pool_extend je_vmem_pool_extend
# define je_pool_set_alloc_funcs je_vmem_pool_set_alloc_funcs
# define je_pool_check je_vmem_pool_check
# define je_malloc_conf je_vmem_malloc_conf
# define je_malloc_message je_vmem_malloc_message
# define je_malloc je_vmem_malloc
# define je_calloc je_vmem_calloc
# define je_posix_memalign je_vmem_posix_memalign
# define je_aligned_alloc je_vmem_aligned_alloc
# define je_realloc je_vmem_realloc
# define je_free je_vmem_free
# define je_mallocx je_vmem_mallocx
# define je_rallocx je_vmem_rallocx
# define je_xallocx je_vmem_xallocx
# define je_sallocx je_vmem_sallocx
# define je_dallocx je_vmem_dallocx
# define je_nallocx je_vmem_nallocx
# define je_mallctl je_vmem_mallctl
# define je_mallctlnametomib je_vmem_mallctlnametomib
# define je_mallctlbymib je_vmem_mallctlbymib
# define je_navsnprintf je_vmem_navsnprintf
# define je_malloc_stats_print je_vmem_malloc_stats_print
# define je_malloc_usable_size je_vmem_malloc_usable_size
#endif
| 1,694 | 41.375 | 79 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/jemalloc_gen/include/jemalloc/jemalloc_mangle.h
|
/*
* By default application code must explicitly refer to mangled symbol names,
* so that it is possible to use jemalloc in conjunction with another allocator
* in the same application. Define JEMALLOC_MANGLE in order to cause automatic
* name mangling that matches the API prefixing that happened as a result of
* --with-mangling and/or --with-jemalloc-prefix configuration settings.
*/
#ifdef JEMALLOC_MANGLE
# ifndef JEMALLOC_NO_DEMANGLE
# define JEMALLOC_NO_DEMANGLE
# endif
# define pool_create je_pool_create
# define pool_delete je_pool_delete
# define pool_malloc je_pool_malloc
# define pool_calloc je_pool_calloc
# define pool_ralloc je_pool_ralloc
# define pool_aligned_alloc je_pool_aligned_alloc
# define pool_free je_pool_free
# define pool_malloc_usable_size je_pool_malloc_usable_size
# define pool_malloc_stats_print je_pool_malloc_stats_print
# define pool_extend je_pool_extend
# define pool_set_alloc_funcs je_pool_set_alloc_funcs
# define pool_check je_pool_check
# define malloc_conf je_malloc_conf
# define malloc_message je_malloc_message
# define malloc je_malloc
# define calloc je_calloc
# define posix_memalign je_posix_memalign
# define aligned_alloc je_aligned_alloc
# define realloc je_realloc
# define free je_free
# define mallocx je_mallocx
# define rallocx je_rallocx
# define xallocx je_xallocx
# define sallocx je_sallocx
# define dallocx je_dallocx
# define nallocx je_nallocx
# define mallctl je_mallctl
# define mallctlnametomib je_mallctlnametomib
# define mallctlbymib je_mallctlbymib
# define navsnprintf je_navsnprintf
# define malloc_stats_print je_malloc_stats_print
# define malloc_usable_size je_malloc_usable_size
#endif
/*
* The je_* macros can be used as stable alternative names for the
* public jemalloc API if JEMALLOC_NO_DEMANGLE is defined. This is primarily
* meant for use in jemalloc itself, but it can be used by application code to
* provide isolation from the name mangling specified via --with-mangling
* and/or --with-jemalloc-prefix.
*/
#ifndef JEMALLOC_NO_DEMANGLE
# undef je_pool_create
# undef je_pool_delete
# undef je_pool_malloc
# undef je_pool_calloc
# undef je_pool_ralloc
# undef je_pool_aligned_alloc
# undef je_pool_free
# undef je_pool_malloc_usable_size
# undef je_pool_malloc_stats_print
# undef je_pool_extend
# undef je_pool_set_alloc_funcs
# undef je_pool_check
# undef je_malloc_conf
# undef je_malloc_message
# undef je_malloc
# undef je_calloc
# undef je_posix_memalign
# undef je_aligned_alloc
# undef je_realloc
# undef je_free
# undef je_mallocx
# undef je_rallocx
# undef je_xallocx
# undef je_sallocx
# undef je_dallocx
# undef je_nallocx
# undef je_mallctl
# undef je_mallctlnametomib
# undef je_mallctlbymib
# undef je_navsnprintf
# undef je_malloc_stats_print
# undef je_malloc_usable_size
#endif
| 2,874 | 32.045977 | 79 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/jemalloc_gen/include/jemalloc/jemalloc.h
|
#ifndef JEMALLOC_H_
#define JEMALLOC_H_
#ifdef __cplusplus
extern "C" {
#endif
/* Defined if __attribute__((...)) syntax is supported. */
/* #undef JEMALLOC_HAVE_ATTR */
/* Defined if alloc_size attribute is supported. */
/* #undef JEMALLOC_HAVE_ATTR_ALLOC_SIZE */
/* Defined if format(gnu_printf, ...) attribute is supported. */
/* #undef JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF */
/* Defined if format(printf, ...) attribute is supported. */
/* #undef JEMALLOC_HAVE_ATTR_FORMAT_PRINTF */
/*
* Define overrides for non-standard allocator-related functions if they are
* present on the system.
*/
/* #undef JEMALLOC_OVERRIDE_MEMALIGN */
/* #undef JEMALLOC_OVERRIDE_VALLOC */
/*
* At least Linux omits the "const" in:
*
* size_t malloc_usable_size(const void *ptr);
*
* Match the operating system's prototype.
*/
#define JEMALLOC_USABLE_SIZE_CONST const
/*
* If defined, specify throw() for the public function prototypes when compiling
* with C++. The only justification for this is to match the prototypes that
* glibc defines.
*/
/* #undef JEMALLOC_USE_CXX_THROW */
#ifdef _MSC_VER
# ifdef _WIN64
# define LG_SIZEOF_PTR_WIN 3
# else
# define LG_SIZEOF_PTR_WIN 2
# endif
#endif
/* sizeof(void *) == 2^LG_SIZEOF_PTR. */
#define LG_SIZEOF_PTR LG_SIZEOF_PTR_WIN
/*
* Name mangling for public symbols is controlled by --with-mangling and
* --with-jemalloc-prefix. With default settings the je_ prefix is stripped by
* these macro definitions.
*/
#ifndef JEMALLOC_NO_RENAME
# define je_pool_create je_vmem_pool_create
# define je_pool_delete je_vmem_pool_delete
# define je_pool_malloc je_vmem_pool_malloc
# define je_pool_calloc je_vmem_pool_calloc
# define je_pool_ralloc je_vmem_pool_ralloc
# define je_pool_aligned_alloc je_vmem_pool_aligned_alloc
# define je_pool_free je_vmem_pool_free
# define je_pool_malloc_usable_size je_vmem_pool_malloc_usable_size
# define je_pool_malloc_stats_print je_vmem_pool_malloc_stats_print
# define je_pool_extend je_vmem_pool_extend
# define je_pool_set_alloc_funcs je_vmem_pool_set_alloc_funcs
# define je_pool_check je_vmem_pool_check
# define je_malloc_conf je_vmem_malloc_conf
# define je_malloc_message je_vmem_malloc_message
# define je_malloc je_vmem_malloc
# define je_calloc je_vmem_calloc
# define je_posix_memalign je_vmem_posix_memalign
# define je_aligned_alloc je_vmem_aligned_alloc
# define je_realloc je_vmem_realloc
# define je_free je_vmem_free
# define je_mallocx je_vmem_mallocx
# define je_rallocx je_vmem_rallocx
# define je_xallocx je_vmem_xallocx
# define je_sallocx je_vmem_sallocx
# define je_dallocx je_vmem_dallocx
# define je_nallocx je_vmem_nallocx
# define je_mallctl je_vmem_mallctl
# define je_mallctlnametomib je_vmem_mallctlnametomib
# define je_mallctlbymib je_vmem_mallctlbymib
# define je_navsnprintf je_vmem_navsnprintf
# define je_malloc_stats_print je_vmem_malloc_stats_print
# define je_malloc_usable_size je_vmem_malloc_usable_size
#endif
#include <limits.h>
#include <strings.h>
#include <stdbool.h>
#include <stdarg.h>
#define JEMALLOC_VERSION ""
#define JEMALLOC_VERSION_MAJOR
#define JEMALLOC_VERSION_MINOR
#define JEMALLOC_VERSION_BUGFIX
#define JEMALLOC_VERSION_NREV
#define JEMALLOC_VERSION_GID ""
# define MALLOCX_LG_ALIGN(la) (la)
# if LG_SIZEOF_PTR == 2
# define MALLOCX_ALIGN(a) (ffs(a)-1)
# else
# define MALLOCX_ALIGN(a) \
(((a) < (size_t)INT_MAX) ? ffs(a)-1 : ffs((a)>>32)+31)
# endif
# define MALLOCX_ZERO ((int)0x40)
/* Bias arena index bits so that 0 encodes "MALLOCX_ARENA() unspecified". */
# define MALLOCX_ARENA(a) ((int)(((a)+1) << 8))
#ifdef JEMALLOC_HAVE_ATTR
# define JEMALLOC_ATTR(s) __attribute__((s))
# define JEMALLOC_EXPORT JEMALLOC_ATTR(visibility("default"))
# define JEMALLOC_ALIGNED(s) JEMALLOC_ATTR(aligned(s))
# define JEMALLOC_SECTION(s) JEMALLOC_ATTR(section(s))
# define JEMALLOC_NOINLINE JEMALLOC_ATTR(noinline)
#elif _MSC_VER
# define JEMALLOC_ATTR(s)
# ifndef JEMALLOC_EXPORT
# ifdef DLLEXPORT
# define JEMALLOC_EXPORT __declspec(dllexport)
# else
# define JEMALLOC_EXPORT __declspec(dllimport)
# endif
# endif
# define JEMALLOC_ALIGNED(s) __declspec(align(s))
# define JEMALLOC_SECTION(s) __declspec(allocate(s))
# define JEMALLOC_NOINLINE __declspec(noinline)
#else
# define JEMALLOC_ATTR(s)
# define JEMALLOC_EXPORT
# define JEMALLOC_ALIGNED(s)
# define JEMALLOC_SECTION(s)
# define JEMALLOC_NOINLINE
#endif
/*
* The je_ prefix on the following public symbol declarations is an artifact
* of namespace management, and should be omitted in application code unless
* JEMALLOC_NO_DEMANGLE is defined (see jemalloc_mangle.h).
*/
extern JEMALLOC_EXPORT const char *je_malloc_conf;
extern JEMALLOC_EXPORT void (*je_malloc_message)(void *cbopaque,
const char *s);
typedef struct pool_s pool_t;
JEMALLOC_EXPORT pool_t *je_pool_create(void *addr, size_t size, int zeroed, int empty);
JEMALLOC_EXPORT int je_pool_delete(pool_t *pool);
JEMALLOC_EXPORT size_t je_pool_extend(pool_t *pool, void *addr,
size_t size, int zeroed);
JEMALLOC_EXPORT void *je_pool_malloc(pool_t *pool, size_t size);
JEMALLOC_EXPORT void *je_pool_calloc(pool_t *pool, size_t nmemb, size_t size);
JEMALLOC_EXPORT void *je_pool_ralloc(pool_t *pool, void *ptr, size_t size);
JEMALLOC_EXPORT void *je_pool_aligned_alloc(pool_t *pool, size_t alignment, size_t size);
JEMALLOC_EXPORT void je_pool_free(pool_t *pool, void *ptr);
JEMALLOC_EXPORT size_t je_pool_malloc_usable_size(pool_t *pool, void *ptr);
JEMALLOC_EXPORT void je_pool_malloc_stats_print(pool_t *pool,
void (*write_cb)(void *, const char *),
void *cbopaque, const char *opts);
JEMALLOC_EXPORT void je_pool_set_alloc_funcs(void *(*malloc_func)(size_t),
void (*free_func)(void *));
JEMALLOC_EXPORT int je_pool_check(pool_t *pool);
JEMALLOC_EXPORT void *je_malloc(size_t size) JEMALLOC_ATTR(malloc);
JEMALLOC_EXPORT void *je_calloc(size_t num, size_t size)
JEMALLOC_ATTR(malloc);
JEMALLOC_EXPORT int je_posix_memalign(void **memptr, size_t alignment,
size_t size) JEMALLOC_ATTR(nonnull(1));
JEMALLOC_EXPORT void *je_aligned_alloc(size_t alignment, size_t size)
JEMALLOC_ATTR(malloc);
JEMALLOC_EXPORT void *je_realloc(void *ptr, size_t size);
JEMALLOC_EXPORT void je_free(void *ptr);
JEMALLOC_EXPORT void *je_mallocx(size_t size, int flags);
JEMALLOC_EXPORT void *je_rallocx(void *ptr, size_t size, int flags);
JEMALLOC_EXPORT size_t je_xallocx(void *ptr, size_t size, size_t extra,
int flags);
JEMALLOC_EXPORT size_t je_sallocx(const void *ptr, int flags);
JEMALLOC_EXPORT void je_dallocx(void *ptr, int flags);
JEMALLOC_EXPORT size_t je_nallocx(size_t size, int flags);
JEMALLOC_EXPORT int je_mallctl(const char *name, void *oldp,
size_t *oldlenp, void *newp, size_t newlen);
JEMALLOC_EXPORT int je_mallctlnametomib(const char *name, size_t *mibp,
size_t *miblenp);
JEMALLOC_EXPORT int je_mallctlbymib(const size_t *mib, size_t miblen,
void *oldp, size_t *oldlenp, void *newp, size_t newlen);
JEMALLOC_EXPORT void je_malloc_stats_print(void (*write_cb)(void *,
const char *), void *je_cbopaque, const char *opts);
JEMALLOC_EXPORT size_t je_malloc_usable_size(
JEMALLOC_USABLE_SIZE_CONST void *ptr);
JEMALLOC_EXPORT int je_navsnprintf(char *str, size_t size,
const char *format, va_list ap);
#ifdef JEMALLOC_OVERRIDE_MEMALIGN
JEMALLOC_EXPORT void * je_memalign(size_t alignment, size_t size)
JEMALLOC_ATTR(malloc);
#endif
#ifdef JEMALLOC_OVERRIDE_VALLOC
JEMALLOC_EXPORT void * je_valloc(size_t size) JEMALLOC_ATTR(malloc);
#endif
typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, unsigned, pool_t *);
typedef bool (chunk_dalloc_t)(void *, size_t, unsigned, pool_t *);
/*
* By default application code must explicitly refer to mangled symbol names,
* so that it is possible to use jemalloc in conjunction with another allocator
* in the same application. Define JEMALLOC_MANGLE in order to cause automatic
* name mangling that matches the API prefixing that happened as a result of
* --with-mangling and/or --with-jemalloc-prefix configuration settings.
*/
#ifdef JEMALLOC_MANGLE
# ifndef JEMALLOC_NO_DEMANGLE
# define JEMALLOC_NO_DEMANGLE
# endif
# define pool_create je_pool_create
# define pool_delete je_pool_delete
# define pool_malloc je_pool_malloc
# define pool_calloc je_pool_calloc
# define pool_ralloc je_pool_ralloc
# define pool_aligned_alloc je_pool_aligned_alloc
# define pool_free je_pool_free
# define pool_malloc_usable_size je_pool_malloc_usable_size
# define pool_malloc_stats_print je_pool_malloc_stats_print
# define pool_extend je_pool_extend
# define pool_set_alloc_funcs je_pool_set_alloc_funcs
# define pool_check je_pool_check
# define malloc_conf je_malloc_conf
# define malloc_message je_malloc_message
# define malloc je_malloc
# define calloc je_calloc
# define posix_memalign je_posix_memalign
# define aligned_alloc je_aligned_alloc
# define realloc je_realloc
# define free je_free
# define mallocx je_mallocx
# define rallocx je_rallocx
# define xallocx je_xallocx
# define sallocx je_sallocx
# define dallocx je_dallocx
# define nallocx je_nallocx
# define mallctl je_mallctl
# define mallctlnametomib je_mallctlnametomib
# define mallctlbymib je_mallctlbymib
# define navsnprintf je_navsnprintf
# define malloc_stats_print je_malloc_stats_print
# define malloc_usable_size je_malloc_usable_size
#endif
/*
* The je_* macros can be used as stable alternative names for the
* public jemalloc API if JEMALLOC_NO_DEMANGLE is defined. This is primarily
* meant for use in jemalloc itself, but it can be used by application code to
* provide isolation from the name mangling specified via --with-mangling
* and/or --with-jemalloc-prefix.
*/
#ifndef JEMALLOC_NO_DEMANGLE
# undef je_pool_create
# undef je_pool_delete
# undef je_pool_malloc
# undef je_pool_calloc
# undef je_pool_ralloc
# undef je_pool_aligned_alloc
# undef je_pool_free
# undef je_pool_malloc_usable_size
# undef je_pool_malloc_stats_print
# undef je_pool_extend
# undef je_pool_set_alloc_funcs
# undef je_pool_check
# undef je_malloc_conf
# undef je_malloc_message
# undef je_malloc
# undef je_calloc
# undef je_posix_memalign
# undef je_aligned_alloc
# undef je_realloc
# undef je_free
# undef je_mallocx
# undef je_rallocx
# undef je_xallocx
# undef je_sallocx
# undef je_dallocx
# undef je_nallocx
# undef je_mallctl
# undef je_mallctlnametomib
# undef je_mallctlbymib
# undef je_navsnprintf
# undef je_malloc_stats_print
# undef je_malloc_usable_size
#endif
#ifdef __cplusplus
}
#endif
#endif /* JEMALLOC_H_ */
| 10,674 | 34 | 90 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/jemalloc_gen/include/jemalloc/jemalloc_protos.h
|
/*
* The je_ prefix on the following public symbol declarations is an artifact
* of namespace management, and should be omitted in application code unless
* JEMALLOC_NO_DEMANGLE is defined (see jemalloc_mangle.h).
*/
extern JEMALLOC_EXPORT const char *je_malloc_conf;
extern JEMALLOC_EXPORT void (*je_malloc_message)(void *cbopaque,
const char *s);
typedef struct pool_s pool_t;
JEMALLOC_EXPORT pool_t *je_pool_create(void *addr, size_t size, int zeroed);
JEMALLOC_EXPORT int je_pool_delete(pool_t *pool);
JEMALLOC_EXPORT size_t je_pool_extend(pool_t *pool, void *addr,
size_t size, int zeroed);
JEMALLOC_EXPORT void *je_pool_malloc(pool_t *pool, size_t size);
JEMALLOC_EXPORT void *je_pool_calloc(pool_t *pool, size_t nmemb, size_t size);
JEMALLOC_EXPORT void *je_pool_ralloc(pool_t *pool, void *ptr, size_t size);
JEMALLOC_EXPORT void *je_pool_aligned_alloc(pool_t *pool, size_t alignment, size_t size);
JEMALLOC_EXPORT void je_pool_free(pool_t *pool, void *ptr);
JEMALLOC_EXPORT size_t je_pool_malloc_usable_size(pool_t *pool, void *ptr);
JEMALLOC_EXPORT void je_pool_malloc_stats_print(pool_t *pool,
void (*write_cb)(void *, const char *),
void *cbopaque, const char *opts);
JEMALLOC_EXPORT void je_pool_set_alloc_funcs(void *(*malloc_func)(size_t),
void (*free_func)(void *));
JEMALLOC_EXPORT int je_pool_check(pool_t *pool);
JEMALLOC_EXPORT void *je_malloc(size_t size) JEMALLOC_ATTR(malloc);
JEMALLOC_EXPORT void *je_calloc(size_t num, size_t size)
JEMALLOC_ATTR(malloc);
JEMALLOC_EXPORT int je_posix_memalign(void **memptr, size_t alignment,
size_t size) JEMALLOC_ATTR(nonnull(1));
JEMALLOC_EXPORT void *je_aligned_alloc(size_t alignment, size_t size)
JEMALLOC_ATTR(malloc);
JEMALLOC_EXPORT void *je_realloc(void *ptr, size_t size);
JEMALLOC_EXPORT void je_free(void *ptr);
JEMALLOC_EXPORT void *je_mallocx(size_t size, int flags);
JEMALLOC_EXPORT void *je_rallocx(void *ptr, size_t size, int flags);
JEMALLOC_EXPORT size_t je_xallocx(void *ptr, size_t size, size_t extra,
int flags);
JEMALLOC_EXPORT size_t je_sallocx(const void *ptr, int flags);
JEMALLOC_EXPORT void je_dallocx(void *ptr, int flags);
JEMALLOC_EXPORT size_t je_nallocx(size_t size, int flags);
JEMALLOC_EXPORT int je_mallctl(const char *name, void *oldp,
size_t *oldlenp, void *newp, size_t newlen);
JEMALLOC_EXPORT int je_mallctlnametomib(const char *name, size_t *mibp,
size_t *miblenp);
JEMALLOC_EXPORT int je_mallctlbymib(const size_t *mib, size_t miblen,
void *oldp, size_t *oldlenp, void *newp, size_t newlen);
JEMALLOC_EXPORT void je_malloc_stats_print(void (*write_cb)(void *,
const char *), void *je_cbopaque, const char *opts);
JEMALLOC_EXPORT size_t je_malloc_usable_size(
JEMALLOC_USABLE_SIZE_CONST void *ptr);
JEMALLOC_EXPORT int je_navsnprintf(char *str, size_t size,
const char *format, va_list ap);
#ifdef JEMALLOC_OVERRIDE_MEMALIGN
JEMALLOC_EXPORT void * je_memalign(size_t alignment, size_t size)
JEMALLOC_ATTR(malloc);
#endif
#ifdef JEMALLOC_OVERRIDE_VALLOC
JEMALLOC_EXPORT void * je_valloc(size_t size) JEMALLOC_ATTR(malloc);
#endif
| 3,124 | 44.289855 | 90 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/jemalloc_gen/include/jemalloc/jemalloc_typedefs.h
|
typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, unsigned, pool_t *);
typedef bool (chunk_dalloc_t)(void *, size_t, unsigned, pool_t *);
| 150 | 49.333333 | 82 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/jemalloc_gen/include/jemalloc/jemalloc_macros.h
|
#include <limits.h>
#include <strings.h>
#include <stdbool.h>
#include <stdarg.h>
#define JEMALLOC_VERSION ""
#define JEMALLOC_VERSION_MAJOR
#define JEMALLOC_VERSION_MINOR
#define JEMALLOC_VERSION_BUGFIX
#define JEMALLOC_VERSION_NREV
#define JEMALLOC_VERSION_GID ""
# define MALLOCX_LG_ALIGN(la) (la)
# if LG_SIZEOF_PTR == 2
# define MALLOCX_ALIGN(a) (ffs(a)-1)
# else
# define MALLOCX_ALIGN(a) \
(((a) < (size_t)INT_MAX) ? ffs(a)-1 : ffs((a)>>32)+31)
# endif
# define MALLOCX_ZERO ((int)0x40)
/* Bias arena index bits so that 0 encodes "MALLOCX_ARENA() unspecified". */
# define MALLOCX_ARENA(a) ((int)(((a)+1) << 8))
#ifdef JEMALLOC_HAVE_ATTR
# define JEMALLOC_ATTR(s) __attribute__((s))
# define JEMALLOC_EXPORT JEMALLOC_ATTR(visibility("default"))
# define JEMALLOC_ALIGNED(s) JEMALLOC_ATTR(aligned(s))
# define JEMALLOC_SECTION(s) JEMALLOC_ATTR(section(s))
# define JEMALLOC_NOINLINE JEMALLOC_ATTR(noinline)
#elif _MSC_VER
# define JEMALLOC_ATTR(s)
# ifdef DLLEXPORT
# define JEMALLOC_EXPORT __declspec(dllexport)
# else
# define JEMALLOC_EXPORT __declspec(dllimport)
# endif
# define JEMALLOC_ALIGNED(s) __declspec(align(s))
# define JEMALLOC_SECTION(s) __declspec(allocate(s))
# define JEMALLOC_NOINLINE __declspec(noinline)
#else
# define JEMALLOC_ATTR(s)
# define JEMALLOC_EXPORT
# define JEMALLOC_ALIGNED(s)
# define JEMALLOC_SECTION(s)
# define JEMALLOC_NOINLINE
#endif
| 1,426 | 29.361702 | 76 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/jemalloc_gen/include/jemalloc/internal/size_classes.h
|
/* This file was automatically generated by size_classes.sh. */
/******************************************************************************/
#ifdef JEMALLOC_H_TYPES
/*
* This header requires LG_SIZEOF_PTR, LG_TINY_MIN, LG_QUANTUM, and LG_PAGE to
* be defined prior to inclusion, and it in turn defines:
*
* LG_SIZE_CLASS_GROUP: Lg of size class count for each size doubling.
* SIZE_CLASSES: Complete table of
* SC(index, lg_delta, size, bin, lg_delta_lookup) tuples.
* index: Size class index.
* lg_grp: Lg group base size (no deltas added).
* lg_delta: Lg delta to previous size class.
* ndelta: Delta multiplier. size == 1<<lg_grp + ndelta<<lg_delta
* bin: 'yes' if a small bin size class, 'no' otherwise.
* lg_delta_lookup: Same as lg_delta if a lookup table size class, 'no'
* otherwise.
* NTBINS: Number of tiny bins.
* NLBINS: Number of bins supported by the lookup table.
* NBINS: Number of small size class bins.
* LG_TINY_MAXCLASS: Lg of maximum tiny size class.
* LOOKUP_MAXCLASS: Maximum size class included in lookup table.
* SMALL_MAXCLASS: Maximum small size class.
*/
#define LG_SIZE_CLASS_GROUP 2
#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 3 && LG_PAGE == 12)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 3, 3, 0, yes, 3) \
SC( 1, 3, 3, 1, yes, 3) \
SC( 2, 3, 3, 2, yes, 3) \
SC( 3, 3, 3, 3, yes, 3) \
\
SC( 4, 5, 3, 1, yes, 3) \
SC( 5, 5, 3, 2, yes, 3) \
SC( 6, 5, 3, 3, yes, 3) \
SC( 7, 5, 3, 4, yes, 3) \
\
SC( 8, 6, 4, 1, yes, 4) \
SC( 9, 6, 4, 2, yes, 4) \
SC( 10, 6, 4, 3, yes, 4) \
SC( 11, 6, 4, 4, yes, 4) \
\
SC( 12, 7, 5, 1, yes, 5) \
SC( 13, 7, 5, 2, yes, 5) \
SC( 14, 7, 5, 3, yes, 5) \
SC( 15, 7, 5, 4, yes, 5) \
\
SC( 16, 8, 6, 1, yes, 6) \
SC( 17, 8, 6, 2, yes, 6) \
SC( 18, 8, 6, 3, yes, 6) \
SC( 19, 8, 6, 4, yes, 6) \
\
SC( 20, 9, 7, 1, yes, 7) \
SC( 21, 9, 7, 2, yes, 7) \
SC( 22, 9, 7, 3, yes, 7) \
SC( 23, 9, 7, 4, yes, 7) \
\
SC( 24, 10, 8, 1, yes, 8) \
SC( 25, 10, 8, 2, yes, 8) \
SC( 26, 10, 8, 3, yes, 8) \
SC( 27, 10, 8, 4, yes, 8) \
\
SC( 28, 11, 9, 1, yes, 9) \
SC( 29, 11, 9, 2, yes, 9) \
SC( 30, 11, 9, 3, yes, 9) \
SC( 31, 11, 9, 4, no, 9) \
\
SC( 32, 12, 10, 1, no, no) \
SC( 33, 12, 10, 2, no, no) \
SC( 34, 12, 10, 3, no, no) \
SC( 35, 12, 10, 4, no, no) \
\
SC( 36, 13, 11, 1, no, no) \
SC( 37, 13, 11, 2, no, no) \
SC( 38, 13, 11, 3, no, no) \
SC( 39, 13, 11, 4, no, no) \
\
SC( 40, 14, 12, 1, no, no) \
SC( 41, 14, 12, 2, no, no) \
SC( 42, 14, 12, 3, no, no) \
SC( 43, 14, 12, 4, no, no) \
\
SC( 44, 15, 13, 1, no, no) \
SC( 45, 15, 13, 2, no, no) \
SC( 46, 15, 13, 3, no, no) \
SC( 47, 15, 13, 4, no, no) \
\
SC( 48, 16, 14, 1, no, no) \
SC( 49, 16, 14, 2, no, no) \
SC( 50, 16, 14, 3, no, no) \
SC( 51, 16, 14, 4, no, no) \
\
SC( 52, 17, 15, 1, no, no) \
SC( 53, 17, 15, 2, no, no) \
SC( 54, 17, 15, 3, no, no) \
SC( 55, 17, 15, 4, no, no) \
\
SC( 56, 18, 16, 1, no, no) \
SC( 57, 18, 16, 2, no, no) \
SC( 58, 18, 16, 3, no, no) \
SC( 59, 18, 16, 4, no, no) \
\
SC( 60, 19, 17, 1, no, no) \
SC( 61, 19, 17, 2, no, no) \
SC( 62, 19, 17, 3, no, no) \
SC( 63, 19, 17, 4, no, no) \
\
SC( 64, 20, 18, 1, no, no) \
SC( 65, 20, 18, 2, no, no) \
SC( 66, 20, 18, 3, no, no) \
SC( 67, 20, 18, 4, no, no) \
\
SC( 68, 21, 19, 1, no, no) \
SC( 69, 21, 19, 2, no, no) \
SC( 70, 21, 19, 3, no, no) \
SC( 71, 21, 19, 4, no, no) \
\
SC( 72, 22, 20, 1, no, no) \
SC( 73, 22, 20, 2, no, no) \
SC( 74, 22, 20, 3, no, no) \
SC( 75, 22, 20, 4, no, no) \
\
SC( 76, 23, 21, 1, no, no) \
SC( 77, 23, 21, 2, no, no) \
SC( 78, 23, 21, 3, no, no) \
SC( 79, 23, 21, 4, no, no) \
\
SC( 80, 24, 22, 1, no, no) \
SC( 81, 24, 22, 2, no, no) \
SC( 82, 24, 22, 3, no, no) \
SC( 83, 24, 22, 4, no, no) \
\
SC( 84, 25, 23, 1, no, no) \
SC( 85, 25, 23, 2, no, no) \
SC( 86, 25, 23, 3, no, no) \
SC( 87, 25, 23, 4, no, no) \
\
SC( 88, 26, 24, 1, no, no) \
SC( 89, 26, 24, 2, no, no) \
SC( 90, 26, 24, 3, no, no) \
SC( 91, 26, 24, 4, no, no) \
\
SC( 92, 27, 25, 1, no, no) \
SC( 93, 27, 25, 2, no, no) \
SC( 94, 27, 25, 3, no, no) \
SC( 95, 27, 25, 4, no, no) \
\
SC( 96, 28, 26, 1, no, no) \
SC( 97, 28, 26, 2, no, no) \
SC( 98, 28, 26, 3, no, no) \
SC( 99, 28, 26, 4, no, no) \
\
SC(100, 29, 27, 1, no, no) \
SC(101, 29, 27, 2, no, no) \
SC(102, 29, 27, 3, no, no) \
SC(103, 29, 27, 4, no, no) \
\
SC(104, 30, 28, 1, no, no) \
SC(105, 30, 28, 2, no, no) \
SC(106, 30, 28, 3, no, no) \
SC(107, 30, 28, 4, no, no) \
\
SC(108, 31, 29, 1, no, no) \
SC(109, 31, 29, 2, no, no) \
SC(110, 31, 29, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 0
#define NLBINS 32
#define NBINS 31
#define LG_TINY_MAXCLASS "NA"
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 11) + (((size_t)3) << 9))
#endif
#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 3 && LG_PAGE == 13)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 3, 3, 0, yes, 3) \
SC( 1, 3, 3, 1, yes, 3) \
SC( 2, 3, 3, 2, yes, 3) \
SC( 3, 3, 3, 3, yes, 3) \
\
SC( 4, 5, 3, 1, yes, 3) \
SC( 5, 5, 3, 2, yes, 3) \
SC( 6, 5, 3, 3, yes, 3) \
SC( 7, 5, 3, 4, yes, 3) \
\
SC( 8, 6, 4, 1, yes, 4) \
SC( 9, 6, 4, 2, yes, 4) \
SC( 10, 6, 4, 3, yes, 4) \
SC( 11, 6, 4, 4, yes, 4) \
\
SC( 12, 7, 5, 1, yes, 5) \
SC( 13, 7, 5, 2, yes, 5) \
SC( 14, 7, 5, 3, yes, 5) \
SC( 15, 7, 5, 4, yes, 5) \
\
SC( 16, 8, 6, 1, yes, 6) \
SC( 17, 8, 6, 2, yes, 6) \
SC( 18, 8, 6, 3, yes, 6) \
SC( 19, 8, 6, 4, yes, 6) \
\
SC( 20, 9, 7, 1, yes, 7) \
SC( 21, 9, 7, 2, yes, 7) \
SC( 22, 9, 7, 3, yes, 7) \
SC( 23, 9, 7, 4, yes, 7) \
\
SC( 24, 10, 8, 1, yes, 8) \
SC( 25, 10, 8, 2, yes, 8) \
SC( 26, 10, 8, 3, yes, 8) \
SC( 27, 10, 8, 4, yes, 8) \
\
SC( 28, 11, 9, 1, yes, 9) \
SC( 29, 11, 9, 2, yes, 9) \
SC( 30, 11, 9, 3, yes, 9) \
SC( 31, 11, 9, 4, yes, 9) \
\
SC( 32, 12, 10, 1, yes, no) \
SC( 33, 12, 10, 2, yes, no) \
SC( 34, 12, 10, 3, yes, no) \
SC( 35, 12, 10, 4, no, no) \
\
SC( 36, 13, 11, 1, no, no) \
SC( 37, 13, 11, 2, no, no) \
SC( 38, 13, 11, 3, no, no) \
SC( 39, 13, 11, 4, no, no) \
\
SC( 40, 14, 12, 1, no, no) \
SC( 41, 14, 12, 2, no, no) \
SC( 42, 14, 12, 3, no, no) \
SC( 43, 14, 12, 4, no, no) \
\
SC( 44, 15, 13, 1, no, no) \
SC( 45, 15, 13, 2, no, no) \
SC( 46, 15, 13, 3, no, no) \
SC( 47, 15, 13, 4, no, no) \
\
SC( 48, 16, 14, 1, no, no) \
SC( 49, 16, 14, 2, no, no) \
SC( 50, 16, 14, 3, no, no) \
SC( 51, 16, 14, 4, no, no) \
\
SC( 52, 17, 15, 1, no, no) \
SC( 53, 17, 15, 2, no, no) \
SC( 54, 17, 15, 3, no, no) \
SC( 55, 17, 15, 4, no, no) \
\
SC( 56, 18, 16, 1, no, no) \
SC( 57, 18, 16, 2, no, no) \
SC( 58, 18, 16, 3, no, no) \
SC( 59, 18, 16, 4, no, no) \
\
SC( 60, 19, 17, 1, no, no) \
SC( 61, 19, 17, 2, no, no) \
SC( 62, 19, 17, 3, no, no) \
SC( 63, 19, 17, 4, no, no) \
\
SC( 64, 20, 18, 1, no, no) \
SC( 65, 20, 18, 2, no, no) \
SC( 66, 20, 18, 3, no, no) \
SC( 67, 20, 18, 4, no, no) \
\
SC( 68, 21, 19, 1, no, no) \
SC( 69, 21, 19, 2, no, no) \
SC( 70, 21, 19, 3, no, no) \
SC( 71, 21, 19, 4, no, no) \
\
SC( 72, 22, 20, 1, no, no) \
SC( 73, 22, 20, 2, no, no) \
SC( 74, 22, 20, 3, no, no) \
SC( 75, 22, 20, 4, no, no) \
\
SC( 76, 23, 21, 1, no, no) \
SC( 77, 23, 21, 2, no, no) \
SC( 78, 23, 21, 3, no, no) \
SC( 79, 23, 21, 4, no, no) \
\
SC( 80, 24, 22, 1, no, no) \
SC( 81, 24, 22, 2, no, no) \
SC( 82, 24, 22, 3, no, no) \
SC( 83, 24, 22, 4, no, no) \
\
SC( 84, 25, 23, 1, no, no) \
SC( 85, 25, 23, 2, no, no) \
SC( 86, 25, 23, 3, no, no) \
SC( 87, 25, 23, 4, no, no) \
\
SC( 88, 26, 24, 1, no, no) \
SC( 89, 26, 24, 2, no, no) \
SC( 90, 26, 24, 3, no, no) \
SC( 91, 26, 24, 4, no, no) \
\
SC( 92, 27, 25, 1, no, no) \
SC( 93, 27, 25, 2, no, no) \
SC( 94, 27, 25, 3, no, no) \
SC( 95, 27, 25, 4, no, no) \
\
SC( 96, 28, 26, 1, no, no) \
SC( 97, 28, 26, 2, no, no) \
SC( 98, 28, 26, 3, no, no) \
SC( 99, 28, 26, 4, no, no) \
\
SC(100, 29, 27, 1, no, no) \
SC(101, 29, 27, 2, no, no) \
SC(102, 29, 27, 3, no, no) \
SC(103, 29, 27, 4, no, no) \
\
SC(104, 30, 28, 1, no, no) \
SC(105, 30, 28, 2, no, no) \
SC(106, 30, 28, 3, no, no) \
SC(107, 30, 28, 4, no, no) \
\
SC(108, 31, 29, 1, no, no) \
SC(109, 31, 29, 2, no, no) \
SC(110, 31, 29, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 0
#define NLBINS 32
#define NBINS 35
#define LG_TINY_MAXCLASS "NA"
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 12) + (((size_t)3) << 10))
#endif
#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 3 && LG_PAGE == 16)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 3, 3, 0, yes, 3) \
SC( 1, 3, 3, 1, yes, 3) \
SC( 2, 3, 3, 2, yes, 3) \
SC( 3, 3, 3, 3, yes, 3) \
\
SC( 4, 5, 3, 1, yes, 3) \
SC( 5, 5, 3, 2, yes, 3) \
SC( 6, 5, 3, 3, yes, 3) \
SC( 7, 5, 3, 4, yes, 3) \
\
SC( 8, 6, 4, 1, yes, 4) \
SC( 9, 6, 4, 2, yes, 4) \
SC( 10, 6, 4, 3, yes, 4) \
SC( 11, 6, 4, 4, yes, 4) \
\
SC( 12, 7, 5, 1, yes, 5) \
SC( 13, 7, 5, 2, yes, 5) \
SC( 14, 7, 5, 3, yes, 5) \
SC( 15, 7, 5, 4, yes, 5) \
\
SC( 16, 8, 6, 1, yes, 6) \
SC( 17, 8, 6, 2, yes, 6) \
SC( 18, 8, 6, 3, yes, 6) \
SC( 19, 8, 6, 4, yes, 6) \
\
SC( 20, 9, 7, 1, yes, 7) \
SC( 21, 9, 7, 2, yes, 7) \
SC( 22, 9, 7, 3, yes, 7) \
SC( 23, 9, 7, 4, yes, 7) \
\
SC( 24, 10, 8, 1, yes, 8) \
SC( 25, 10, 8, 2, yes, 8) \
SC( 26, 10, 8, 3, yes, 8) \
SC( 27, 10, 8, 4, yes, 8) \
\
SC( 28, 11, 9, 1, yes, 9) \
SC( 29, 11, 9, 2, yes, 9) \
SC( 30, 11, 9, 3, yes, 9) \
SC( 31, 11, 9, 4, yes, 9) \
\
SC( 32, 12, 10, 1, yes, no) \
SC( 33, 12, 10, 2, yes, no) \
SC( 34, 12, 10, 3, yes, no) \
SC( 35, 12, 10, 4, yes, no) \
\
SC( 36, 13, 11, 1, yes, no) \
SC( 37, 13, 11, 2, yes, no) \
SC( 38, 13, 11, 3, yes, no) \
SC( 39, 13, 11, 4, yes, no) \
\
SC( 40, 14, 12, 1, yes, no) \
SC( 41, 14, 12, 2, yes, no) \
SC( 42, 14, 12, 3, yes, no) \
SC( 43, 14, 12, 4, yes, no) \
\
SC( 44, 15, 13, 1, yes, no) \
SC( 45, 15, 13, 2, yes, no) \
SC( 46, 15, 13, 3, yes, no) \
SC( 47, 15, 13, 4, no, no) \
\
SC( 48, 16, 14, 1, no, no) \
SC( 49, 16, 14, 2, no, no) \
SC( 50, 16, 14, 3, no, no) \
SC( 51, 16, 14, 4, no, no) \
\
SC( 52, 17, 15, 1, no, no) \
SC( 53, 17, 15, 2, no, no) \
SC( 54, 17, 15, 3, no, no) \
SC( 55, 17, 15, 4, no, no) \
\
SC( 56, 18, 16, 1, no, no) \
SC( 57, 18, 16, 2, no, no) \
SC( 58, 18, 16, 3, no, no) \
SC( 59, 18, 16, 4, no, no) \
\
SC( 60, 19, 17, 1, no, no) \
SC( 61, 19, 17, 2, no, no) \
SC( 62, 19, 17, 3, no, no) \
SC( 63, 19, 17, 4, no, no) \
\
SC( 64, 20, 18, 1, no, no) \
SC( 65, 20, 18, 2, no, no) \
SC( 66, 20, 18, 3, no, no) \
SC( 67, 20, 18, 4, no, no) \
\
SC( 68, 21, 19, 1, no, no) \
SC( 69, 21, 19, 2, no, no) \
SC( 70, 21, 19, 3, no, no) \
SC( 71, 21, 19, 4, no, no) \
\
SC( 72, 22, 20, 1, no, no) \
SC( 73, 22, 20, 2, no, no) \
SC( 74, 22, 20, 3, no, no) \
SC( 75, 22, 20, 4, no, no) \
\
SC( 76, 23, 21, 1, no, no) \
SC( 77, 23, 21, 2, no, no) \
SC( 78, 23, 21, 3, no, no) \
SC( 79, 23, 21, 4, no, no) \
\
SC( 80, 24, 22, 1, no, no) \
SC( 81, 24, 22, 2, no, no) \
SC( 82, 24, 22, 3, no, no) \
SC( 83, 24, 22, 4, no, no) \
\
SC( 84, 25, 23, 1, no, no) \
SC( 85, 25, 23, 2, no, no) \
SC( 86, 25, 23, 3, no, no) \
SC( 87, 25, 23, 4, no, no) \
\
SC( 88, 26, 24, 1, no, no) \
SC( 89, 26, 24, 2, no, no) \
SC( 90, 26, 24, 3, no, no) \
SC( 91, 26, 24, 4, no, no) \
\
SC( 92, 27, 25, 1, no, no) \
SC( 93, 27, 25, 2, no, no) \
SC( 94, 27, 25, 3, no, no) \
SC( 95, 27, 25, 4, no, no) \
\
SC( 96, 28, 26, 1, no, no) \
SC( 97, 28, 26, 2, no, no) \
SC( 98, 28, 26, 3, no, no) \
SC( 99, 28, 26, 4, no, no) \
\
SC(100, 29, 27, 1, no, no) \
SC(101, 29, 27, 2, no, no) \
SC(102, 29, 27, 3, no, no) \
SC(103, 29, 27, 4, no, no) \
\
SC(104, 30, 28, 1, no, no) \
SC(105, 30, 28, 2, no, no) \
SC(106, 30, 28, 3, no, no) \
SC(107, 30, 28, 4, no, no) \
\
SC(108, 31, 29, 1, no, no) \
SC(109, 31, 29, 2, no, no) \
SC(110, 31, 29, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 0
#define NLBINS 32
#define NBINS 47
#define LG_TINY_MAXCLASS "NA"
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 15) + (((size_t)3) << 13))
#endif
#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 4 && LG_PAGE == 12)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 3, 3, 0, yes, 3) \
\
SC( 1, 3, 3, 1, yes, 3) \
SC( 2, 4, 4, 1, yes, 4) \
SC( 3, 4, 4, 2, yes, 4) \
SC( 4, 4, 4, 3, yes, 4) \
\
SC( 5, 6, 4, 1, yes, 4) \
SC( 6, 6, 4, 2, yes, 4) \
SC( 7, 6, 4, 3, yes, 4) \
SC( 8, 6, 4, 4, yes, 4) \
\
SC( 9, 7, 5, 1, yes, 5) \
SC( 10, 7, 5, 2, yes, 5) \
SC( 11, 7, 5, 3, yes, 5) \
SC( 12, 7, 5, 4, yes, 5) \
\
SC( 13, 8, 6, 1, yes, 6) \
SC( 14, 8, 6, 2, yes, 6) \
SC( 15, 8, 6, 3, yes, 6) \
SC( 16, 8, 6, 4, yes, 6) \
\
SC( 17, 9, 7, 1, yes, 7) \
SC( 18, 9, 7, 2, yes, 7) \
SC( 19, 9, 7, 3, yes, 7) \
SC( 20, 9, 7, 4, yes, 7) \
\
SC( 21, 10, 8, 1, yes, 8) \
SC( 22, 10, 8, 2, yes, 8) \
SC( 23, 10, 8, 3, yes, 8) \
SC( 24, 10, 8, 4, yes, 8) \
\
SC( 25, 11, 9, 1, yes, 9) \
SC( 26, 11, 9, 2, yes, 9) \
SC( 27, 11, 9, 3, yes, 9) \
SC( 28, 11, 9, 4, no, 9) \
\
SC( 29, 12, 10, 1, no, no) \
SC( 30, 12, 10, 2, no, no) \
SC( 31, 12, 10, 3, no, no) \
SC( 32, 12, 10, 4, no, no) \
\
SC( 33, 13, 11, 1, no, no) \
SC( 34, 13, 11, 2, no, no) \
SC( 35, 13, 11, 3, no, no) \
SC( 36, 13, 11, 4, no, no) \
\
SC( 37, 14, 12, 1, no, no) \
SC( 38, 14, 12, 2, no, no) \
SC( 39, 14, 12, 3, no, no) \
SC( 40, 14, 12, 4, no, no) \
\
SC( 41, 15, 13, 1, no, no) \
SC( 42, 15, 13, 2, no, no) \
SC( 43, 15, 13, 3, no, no) \
SC( 44, 15, 13, 4, no, no) \
\
SC( 45, 16, 14, 1, no, no) \
SC( 46, 16, 14, 2, no, no) \
SC( 47, 16, 14, 3, no, no) \
SC( 48, 16, 14, 4, no, no) \
\
SC( 49, 17, 15, 1, no, no) \
SC( 50, 17, 15, 2, no, no) \
SC( 51, 17, 15, 3, no, no) \
SC( 52, 17, 15, 4, no, no) \
\
SC( 53, 18, 16, 1, no, no) \
SC( 54, 18, 16, 2, no, no) \
SC( 55, 18, 16, 3, no, no) \
SC( 56, 18, 16, 4, no, no) \
\
SC( 57, 19, 17, 1, no, no) \
SC( 58, 19, 17, 2, no, no) \
SC( 59, 19, 17, 3, no, no) \
SC( 60, 19, 17, 4, no, no) \
\
SC( 61, 20, 18, 1, no, no) \
SC( 62, 20, 18, 2, no, no) \
SC( 63, 20, 18, 3, no, no) \
SC( 64, 20, 18, 4, no, no) \
\
SC( 65, 21, 19, 1, no, no) \
SC( 66, 21, 19, 2, no, no) \
SC( 67, 21, 19, 3, no, no) \
SC( 68, 21, 19, 4, no, no) \
\
SC( 69, 22, 20, 1, no, no) \
SC( 70, 22, 20, 2, no, no) \
SC( 71, 22, 20, 3, no, no) \
SC( 72, 22, 20, 4, no, no) \
\
SC( 73, 23, 21, 1, no, no) \
SC( 74, 23, 21, 2, no, no) \
SC( 75, 23, 21, 3, no, no) \
SC( 76, 23, 21, 4, no, no) \
\
SC( 77, 24, 22, 1, no, no) \
SC( 78, 24, 22, 2, no, no) \
SC( 79, 24, 22, 3, no, no) \
SC( 80, 24, 22, 4, no, no) \
\
SC( 81, 25, 23, 1, no, no) \
SC( 82, 25, 23, 2, no, no) \
SC( 83, 25, 23, 3, no, no) \
SC( 84, 25, 23, 4, no, no) \
\
SC( 85, 26, 24, 1, no, no) \
SC( 86, 26, 24, 2, no, no) \
SC( 87, 26, 24, 3, no, no) \
SC( 88, 26, 24, 4, no, no) \
\
SC( 89, 27, 25, 1, no, no) \
SC( 90, 27, 25, 2, no, no) \
SC( 91, 27, 25, 3, no, no) \
SC( 92, 27, 25, 4, no, no) \
\
SC( 93, 28, 26, 1, no, no) \
SC( 94, 28, 26, 2, no, no) \
SC( 95, 28, 26, 3, no, no) \
SC( 96, 28, 26, 4, no, no) \
\
SC( 97, 29, 27, 1, no, no) \
SC( 98, 29, 27, 2, no, no) \
SC( 99, 29, 27, 3, no, no) \
SC(100, 29, 27, 4, no, no) \
\
SC(101, 30, 28, 1, no, no) \
SC(102, 30, 28, 2, no, no) \
SC(103, 30, 28, 3, no, no) \
SC(104, 30, 28, 4, no, no) \
\
SC(105, 31, 29, 1, no, no) \
SC(106, 31, 29, 2, no, no) \
SC(107, 31, 29, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 1
#define NLBINS 29
#define NBINS 28
#define LG_TINY_MAXCLASS 3
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 11) + (((size_t)3) << 9))
#endif
#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 4 && LG_PAGE == 13)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 3, 3, 0, yes, 3) \
\
SC( 1, 3, 3, 1, yes, 3) \
SC( 2, 4, 4, 1, yes, 4) \
SC( 3, 4, 4, 2, yes, 4) \
SC( 4, 4, 4, 3, yes, 4) \
\
SC( 5, 6, 4, 1, yes, 4) \
SC( 6, 6, 4, 2, yes, 4) \
SC( 7, 6, 4, 3, yes, 4) \
SC( 8, 6, 4, 4, yes, 4) \
\
SC( 9, 7, 5, 1, yes, 5) \
SC( 10, 7, 5, 2, yes, 5) \
SC( 11, 7, 5, 3, yes, 5) \
SC( 12, 7, 5, 4, yes, 5) \
\
SC( 13, 8, 6, 1, yes, 6) \
SC( 14, 8, 6, 2, yes, 6) \
SC( 15, 8, 6, 3, yes, 6) \
SC( 16, 8, 6, 4, yes, 6) \
\
SC( 17, 9, 7, 1, yes, 7) \
SC( 18, 9, 7, 2, yes, 7) \
SC( 19, 9, 7, 3, yes, 7) \
SC( 20, 9, 7, 4, yes, 7) \
\
SC( 21, 10, 8, 1, yes, 8) \
SC( 22, 10, 8, 2, yes, 8) \
SC( 23, 10, 8, 3, yes, 8) \
SC( 24, 10, 8, 4, yes, 8) \
\
SC( 25, 11, 9, 1, yes, 9) \
SC( 26, 11, 9, 2, yes, 9) \
SC( 27, 11, 9, 3, yes, 9) \
SC( 28, 11, 9, 4, yes, 9) \
\
SC( 29, 12, 10, 1, yes, no) \
SC( 30, 12, 10, 2, yes, no) \
SC( 31, 12, 10, 3, yes, no) \
SC( 32, 12, 10, 4, no, no) \
\
SC( 33, 13, 11, 1, no, no) \
SC( 34, 13, 11, 2, no, no) \
SC( 35, 13, 11, 3, no, no) \
SC( 36, 13, 11, 4, no, no) \
\
SC( 37, 14, 12, 1, no, no) \
SC( 38, 14, 12, 2, no, no) \
SC( 39, 14, 12, 3, no, no) \
SC( 40, 14, 12, 4, no, no) \
\
SC( 41, 15, 13, 1, no, no) \
SC( 42, 15, 13, 2, no, no) \
SC( 43, 15, 13, 3, no, no) \
SC( 44, 15, 13, 4, no, no) \
\
SC( 45, 16, 14, 1, no, no) \
SC( 46, 16, 14, 2, no, no) \
SC( 47, 16, 14, 3, no, no) \
SC( 48, 16, 14, 4, no, no) \
\
SC( 49, 17, 15, 1, no, no) \
SC( 50, 17, 15, 2, no, no) \
SC( 51, 17, 15, 3, no, no) \
SC( 52, 17, 15, 4, no, no) \
\
SC( 53, 18, 16, 1, no, no) \
SC( 54, 18, 16, 2, no, no) \
SC( 55, 18, 16, 3, no, no) \
SC( 56, 18, 16, 4, no, no) \
\
SC( 57, 19, 17, 1, no, no) \
SC( 58, 19, 17, 2, no, no) \
SC( 59, 19, 17, 3, no, no) \
SC( 60, 19, 17, 4, no, no) \
\
SC( 61, 20, 18, 1, no, no) \
SC( 62, 20, 18, 2, no, no) \
SC( 63, 20, 18, 3, no, no) \
SC( 64, 20, 18, 4, no, no) \
\
SC( 65, 21, 19, 1, no, no) \
SC( 66, 21, 19, 2, no, no) \
SC( 67, 21, 19, 3, no, no) \
SC( 68, 21, 19, 4, no, no) \
\
SC( 69, 22, 20, 1, no, no) \
SC( 70, 22, 20, 2, no, no) \
SC( 71, 22, 20, 3, no, no) \
SC( 72, 22, 20, 4, no, no) \
\
SC( 73, 23, 21, 1, no, no) \
SC( 74, 23, 21, 2, no, no) \
SC( 75, 23, 21, 3, no, no) \
SC( 76, 23, 21, 4, no, no) \
\
SC( 77, 24, 22, 1, no, no) \
SC( 78, 24, 22, 2, no, no) \
SC( 79, 24, 22, 3, no, no) \
SC( 80, 24, 22, 4, no, no) \
\
SC( 81, 25, 23, 1, no, no) \
SC( 82, 25, 23, 2, no, no) \
SC( 83, 25, 23, 3, no, no) \
SC( 84, 25, 23, 4, no, no) \
\
SC( 85, 26, 24, 1, no, no) \
SC( 86, 26, 24, 2, no, no) \
SC( 87, 26, 24, 3, no, no) \
SC( 88, 26, 24, 4, no, no) \
\
SC( 89, 27, 25, 1, no, no) \
SC( 90, 27, 25, 2, no, no) \
SC( 91, 27, 25, 3, no, no) \
SC( 92, 27, 25, 4, no, no) \
\
SC( 93, 28, 26, 1, no, no) \
SC( 94, 28, 26, 2, no, no) \
SC( 95, 28, 26, 3, no, no) \
SC( 96, 28, 26, 4, no, no) \
\
SC( 97, 29, 27, 1, no, no) \
SC( 98, 29, 27, 2, no, no) \
SC( 99, 29, 27, 3, no, no) \
SC(100, 29, 27, 4, no, no) \
\
SC(101, 30, 28, 1, no, no) \
SC(102, 30, 28, 2, no, no) \
SC(103, 30, 28, 3, no, no) \
SC(104, 30, 28, 4, no, no) \
\
SC(105, 31, 29, 1, no, no) \
SC(106, 31, 29, 2, no, no) \
SC(107, 31, 29, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 1
#define NLBINS 29
#define NBINS 32
#define LG_TINY_MAXCLASS 3
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 12) + (((size_t)3) << 10))
#endif
#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 3 && LG_QUANTUM == 4 && LG_PAGE == 16)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 3, 3, 0, yes, 3) \
\
SC( 1, 3, 3, 1, yes, 3) \
SC( 2, 4, 4, 1, yes, 4) \
SC( 3, 4, 4, 2, yes, 4) \
SC( 4, 4, 4, 3, yes, 4) \
\
SC( 5, 6, 4, 1, yes, 4) \
SC( 6, 6, 4, 2, yes, 4) \
SC( 7, 6, 4, 3, yes, 4) \
SC( 8, 6, 4, 4, yes, 4) \
\
SC( 9, 7, 5, 1, yes, 5) \
SC( 10, 7, 5, 2, yes, 5) \
SC( 11, 7, 5, 3, yes, 5) \
SC( 12, 7, 5, 4, yes, 5) \
\
SC( 13, 8, 6, 1, yes, 6) \
SC( 14, 8, 6, 2, yes, 6) \
SC( 15, 8, 6, 3, yes, 6) \
SC( 16, 8, 6, 4, yes, 6) \
\
SC( 17, 9, 7, 1, yes, 7) \
SC( 18, 9, 7, 2, yes, 7) \
SC( 19, 9, 7, 3, yes, 7) \
SC( 20, 9, 7, 4, yes, 7) \
\
SC( 21, 10, 8, 1, yes, 8) \
SC( 22, 10, 8, 2, yes, 8) \
SC( 23, 10, 8, 3, yes, 8) \
SC( 24, 10, 8, 4, yes, 8) \
\
SC( 25, 11, 9, 1, yes, 9) \
SC( 26, 11, 9, 2, yes, 9) \
SC( 27, 11, 9, 3, yes, 9) \
SC( 28, 11, 9, 4, yes, 9) \
\
SC( 29, 12, 10, 1, yes, no) \
SC( 30, 12, 10, 2, yes, no) \
SC( 31, 12, 10, 3, yes, no) \
SC( 32, 12, 10, 4, yes, no) \
\
SC( 33, 13, 11, 1, yes, no) \
SC( 34, 13, 11, 2, yes, no) \
SC( 35, 13, 11, 3, yes, no) \
SC( 36, 13, 11, 4, yes, no) \
\
SC( 37, 14, 12, 1, yes, no) \
SC( 38, 14, 12, 2, yes, no) \
SC( 39, 14, 12, 3, yes, no) \
SC( 40, 14, 12, 4, yes, no) \
\
SC( 41, 15, 13, 1, yes, no) \
SC( 42, 15, 13, 2, yes, no) \
SC( 43, 15, 13, 3, yes, no) \
SC( 44, 15, 13, 4, no, no) \
\
SC( 45, 16, 14, 1, no, no) \
SC( 46, 16, 14, 2, no, no) \
SC( 47, 16, 14, 3, no, no) \
SC( 48, 16, 14, 4, no, no) \
\
SC( 49, 17, 15, 1, no, no) \
SC( 50, 17, 15, 2, no, no) \
SC( 51, 17, 15, 3, no, no) \
SC( 52, 17, 15, 4, no, no) \
\
SC( 53, 18, 16, 1, no, no) \
SC( 54, 18, 16, 2, no, no) \
SC( 55, 18, 16, 3, no, no) \
SC( 56, 18, 16, 4, no, no) \
\
SC( 57, 19, 17, 1, no, no) \
SC( 58, 19, 17, 2, no, no) \
SC( 59, 19, 17, 3, no, no) \
SC( 60, 19, 17, 4, no, no) \
\
SC( 61, 20, 18, 1, no, no) \
SC( 62, 20, 18, 2, no, no) \
SC( 63, 20, 18, 3, no, no) \
SC( 64, 20, 18, 4, no, no) \
\
SC( 65, 21, 19, 1, no, no) \
SC( 66, 21, 19, 2, no, no) \
SC( 67, 21, 19, 3, no, no) \
SC( 68, 21, 19, 4, no, no) \
\
SC( 69, 22, 20, 1, no, no) \
SC( 70, 22, 20, 2, no, no) \
SC( 71, 22, 20, 3, no, no) \
SC( 72, 22, 20, 4, no, no) \
\
SC( 73, 23, 21, 1, no, no) \
SC( 74, 23, 21, 2, no, no) \
SC( 75, 23, 21, 3, no, no) \
SC( 76, 23, 21, 4, no, no) \
\
SC( 77, 24, 22, 1, no, no) \
SC( 78, 24, 22, 2, no, no) \
SC( 79, 24, 22, 3, no, no) \
SC( 80, 24, 22, 4, no, no) \
\
SC( 81, 25, 23, 1, no, no) \
SC( 82, 25, 23, 2, no, no) \
SC( 83, 25, 23, 3, no, no) \
SC( 84, 25, 23, 4, no, no) \
\
SC( 85, 26, 24, 1, no, no) \
SC( 86, 26, 24, 2, no, no) \
SC( 87, 26, 24, 3, no, no) \
SC( 88, 26, 24, 4, no, no) \
\
SC( 89, 27, 25, 1, no, no) \
SC( 90, 27, 25, 2, no, no) \
SC( 91, 27, 25, 3, no, no) \
SC( 92, 27, 25, 4, no, no) \
\
SC( 93, 28, 26, 1, no, no) \
SC( 94, 28, 26, 2, no, no) \
SC( 95, 28, 26, 3, no, no) \
SC( 96, 28, 26, 4, no, no) \
\
SC( 97, 29, 27, 1, no, no) \
SC( 98, 29, 27, 2, no, no) \
SC( 99, 29, 27, 3, no, no) \
SC(100, 29, 27, 4, no, no) \
\
SC(101, 30, 28, 1, no, no) \
SC(102, 30, 28, 2, no, no) \
SC(103, 30, 28, 3, no, no) \
SC(104, 30, 28, 4, no, no) \
\
SC(105, 31, 29, 1, no, no) \
SC(106, 31, 29, 2, no, no) \
SC(107, 31, 29, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 1
#define NLBINS 29
#define NBINS 44
#define LG_TINY_MAXCLASS 3
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 15) + (((size_t)3) << 13))
#endif
#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 4 && LG_QUANTUM == 4 && LG_PAGE == 12)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 4, 4, 0, yes, 4) \
SC( 1, 4, 4, 1, yes, 4) \
SC( 2, 4, 4, 2, yes, 4) \
SC( 3, 4, 4, 3, yes, 4) \
\
SC( 4, 6, 4, 1, yes, 4) \
SC( 5, 6, 4, 2, yes, 4) \
SC( 6, 6, 4, 3, yes, 4) \
SC( 7, 6, 4, 4, yes, 4) \
\
SC( 8, 7, 5, 1, yes, 5) \
SC( 9, 7, 5, 2, yes, 5) \
SC( 10, 7, 5, 3, yes, 5) \
SC( 11, 7, 5, 4, yes, 5) \
\
SC( 12, 8, 6, 1, yes, 6) \
SC( 13, 8, 6, 2, yes, 6) \
SC( 14, 8, 6, 3, yes, 6) \
SC( 15, 8, 6, 4, yes, 6) \
\
SC( 16, 9, 7, 1, yes, 7) \
SC( 17, 9, 7, 2, yes, 7) \
SC( 18, 9, 7, 3, yes, 7) \
SC( 19, 9, 7, 4, yes, 7) \
\
SC( 20, 10, 8, 1, yes, 8) \
SC( 21, 10, 8, 2, yes, 8) \
SC( 22, 10, 8, 3, yes, 8) \
SC( 23, 10, 8, 4, yes, 8) \
\
SC( 24, 11, 9, 1, yes, 9) \
SC( 25, 11, 9, 2, yes, 9) \
SC( 26, 11, 9, 3, yes, 9) \
SC( 27, 11, 9, 4, no, 9) \
\
SC( 28, 12, 10, 1, no, no) \
SC( 29, 12, 10, 2, no, no) \
SC( 30, 12, 10, 3, no, no) \
SC( 31, 12, 10, 4, no, no) \
\
SC( 32, 13, 11, 1, no, no) \
SC( 33, 13, 11, 2, no, no) \
SC( 34, 13, 11, 3, no, no) \
SC( 35, 13, 11, 4, no, no) \
\
SC( 36, 14, 12, 1, no, no) \
SC( 37, 14, 12, 2, no, no) \
SC( 38, 14, 12, 3, no, no) \
SC( 39, 14, 12, 4, no, no) \
\
SC( 40, 15, 13, 1, no, no) \
SC( 41, 15, 13, 2, no, no) \
SC( 42, 15, 13, 3, no, no) \
SC( 43, 15, 13, 4, no, no) \
\
SC( 44, 16, 14, 1, no, no) \
SC( 45, 16, 14, 2, no, no) \
SC( 46, 16, 14, 3, no, no) \
SC( 47, 16, 14, 4, no, no) \
\
SC( 48, 17, 15, 1, no, no) \
SC( 49, 17, 15, 2, no, no) \
SC( 50, 17, 15, 3, no, no) \
SC( 51, 17, 15, 4, no, no) \
\
SC( 52, 18, 16, 1, no, no) \
SC( 53, 18, 16, 2, no, no) \
SC( 54, 18, 16, 3, no, no) \
SC( 55, 18, 16, 4, no, no) \
\
SC( 56, 19, 17, 1, no, no) \
SC( 57, 19, 17, 2, no, no) \
SC( 58, 19, 17, 3, no, no) \
SC( 59, 19, 17, 4, no, no) \
\
SC( 60, 20, 18, 1, no, no) \
SC( 61, 20, 18, 2, no, no) \
SC( 62, 20, 18, 3, no, no) \
SC( 63, 20, 18, 4, no, no) \
\
SC( 64, 21, 19, 1, no, no) \
SC( 65, 21, 19, 2, no, no) \
SC( 66, 21, 19, 3, no, no) \
SC( 67, 21, 19, 4, no, no) \
\
SC( 68, 22, 20, 1, no, no) \
SC( 69, 22, 20, 2, no, no) \
SC( 70, 22, 20, 3, no, no) \
SC( 71, 22, 20, 4, no, no) \
\
SC( 72, 23, 21, 1, no, no) \
SC( 73, 23, 21, 2, no, no) \
SC( 74, 23, 21, 3, no, no) \
SC( 75, 23, 21, 4, no, no) \
\
SC( 76, 24, 22, 1, no, no) \
SC( 77, 24, 22, 2, no, no) \
SC( 78, 24, 22, 3, no, no) \
SC( 79, 24, 22, 4, no, no) \
\
SC( 80, 25, 23, 1, no, no) \
SC( 81, 25, 23, 2, no, no) \
SC( 82, 25, 23, 3, no, no) \
SC( 83, 25, 23, 4, no, no) \
\
SC( 84, 26, 24, 1, no, no) \
SC( 85, 26, 24, 2, no, no) \
SC( 86, 26, 24, 3, no, no) \
SC( 87, 26, 24, 4, no, no) \
\
SC( 88, 27, 25, 1, no, no) \
SC( 89, 27, 25, 2, no, no) \
SC( 90, 27, 25, 3, no, no) \
SC( 91, 27, 25, 4, no, no) \
\
SC( 92, 28, 26, 1, no, no) \
SC( 93, 28, 26, 2, no, no) \
SC( 94, 28, 26, 3, no, no) \
SC( 95, 28, 26, 4, no, no) \
\
SC( 96, 29, 27, 1, no, no) \
SC( 97, 29, 27, 2, no, no) \
SC( 98, 29, 27, 3, no, no) \
SC( 99, 29, 27, 4, no, no) \
\
SC(100, 30, 28, 1, no, no) \
SC(101, 30, 28, 2, no, no) \
SC(102, 30, 28, 3, no, no) \
SC(103, 30, 28, 4, no, no) \
\
SC(104, 31, 29, 1, no, no) \
SC(105, 31, 29, 2, no, no) \
SC(106, 31, 29, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 0
#define NLBINS 28
#define NBINS 27
#define LG_TINY_MAXCLASS "NA"
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 11) + (((size_t)3) << 9))
#endif
#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 4 && LG_QUANTUM == 4 && LG_PAGE == 13)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 4, 4, 0, yes, 4) \
SC( 1, 4, 4, 1, yes, 4) \
SC( 2, 4, 4, 2, yes, 4) \
SC( 3, 4, 4, 3, yes, 4) \
\
SC( 4, 6, 4, 1, yes, 4) \
SC( 5, 6, 4, 2, yes, 4) \
SC( 6, 6, 4, 3, yes, 4) \
SC( 7, 6, 4, 4, yes, 4) \
\
SC( 8, 7, 5, 1, yes, 5) \
SC( 9, 7, 5, 2, yes, 5) \
SC( 10, 7, 5, 3, yes, 5) \
SC( 11, 7, 5, 4, yes, 5) \
\
SC( 12, 8, 6, 1, yes, 6) \
SC( 13, 8, 6, 2, yes, 6) \
SC( 14, 8, 6, 3, yes, 6) \
SC( 15, 8, 6, 4, yes, 6) \
\
SC( 16, 9, 7, 1, yes, 7) \
SC( 17, 9, 7, 2, yes, 7) \
SC( 18, 9, 7, 3, yes, 7) \
SC( 19, 9, 7, 4, yes, 7) \
\
SC( 20, 10, 8, 1, yes, 8) \
SC( 21, 10, 8, 2, yes, 8) \
SC( 22, 10, 8, 3, yes, 8) \
SC( 23, 10, 8, 4, yes, 8) \
\
SC( 24, 11, 9, 1, yes, 9) \
SC( 25, 11, 9, 2, yes, 9) \
SC( 26, 11, 9, 3, yes, 9) \
SC( 27, 11, 9, 4, yes, 9) \
\
SC( 28, 12, 10, 1, yes, no) \
SC( 29, 12, 10, 2, yes, no) \
SC( 30, 12, 10, 3, yes, no) \
SC( 31, 12, 10, 4, no, no) \
\
SC( 32, 13, 11, 1, no, no) \
SC( 33, 13, 11, 2, no, no) \
SC( 34, 13, 11, 3, no, no) \
SC( 35, 13, 11, 4, no, no) \
\
SC( 36, 14, 12, 1, no, no) \
SC( 37, 14, 12, 2, no, no) \
SC( 38, 14, 12, 3, no, no) \
SC( 39, 14, 12, 4, no, no) \
\
SC( 40, 15, 13, 1, no, no) \
SC( 41, 15, 13, 2, no, no) \
SC( 42, 15, 13, 3, no, no) \
SC( 43, 15, 13, 4, no, no) \
\
SC( 44, 16, 14, 1, no, no) \
SC( 45, 16, 14, 2, no, no) \
SC( 46, 16, 14, 3, no, no) \
SC( 47, 16, 14, 4, no, no) \
\
SC( 48, 17, 15, 1, no, no) \
SC( 49, 17, 15, 2, no, no) \
SC( 50, 17, 15, 3, no, no) \
SC( 51, 17, 15, 4, no, no) \
\
SC( 52, 18, 16, 1, no, no) \
SC( 53, 18, 16, 2, no, no) \
SC( 54, 18, 16, 3, no, no) \
SC( 55, 18, 16, 4, no, no) \
\
SC( 56, 19, 17, 1, no, no) \
SC( 57, 19, 17, 2, no, no) \
SC( 58, 19, 17, 3, no, no) \
SC( 59, 19, 17, 4, no, no) \
\
SC( 60, 20, 18, 1, no, no) \
SC( 61, 20, 18, 2, no, no) \
SC( 62, 20, 18, 3, no, no) \
SC( 63, 20, 18, 4, no, no) \
\
SC( 64, 21, 19, 1, no, no) \
SC( 65, 21, 19, 2, no, no) \
SC( 66, 21, 19, 3, no, no) \
SC( 67, 21, 19, 4, no, no) \
\
SC( 68, 22, 20, 1, no, no) \
SC( 69, 22, 20, 2, no, no) \
SC( 70, 22, 20, 3, no, no) \
SC( 71, 22, 20, 4, no, no) \
\
SC( 72, 23, 21, 1, no, no) \
SC( 73, 23, 21, 2, no, no) \
SC( 74, 23, 21, 3, no, no) \
SC( 75, 23, 21, 4, no, no) \
\
SC( 76, 24, 22, 1, no, no) \
SC( 77, 24, 22, 2, no, no) \
SC( 78, 24, 22, 3, no, no) \
SC( 79, 24, 22, 4, no, no) \
\
SC( 80, 25, 23, 1, no, no) \
SC( 81, 25, 23, 2, no, no) \
SC( 82, 25, 23, 3, no, no) \
SC( 83, 25, 23, 4, no, no) \
\
SC( 84, 26, 24, 1, no, no) \
SC( 85, 26, 24, 2, no, no) \
SC( 86, 26, 24, 3, no, no) \
SC( 87, 26, 24, 4, no, no) \
\
SC( 88, 27, 25, 1, no, no) \
SC( 89, 27, 25, 2, no, no) \
SC( 90, 27, 25, 3, no, no) \
SC( 91, 27, 25, 4, no, no) \
\
SC( 92, 28, 26, 1, no, no) \
SC( 93, 28, 26, 2, no, no) \
SC( 94, 28, 26, 3, no, no) \
SC( 95, 28, 26, 4, no, no) \
\
SC( 96, 29, 27, 1, no, no) \
SC( 97, 29, 27, 2, no, no) \
SC( 98, 29, 27, 3, no, no) \
SC( 99, 29, 27, 4, no, no) \
\
SC(100, 30, 28, 1, no, no) \
SC(101, 30, 28, 2, no, no) \
SC(102, 30, 28, 3, no, no) \
SC(103, 30, 28, 4, no, no) \
\
SC(104, 31, 29, 1, no, no) \
SC(105, 31, 29, 2, no, no) \
SC(106, 31, 29, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 0
#define NLBINS 28
#define NBINS 31
#define LG_TINY_MAXCLASS "NA"
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 12) + (((size_t)3) << 10))
#endif
#if (LG_SIZEOF_PTR == 2 && LG_TINY_MIN == 4 && LG_QUANTUM == 4 && LG_PAGE == 16)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 4, 4, 0, yes, 4) \
SC( 1, 4, 4, 1, yes, 4) \
SC( 2, 4, 4, 2, yes, 4) \
SC( 3, 4, 4, 3, yes, 4) \
\
SC( 4, 6, 4, 1, yes, 4) \
SC( 5, 6, 4, 2, yes, 4) \
SC( 6, 6, 4, 3, yes, 4) \
SC( 7, 6, 4, 4, yes, 4) \
\
SC( 8, 7, 5, 1, yes, 5) \
SC( 9, 7, 5, 2, yes, 5) \
SC( 10, 7, 5, 3, yes, 5) \
SC( 11, 7, 5, 4, yes, 5) \
\
SC( 12, 8, 6, 1, yes, 6) \
SC( 13, 8, 6, 2, yes, 6) \
SC( 14, 8, 6, 3, yes, 6) \
SC( 15, 8, 6, 4, yes, 6) \
\
SC( 16, 9, 7, 1, yes, 7) \
SC( 17, 9, 7, 2, yes, 7) \
SC( 18, 9, 7, 3, yes, 7) \
SC( 19, 9, 7, 4, yes, 7) \
\
SC( 20, 10, 8, 1, yes, 8) \
SC( 21, 10, 8, 2, yes, 8) \
SC( 22, 10, 8, 3, yes, 8) \
SC( 23, 10, 8, 4, yes, 8) \
\
SC( 24, 11, 9, 1, yes, 9) \
SC( 25, 11, 9, 2, yes, 9) \
SC( 26, 11, 9, 3, yes, 9) \
SC( 27, 11, 9, 4, yes, 9) \
\
SC( 28, 12, 10, 1, yes, no) \
SC( 29, 12, 10, 2, yes, no) \
SC( 30, 12, 10, 3, yes, no) \
SC( 31, 12, 10, 4, yes, no) \
\
SC( 32, 13, 11, 1, yes, no) \
SC( 33, 13, 11, 2, yes, no) \
SC( 34, 13, 11, 3, yes, no) \
SC( 35, 13, 11, 4, yes, no) \
\
SC( 36, 14, 12, 1, yes, no) \
SC( 37, 14, 12, 2, yes, no) \
SC( 38, 14, 12, 3, yes, no) \
SC( 39, 14, 12, 4, yes, no) \
\
SC( 40, 15, 13, 1, yes, no) \
SC( 41, 15, 13, 2, yes, no) \
SC( 42, 15, 13, 3, yes, no) \
SC( 43, 15, 13, 4, no, no) \
\
SC( 44, 16, 14, 1, no, no) \
SC( 45, 16, 14, 2, no, no) \
SC( 46, 16, 14, 3, no, no) \
SC( 47, 16, 14, 4, no, no) \
\
SC( 48, 17, 15, 1, no, no) \
SC( 49, 17, 15, 2, no, no) \
SC( 50, 17, 15, 3, no, no) \
SC( 51, 17, 15, 4, no, no) \
\
SC( 52, 18, 16, 1, no, no) \
SC( 53, 18, 16, 2, no, no) \
SC( 54, 18, 16, 3, no, no) \
SC( 55, 18, 16, 4, no, no) \
\
SC( 56, 19, 17, 1, no, no) \
SC( 57, 19, 17, 2, no, no) \
SC( 58, 19, 17, 3, no, no) \
SC( 59, 19, 17, 4, no, no) \
\
SC( 60, 20, 18, 1, no, no) \
SC( 61, 20, 18, 2, no, no) \
SC( 62, 20, 18, 3, no, no) \
SC( 63, 20, 18, 4, no, no) \
\
SC( 64, 21, 19, 1, no, no) \
SC( 65, 21, 19, 2, no, no) \
SC( 66, 21, 19, 3, no, no) \
SC( 67, 21, 19, 4, no, no) \
\
SC( 68, 22, 20, 1, no, no) \
SC( 69, 22, 20, 2, no, no) \
SC( 70, 22, 20, 3, no, no) \
SC( 71, 22, 20, 4, no, no) \
\
SC( 72, 23, 21, 1, no, no) \
SC( 73, 23, 21, 2, no, no) \
SC( 74, 23, 21, 3, no, no) \
SC( 75, 23, 21, 4, no, no) \
\
SC( 76, 24, 22, 1, no, no) \
SC( 77, 24, 22, 2, no, no) \
SC( 78, 24, 22, 3, no, no) \
SC( 79, 24, 22, 4, no, no) \
\
SC( 80, 25, 23, 1, no, no) \
SC( 81, 25, 23, 2, no, no) \
SC( 82, 25, 23, 3, no, no) \
SC( 83, 25, 23, 4, no, no) \
\
SC( 84, 26, 24, 1, no, no) \
SC( 85, 26, 24, 2, no, no) \
SC( 86, 26, 24, 3, no, no) \
SC( 87, 26, 24, 4, no, no) \
\
SC( 88, 27, 25, 1, no, no) \
SC( 89, 27, 25, 2, no, no) \
SC( 90, 27, 25, 3, no, no) \
SC( 91, 27, 25, 4, no, no) \
\
SC( 92, 28, 26, 1, no, no) \
SC( 93, 28, 26, 2, no, no) \
SC( 94, 28, 26, 3, no, no) \
SC( 95, 28, 26, 4, no, no) \
\
SC( 96, 29, 27, 1, no, no) \
SC( 97, 29, 27, 2, no, no) \
SC( 98, 29, 27, 3, no, no) \
SC( 99, 29, 27, 4, no, no) \
\
SC(100, 30, 28, 1, no, no) \
SC(101, 30, 28, 2, no, no) \
SC(102, 30, 28, 3, no, no) \
SC(103, 30, 28, 4, no, no) \
\
SC(104, 31, 29, 1, no, no) \
SC(105, 31, 29, 2, no, no) \
SC(106, 31, 29, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 0
#define NLBINS 28
#define NBINS 43
#define LG_TINY_MAXCLASS "NA"
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 15) + (((size_t)3) << 13))
#endif
#if (LG_SIZEOF_PTR == 3 && LG_TINY_MIN == 3 && LG_QUANTUM == 3 && LG_PAGE == 12)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 3, 3, 0, yes, 3) \
SC( 1, 3, 3, 1, yes, 3) \
SC( 2, 3, 3, 2, yes, 3) \
SC( 3, 3, 3, 3, yes, 3) \
\
SC( 4, 5, 3, 1, yes, 3) \
SC( 5, 5, 3, 2, yes, 3) \
SC( 6, 5, 3, 3, yes, 3) \
SC( 7, 5, 3, 4, yes, 3) \
\
SC( 8, 6, 4, 1, yes, 4) \
SC( 9, 6, 4, 2, yes, 4) \
SC( 10, 6, 4, 3, yes, 4) \
SC( 11, 6, 4, 4, yes, 4) \
\
SC( 12, 7, 5, 1, yes, 5) \
SC( 13, 7, 5, 2, yes, 5) \
SC( 14, 7, 5, 3, yes, 5) \
SC( 15, 7, 5, 4, yes, 5) \
\
SC( 16, 8, 6, 1, yes, 6) \
SC( 17, 8, 6, 2, yes, 6) \
SC( 18, 8, 6, 3, yes, 6) \
SC( 19, 8, 6, 4, yes, 6) \
\
SC( 20, 9, 7, 1, yes, 7) \
SC( 21, 9, 7, 2, yes, 7) \
SC( 22, 9, 7, 3, yes, 7) \
SC( 23, 9, 7, 4, yes, 7) \
\
SC( 24, 10, 8, 1, yes, 8) \
SC( 25, 10, 8, 2, yes, 8) \
SC( 26, 10, 8, 3, yes, 8) \
SC( 27, 10, 8, 4, yes, 8) \
\
SC( 28, 11, 9, 1, yes, 9) \
SC( 29, 11, 9, 2, yes, 9) \
SC( 30, 11, 9, 3, yes, 9) \
SC( 31, 11, 9, 4, no, 9) \
\
SC( 32, 12, 10, 1, no, no) \
SC( 33, 12, 10, 2, no, no) \
SC( 34, 12, 10, 3, no, no) \
SC( 35, 12, 10, 4, no, no) \
\
SC( 36, 13, 11, 1, no, no) \
SC( 37, 13, 11, 2, no, no) \
SC( 38, 13, 11, 3, no, no) \
SC( 39, 13, 11, 4, no, no) \
\
SC( 40, 14, 12, 1, no, no) \
SC( 41, 14, 12, 2, no, no) \
SC( 42, 14, 12, 3, no, no) \
SC( 43, 14, 12, 4, no, no) \
\
SC( 44, 15, 13, 1, no, no) \
SC( 45, 15, 13, 2, no, no) \
SC( 46, 15, 13, 3, no, no) \
SC( 47, 15, 13, 4, no, no) \
\
SC( 48, 16, 14, 1, no, no) \
SC( 49, 16, 14, 2, no, no) \
SC( 50, 16, 14, 3, no, no) \
SC( 51, 16, 14, 4, no, no) \
\
SC( 52, 17, 15, 1, no, no) \
SC( 53, 17, 15, 2, no, no) \
SC( 54, 17, 15, 3, no, no) \
SC( 55, 17, 15, 4, no, no) \
\
SC( 56, 18, 16, 1, no, no) \
SC( 57, 18, 16, 2, no, no) \
SC( 58, 18, 16, 3, no, no) \
SC( 59, 18, 16, 4, no, no) \
\
SC( 60, 19, 17, 1, no, no) \
SC( 61, 19, 17, 2, no, no) \
SC( 62, 19, 17, 3, no, no) \
SC( 63, 19, 17, 4, no, no) \
\
SC( 64, 20, 18, 1, no, no) \
SC( 65, 20, 18, 2, no, no) \
SC( 66, 20, 18, 3, no, no) \
SC( 67, 20, 18, 4, no, no) \
\
SC( 68, 21, 19, 1, no, no) \
SC( 69, 21, 19, 2, no, no) \
SC( 70, 21, 19, 3, no, no) \
SC( 71, 21, 19, 4, no, no) \
\
SC( 72, 22, 20, 1, no, no) \
SC( 73, 22, 20, 2, no, no) \
SC( 74, 22, 20, 3, no, no) \
SC( 75, 22, 20, 4, no, no) \
\
SC( 76, 23, 21, 1, no, no) \
SC( 77, 23, 21, 2, no, no) \
SC( 78, 23, 21, 3, no, no) \
SC( 79, 23, 21, 4, no, no) \
\
SC( 80, 24, 22, 1, no, no) \
SC( 81, 24, 22, 2, no, no) \
SC( 82, 24, 22, 3, no, no) \
SC( 83, 24, 22, 4, no, no) \
\
SC( 84, 25, 23, 1, no, no) \
SC( 85, 25, 23, 2, no, no) \
SC( 86, 25, 23, 3, no, no) \
SC( 87, 25, 23, 4, no, no) \
\
SC( 88, 26, 24, 1, no, no) \
SC( 89, 26, 24, 2, no, no) \
SC( 90, 26, 24, 3, no, no) \
SC( 91, 26, 24, 4, no, no) \
\
SC( 92, 27, 25, 1, no, no) \
SC( 93, 27, 25, 2, no, no) \
SC( 94, 27, 25, 3, no, no) \
SC( 95, 27, 25, 4, no, no) \
\
SC( 96, 28, 26, 1, no, no) \
SC( 97, 28, 26, 2, no, no) \
SC( 98, 28, 26, 3, no, no) \
SC( 99, 28, 26, 4, no, no) \
\
SC(100, 29, 27, 1, no, no) \
SC(101, 29, 27, 2, no, no) \
SC(102, 29, 27, 3, no, no) \
SC(103, 29, 27, 4, no, no) \
\
SC(104, 30, 28, 1, no, no) \
SC(105, 30, 28, 2, no, no) \
SC(106, 30, 28, 3, no, no) \
SC(107, 30, 28, 4, no, no) \
\
SC(108, 31, 29, 1, no, no) \
SC(109, 31, 29, 2, no, no) \
SC(110, 31, 29, 3, no, no) \
SC(111, 31, 29, 4, no, no) \
\
SC(112, 32, 30, 1, no, no) \
SC(113, 32, 30, 2, no, no) \
SC(114, 32, 30, 3, no, no) \
SC(115, 32, 30, 4, no, no) \
\
SC(116, 33, 31, 1, no, no) \
SC(117, 33, 31, 2, no, no) \
SC(118, 33, 31, 3, no, no) \
SC(119, 33, 31, 4, no, no) \
\
SC(120, 34, 32, 1, no, no) \
SC(121, 34, 32, 2, no, no) \
SC(122, 34, 32, 3, no, no) \
SC(123, 34, 32, 4, no, no) \
\
SC(124, 35, 33, 1, no, no) \
SC(125, 35, 33, 2, no, no) \
SC(126, 35, 33, 3, no, no) \
SC(127, 35, 33, 4, no, no) \
\
SC(128, 36, 34, 1, no, no) \
SC(129, 36, 34, 2, no, no) \
SC(130, 36, 34, 3, no, no) \
SC(131, 36, 34, 4, no, no) \
\
SC(132, 37, 35, 1, no, no) \
SC(133, 37, 35, 2, no, no) \
SC(134, 37, 35, 3, no, no) \
SC(135, 37, 35, 4, no, no) \
\
SC(136, 38, 36, 1, no, no) \
SC(137, 38, 36, 2, no, no) \
SC(138, 38, 36, 3, no, no) \
SC(139, 38, 36, 4, no, no) \
\
SC(140, 39, 37, 1, no, no) \
SC(141, 39, 37, 2, no, no) \
SC(142, 39, 37, 3, no, no) \
SC(143, 39, 37, 4, no, no) \
\
SC(144, 40, 38, 1, no, no) \
SC(145, 40, 38, 2, no, no) \
SC(146, 40, 38, 3, no, no) \
SC(147, 40, 38, 4, no, no) \
\
SC(148, 41, 39, 1, no, no) \
SC(149, 41, 39, 2, no, no) \
SC(150, 41, 39, 3, no, no) \
SC(151, 41, 39, 4, no, no) \
\
SC(152, 42, 40, 1, no, no) \
SC(153, 42, 40, 2, no, no) \
SC(154, 42, 40, 3, no, no) \
SC(155, 42, 40, 4, no, no) \
\
SC(156, 43, 41, 1, no, no) \
SC(157, 43, 41, 2, no, no) \
SC(158, 43, 41, 3, no, no) \
SC(159, 43, 41, 4, no, no) \
\
SC(160, 44, 42, 1, no, no) \
SC(161, 44, 42, 2, no, no) \
SC(162, 44, 42, 3, no, no) \
SC(163, 44, 42, 4, no, no) \
\
SC(164, 45, 43, 1, no, no) \
SC(165, 45, 43, 2, no, no) \
SC(166, 45, 43, 3, no, no) \
SC(167, 45, 43, 4, no, no) \
\
SC(168, 46, 44, 1, no, no) \
SC(169, 46, 44, 2, no, no) \
SC(170, 46, 44, 3, no, no) \
SC(171, 46, 44, 4, no, no) \
\
SC(172, 47, 45, 1, no, no) \
SC(173, 47, 45, 2, no, no) \
SC(174, 47, 45, 3, no, no) \
SC(175, 47, 45, 4, no, no) \
\
SC(176, 48, 46, 1, no, no) \
SC(177, 48, 46, 2, no, no) \
SC(178, 48, 46, 3, no, no) \
SC(179, 48, 46, 4, no, no) \
\
SC(180, 49, 47, 1, no, no) \
SC(181, 49, 47, 2, no, no) \
SC(182, 49, 47, 3, no, no) \
SC(183, 49, 47, 4, no, no) \
\
SC(184, 50, 48, 1, no, no) \
SC(185, 50, 48, 2, no, no) \
SC(186, 50, 48, 3, no, no) \
SC(187, 50, 48, 4, no, no) \
\
SC(188, 51, 49, 1, no, no) \
SC(189, 51, 49, 2, no, no) \
SC(190, 51, 49, 3, no, no) \
SC(191, 51, 49, 4, no, no) \
\
SC(192, 52, 50, 1, no, no) \
SC(193, 52, 50, 2, no, no) \
SC(194, 52, 50, 3, no, no) \
SC(195, 52, 50, 4, no, no) \
\
SC(196, 53, 51, 1, no, no) \
SC(197, 53, 51, 2, no, no) \
SC(198, 53, 51, 3, no, no) \
SC(199, 53, 51, 4, no, no) \
\
SC(200, 54, 52, 1, no, no) \
SC(201, 54, 52, 2, no, no) \
SC(202, 54, 52, 3, no, no) \
SC(203, 54, 52, 4, no, no) \
\
SC(204, 55, 53, 1, no, no) \
SC(205, 55, 53, 2, no, no) \
SC(206, 55, 53, 3, no, no) \
SC(207, 55, 53, 4, no, no) \
\
SC(208, 56, 54, 1, no, no) \
SC(209, 56, 54, 2, no, no) \
SC(210, 56, 54, 3, no, no) \
SC(211, 56, 54, 4, no, no) \
\
SC(212, 57, 55, 1, no, no) \
SC(213, 57, 55, 2, no, no) \
SC(214, 57, 55, 3, no, no) \
SC(215, 57, 55, 4, no, no) \
\
SC(216, 58, 56, 1, no, no) \
SC(217, 58, 56, 2, no, no) \
SC(218, 58, 56, 3, no, no) \
SC(219, 58, 56, 4, no, no) \
\
SC(220, 59, 57, 1, no, no) \
SC(221, 59, 57, 2, no, no) \
SC(222, 59, 57, 3, no, no) \
SC(223, 59, 57, 4, no, no) \
\
SC(224, 60, 58, 1, no, no) \
SC(225, 60, 58, 2, no, no) \
SC(226, 60, 58, 3, no, no) \
SC(227, 60, 58, 4, no, no) \
\
SC(228, 61, 59, 1, no, no) \
SC(229, 61, 59, 2, no, no) \
SC(230, 61, 59, 3, no, no) \
SC(231, 61, 59, 4, no, no) \
\
SC(232, 62, 60, 1, no, no) \
SC(233, 62, 60, 2, no, no) \
SC(234, 62, 60, 3, no, no) \
SC(235, 62, 60, 4, no, no) \
\
SC(236, 63, 61, 1, no, no) \
SC(237, 63, 61, 2, no, no) \
SC(238, 63, 61, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 0
#define NLBINS 32
#define NBINS 31
#define LG_TINY_MAXCLASS "NA"
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 11) + (((size_t)3) << 9))
#endif
#if (LG_SIZEOF_PTR == 3 && LG_TINY_MIN == 3 && LG_QUANTUM == 3 && LG_PAGE == 13)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 3, 3, 0, yes, 3) \
SC( 1, 3, 3, 1, yes, 3) \
SC( 2, 3, 3, 2, yes, 3) \
SC( 3, 3, 3, 3, yes, 3) \
\
SC( 4, 5, 3, 1, yes, 3) \
SC( 5, 5, 3, 2, yes, 3) \
SC( 6, 5, 3, 3, yes, 3) \
SC( 7, 5, 3, 4, yes, 3) \
\
SC( 8, 6, 4, 1, yes, 4) \
SC( 9, 6, 4, 2, yes, 4) \
SC( 10, 6, 4, 3, yes, 4) \
SC( 11, 6, 4, 4, yes, 4) \
\
SC( 12, 7, 5, 1, yes, 5) \
SC( 13, 7, 5, 2, yes, 5) \
SC( 14, 7, 5, 3, yes, 5) \
SC( 15, 7, 5, 4, yes, 5) \
\
SC( 16, 8, 6, 1, yes, 6) \
SC( 17, 8, 6, 2, yes, 6) \
SC( 18, 8, 6, 3, yes, 6) \
SC( 19, 8, 6, 4, yes, 6) \
\
SC( 20, 9, 7, 1, yes, 7) \
SC( 21, 9, 7, 2, yes, 7) \
SC( 22, 9, 7, 3, yes, 7) \
SC( 23, 9, 7, 4, yes, 7) \
\
SC( 24, 10, 8, 1, yes, 8) \
SC( 25, 10, 8, 2, yes, 8) \
SC( 26, 10, 8, 3, yes, 8) \
SC( 27, 10, 8, 4, yes, 8) \
\
SC( 28, 11, 9, 1, yes, 9) \
SC( 29, 11, 9, 2, yes, 9) \
SC( 30, 11, 9, 3, yes, 9) \
SC( 31, 11, 9, 4, yes, 9) \
\
SC( 32, 12, 10, 1, yes, no) \
SC( 33, 12, 10, 2, yes, no) \
SC( 34, 12, 10, 3, yes, no) \
SC( 35, 12, 10, 4, no, no) \
\
SC( 36, 13, 11, 1, no, no) \
SC( 37, 13, 11, 2, no, no) \
SC( 38, 13, 11, 3, no, no) \
SC( 39, 13, 11, 4, no, no) \
\
SC( 40, 14, 12, 1, no, no) \
SC( 41, 14, 12, 2, no, no) \
SC( 42, 14, 12, 3, no, no) \
SC( 43, 14, 12, 4, no, no) \
\
SC( 44, 15, 13, 1, no, no) \
SC( 45, 15, 13, 2, no, no) \
SC( 46, 15, 13, 3, no, no) \
SC( 47, 15, 13, 4, no, no) \
\
SC( 48, 16, 14, 1, no, no) \
SC( 49, 16, 14, 2, no, no) \
SC( 50, 16, 14, 3, no, no) \
SC( 51, 16, 14, 4, no, no) \
\
SC( 52, 17, 15, 1, no, no) \
SC( 53, 17, 15, 2, no, no) \
SC( 54, 17, 15, 3, no, no) \
SC( 55, 17, 15, 4, no, no) \
\
SC( 56, 18, 16, 1, no, no) \
SC( 57, 18, 16, 2, no, no) \
SC( 58, 18, 16, 3, no, no) \
SC( 59, 18, 16, 4, no, no) \
\
SC( 60, 19, 17, 1, no, no) \
SC( 61, 19, 17, 2, no, no) \
SC( 62, 19, 17, 3, no, no) \
SC( 63, 19, 17, 4, no, no) \
\
SC( 64, 20, 18, 1, no, no) \
SC( 65, 20, 18, 2, no, no) \
SC( 66, 20, 18, 3, no, no) \
SC( 67, 20, 18, 4, no, no) \
\
SC( 68, 21, 19, 1, no, no) \
SC( 69, 21, 19, 2, no, no) \
SC( 70, 21, 19, 3, no, no) \
SC( 71, 21, 19, 4, no, no) \
\
SC( 72, 22, 20, 1, no, no) \
SC( 73, 22, 20, 2, no, no) \
SC( 74, 22, 20, 3, no, no) \
SC( 75, 22, 20, 4, no, no) \
\
SC( 76, 23, 21, 1, no, no) \
SC( 77, 23, 21, 2, no, no) \
SC( 78, 23, 21, 3, no, no) \
SC( 79, 23, 21, 4, no, no) \
\
SC( 80, 24, 22, 1, no, no) \
SC( 81, 24, 22, 2, no, no) \
SC( 82, 24, 22, 3, no, no) \
SC( 83, 24, 22, 4, no, no) \
\
SC( 84, 25, 23, 1, no, no) \
SC( 85, 25, 23, 2, no, no) \
SC( 86, 25, 23, 3, no, no) \
SC( 87, 25, 23, 4, no, no) \
\
SC( 88, 26, 24, 1, no, no) \
SC( 89, 26, 24, 2, no, no) \
SC( 90, 26, 24, 3, no, no) \
SC( 91, 26, 24, 4, no, no) \
\
SC( 92, 27, 25, 1, no, no) \
SC( 93, 27, 25, 2, no, no) \
SC( 94, 27, 25, 3, no, no) \
SC( 95, 27, 25, 4, no, no) \
\
SC( 96, 28, 26, 1, no, no) \
SC( 97, 28, 26, 2, no, no) \
SC( 98, 28, 26, 3, no, no) \
SC( 99, 28, 26, 4, no, no) \
\
SC(100, 29, 27, 1, no, no) \
SC(101, 29, 27, 2, no, no) \
SC(102, 29, 27, 3, no, no) \
SC(103, 29, 27, 4, no, no) \
\
SC(104, 30, 28, 1, no, no) \
SC(105, 30, 28, 2, no, no) \
SC(106, 30, 28, 3, no, no) \
SC(107, 30, 28, 4, no, no) \
\
SC(108, 31, 29, 1, no, no) \
SC(109, 31, 29, 2, no, no) \
SC(110, 31, 29, 3, no, no) \
SC(111, 31, 29, 4, no, no) \
\
SC(112, 32, 30, 1, no, no) \
SC(113, 32, 30, 2, no, no) \
SC(114, 32, 30, 3, no, no) \
SC(115, 32, 30, 4, no, no) \
\
SC(116, 33, 31, 1, no, no) \
SC(117, 33, 31, 2, no, no) \
SC(118, 33, 31, 3, no, no) \
SC(119, 33, 31, 4, no, no) \
\
SC(120, 34, 32, 1, no, no) \
SC(121, 34, 32, 2, no, no) \
SC(122, 34, 32, 3, no, no) \
SC(123, 34, 32, 4, no, no) \
\
SC(124, 35, 33, 1, no, no) \
SC(125, 35, 33, 2, no, no) \
SC(126, 35, 33, 3, no, no) \
SC(127, 35, 33, 4, no, no) \
\
SC(128, 36, 34, 1, no, no) \
SC(129, 36, 34, 2, no, no) \
SC(130, 36, 34, 3, no, no) \
SC(131, 36, 34, 4, no, no) \
\
SC(132, 37, 35, 1, no, no) \
SC(133, 37, 35, 2, no, no) \
SC(134, 37, 35, 3, no, no) \
SC(135, 37, 35, 4, no, no) \
\
SC(136, 38, 36, 1, no, no) \
SC(137, 38, 36, 2, no, no) \
SC(138, 38, 36, 3, no, no) \
SC(139, 38, 36, 4, no, no) \
\
SC(140, 39, 37, 1, no, no) \
SC(141, 39, 37, 2, no, no) \
SC(142, 39, 37, 3, no, no) \
SC(143, 39, 37, 4, no, no) \
\
SC(144, 40, 38, 1, no, no) \
SC(145, 40, 38, 2, no, no) \
SC(146, 40, 38, 3, no, no) \
SC(147, 40, 38, 4, no, no) \
\
SC(148, 41, 39, 1, no, no) \
SC(149, 41, 39, 2, no, no) \
SC(150, 41, 39, 3, no, no) \
SC(151, 41, 39, 4, no, no) \
\
SC(152, 42, 40, 1, no, no) \
SC(153, 42, 40, 2, no, no) \
SC(154, 42, 40, 3, no, no) \
SC(155, 42, 40, 4, no, no) \
\
SC(156, 43, 41, 1, no, no) \
SC(157, 43, 41, 2, no, no) \
SC(158, 43, 41, 3, no, no) \
SC(159, 43, 41, 4, no, no) \
\
SC(160, 44, 42, 1, no, no) \
SC(161, 44, 42, 2, no, no) \
SC(162, 44, 42, 3, no, no) \
SC(163, 44, 42, 4, no, no) \
\
SC(164, 45, 43, 1, no, no) \
SC(165, 45, 43, 2, no, no) \
SC(166, 45, 43, 3, no, no) \
SC(167, 45, 43, 4, no, no) \
\
SC(168, 46, 44, 1, no, no) \
SC(169, 46, 44, 2, no, no) \
SC(170, 46, 44, 3, no, no) \
SC(171, 46, 44, 4, no, no) \
\
SC(172, 47, 45, 1, no, no) \
SC(173, 47, 45, 2, no, no) \
SC(174, 47, 45, 3, no, no) \
SC(175, 47, 45, 4, no, no) \
\
SC(176, 48, 46, 1, no, no) \
SC(177, 48, 46, 2, no, no) \
SC(178, 48, 46, 3, no, no) \
SC(179, 48, 46, 4, no, no) \
\
SC(180, 49, 47, 1, no, no) \
SC(181, 49, 47, 2, no, no) \
SC(182, 49, 47, 3, no, no) \
SC(183, 49, 47, 4, no, no) \
\
SC(184, 50, 48, 1, no, no) \
SC(185, 50, 48, 2, no, no) \
SC(186, 50, 48, 3, no, no) \
SC(187, 50, 48, 4, no, no) \
\
SC(188, 51, 49, 1, no, no) \
SC(189, 51, 49, 2, no, no) \
SC(190, 51, 49, 3, no, no) \
SC(191, 51, 49, 4, no, no) \
\
SC(192, 52, 50, 1, no, no) \
SC(193, 52, 50, 2, no, no) \
SC(194, 52, 50, 3, no, no) \
SC(195, 52, 50, 4, no, no) \
\
SC(196, 53, 51, 1, no, no) \
SC(197, 53, 51, 2, no, no) \
SC(198, 53, 51, 3, no, no) \
SC(199, 53, 51, 4, no, no) \
\
SC(200, 54, 52, 1, no, no) \
SC(201, 54, 52, 2, no, no) \
SC(202, 54, 52, 3, no, no) \
SC(203, 54, 52, 4, no, no) \
\
SC(204, 55, 53, 1, no, no) \
SC(205, 55, 53, 2, no, no) \
SC(206, 55, 53, 3, no, no) \
SC(207, 55, 53, 4, no, no) \
\
SC(208, 56, 54, 1, no, no) \
SC(209, 56, 54, 2, no, no) \
SC(210, 56, 54, 3, no, no) \
SC(211, 56, 54, 4, no, no) \
\
SC(212, 57, 55, 1, no, no) \
SC(213, 57, 55, 2, no, no) \
SC(214, 57, 55, 3, no, no) \
SC(215, 57, 55, 4, no, no) \
\
SC(216, 58, 56, 1, no, no) \
SC(217, 58, 56, 2, no, no) \
SC(218, 58, 56, 3, no, no) \
SC(219, 58, 56, 4, no, no) \
\
SC(220, 59, 57, 1, no, no) \
SC(221, 59, 57, 2, no, no) \
SC(222, 59, 57, 3, no, no) \
SC(223, 59, 57, 4, no, no) \
\
SC(224, 60, 58, 1, no, no) \
SC(225, 60, 58, 2, no, no) \
SC(226, 60, 58, 3, no, no) \
SC(227, 60, 58, 4, no, no) \
\
SC(228, 61, 59, 1, no, no) \
SC(229, 61, 59, 2, no, no) \
SC(230, 61, 59, 3, no, no) \
SC(231, 61, 59, 4, no, no) \
\
SC(232, 62, 60, 1, no, no) \
SC(233, 62, 60, 2, no, no) \
SC(234, 62, 60, 3, no, no) \
SC(235, 62, 60, 4, no, no) \
\
SC(236, 63, 61, 1, no, no) \
SC(237, 63, 61, 2, no, no) \
SC(238, 63, 61, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 0
#define NLBINS 32
#define NBINS 35
#define LG_TINY_MAXCLASS "NA"
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 12) + (((size_t)3) << 10))
#endif
#if (LG_SIZEOF_PTR == 3 && LG_TINY_MIN == 3 && LG_QUANTUM == 3 && LG_PAGE == 16)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 3, 3, 0, yes, 3) \
SC( 1, 3, 3, 1, yes, 3) \
SC( 2, 3, 3, 2, yes, 3) \
SC( 3, 3, 3, 3, yes, 3) \
\
SC( 4, 5, 3, 1, yes, 3) \
SC( 5, 5, 3, 2, yes, 3) \
SC( 6, 5, 3, 3, yes, 3) \
SC( 7, 5, 3, 4, yes, 3) \
\
SC( 8, 6, 4, 1, yes, 4) \
SC( 9, 6, 4, 2, yes, 4) \
SC( 10, 6, 4, 3, yes, 4) \
SC( 11, 6, 4, 4, yes, 4) \
\
SC( 12, 7, 5, 1, yes, 5) \
SC( 13, 7, 5, 2, yes, 5) \
SC( 14, 7, 5, 3, yes, 5) \
SC( 15, 7, 5, 4, yes, 5) \
\
SC( 16, 8, 6, 1, yes, 6) \
SC( 17, 8, 6, 2, yes, 6) \
SC( 18, 8, 6, 3, yes, 6) \
SC( 19, 8, 6, 4, yes, 6) \
\
SC( 20, 9, 7, 1, yes, 7) \
SC( 21, 9, 7, 2, yes, 7) \
SC( 22, 9, 7, 3, yes, 7) \
SC( 23, 9, 7, 4, yes, 7) \
\
SC( 24, 10, 8, 1, yes, 8) \
SC( 25, 10, 8, 2, yes, 8) \
SC( 26, 10, 8, 3, yes, 8) \
SC( 27, 10, 8, 4, yes, 8) \
\
SC( 28, 11, 9, 1, yes, 9) \
SC( 29, 11, 9, 2, yes, 9) \
SC( 30, 11, 9, 3, yes, 9) \
SC( 31, 11, 9, 4, yes, 9) \
\
SC( 32, 12, 10, 1, yes, no) \
SC( 33, 12, 10, 2, yes, no) \
SC( 34, 12, 10, 3, yes, no) \
SC( 35, 12, 10, 4, yes, no) \
\
SC( 36, 13, 11, 1, yes, no) \
SC( 37, 13, 11, 2, yes, no) \
SC( 38, 13, 11, 3, yes, no) \
SC( 39, 13, 11, 4, yes, no) \
\
SC( 40, 14, 12, 1, yes, no) \
SC( 41, 14, 12, 2, yes, no) \
SC( 42, 14, 12, 3, yes, no) \
SC( 43, 14, 12, 4, yes, no) \
\
SC( 44, 15, 13, 1, yes, no) \
SC( 45, 15, 13, 2, yes, no) \
SC( 46, 15, 13, 3, yes, no) \
SC( 47, 15, 13, 4, no, no) \
\
SC( 48, 16, 14, 1, no, no) \
SC( 49, 16, 14, 2, no, no) \
SC( 50, 16, 14, 3, no, no) \
SC( 51, 16, 14, 4, no, no) \
\
SC( 52, 17, 15, 1, no, no) \
SC( 53, 17, 15, 2, no, no) \
SC( 54, 17, 15, 3, no, no) \
SC( 55, 17, 15, 4, no, no) \
\
SC( 56, 18, 16, 1, no, no) \
SC( 57, 18, 16, 2, no, no) \
SC( 58, 18, 16, 3, no, no) \
SC( 59, 18, 16, 4, no, no) \
\
SC( 60, 19, 17, 1, no, no) \
SC( 61, 19, 17, 2, no, no) \
SC( 62, 19, 17, 3, no, no) \
SC( 63, 19, 17, 4, no, no) \
\
SC( 64, 20, 18, 1, no, no) \
SC( 65, 20, 18, 2, no, no) \
SC( 66, 20, 18, 3, no, no) \
SC( 67, 20, 18, 4, no, no) \
\
SC( 68, 21, 19, 1, no, no) \
SC( 69, 21, 19, 2, no, no) \
SC( 70, 21, 19, 3, no, no) \
SC( 71, 21, 19, 4, no, no) \
\
SC( 72, 22, 20, 1, no, no) \
SC( 73, 22, 20, 2, no, no) \
SC( 74, 22, 20, 3, no, no) \
SC( 75, 22, 20, 4, no, no) \
\
SC( 76, 23, 21, 1, no, no) \
SC( 77, 23, 21, 2, no, no) \
SC( 78, 23, 21, 3, no, no) \
SC( 79, 23, 21, 4, no, no) \
\
SC( 80, 24, 22, 1, no, no) \
SC( 81, 24, 22, 2, no, no) \
SC( 82, 24, 22, 3, no, no) \
SC( 83, 24, 22, 4, no, no) \
\
SC( 84, 25, 23, 1, no, no) \
SC( 85, 25, 23, 2, no, no) \
SC( 86, 25, 23, 3, no, no) \
SC( 87, 25, 23, 4, no, no) \
\
SC( 88, 26, 24, 1, no, no) \
SC( 89, 26, 24, 2, no, no) \
SC( 90, 26, 24, 3, no, no) \
SC( 91, 26, 24, 4, no, no) \
\
SC( 92, 27, 25, 1, no, no) \
SC( 93, 27, 25, 2, no, no) \
SC( 94, 27, 25, 3, no, no) \
SC( 95, 27, 25, 4, no, no) \
\
SC( 96, 28, 26, 1, no, no) \
SC( 97, 28, 26, 2, no, no) \
SC( 98, 28, 26, 3, no, no) \
SC( 99, 28, 26, 4, no, no) \
\
SC(100, 29, 27, 1, no, no) \
SC(101, 29, 27, 2, no, no) \
SC(102, 29, 27, 3, no, no) \
SC(103, 29, 27, 4, no, no) \
\
SC(104, 30, 28, 1, no, no) \
SC(105, 30, 28, 2, no, no) \
SC(106, 30, 28, 3, no, no) \
SC(107, 30, 28, 4, no, no) \
\
SC(108, 31, 29, 1, no, no) \
SC(109, 31, 29, 2, no, no) \
SC(110, 31, 29, 3, no, no) \
SC(111, 31, 29, 4, no, no) \
\
SC(112, 32, 30, 1, no, no) \
SC(113, 32, 30, 2, no, no) \
SC(114, 32, 30, 3, no, no) \
SC(115, 32, 30, 4, no, no) \
\
SC(116, 33, 31, 1, no, no) \
SC(117, 33, 31, 2, no, no) \
SC(118, 33, 31, 3, no, no) \
SC(119, 33, 31, 4, no, no) \
\
SC(120, 34, 32, 1, no, no) \
SC(121, 34, 32, 2, no, no) \
SC(122, 34, 32, 3, no, no) \
SC(123, 34, 32, 4, no, no) \
\
SC(124, 35, 33, 1, no, no) \
SC(125, 35, 33, 2, no, no) \
SC(126, 35, 33, 3, no, no) \
SC(127, 35, 33, 4, no, no) \
\
SC(128, 36, 34, 1, no, no) \
SC(129, 36, 34, 2, no, no) \
SC(130, 36, 34, 3, no, no) \
SC(131, 36, 34, 4, no, no) \
\
SC(132, 37, 35, 1, no, no) \
SC(133, 37, 35, 2, no, no) \
SC(134, 37, 35, 3, no, no) \
SC(135, 37, 35, 4, no, no) \
\
SC(136, 38, 36, 1, no, no) \
SC(137, 38, 36, 2, no, no) \
SC(138, 38, 36, 3, no, no) \
SC(139, 38, 36, 4, no, no) \
\
SC(140, 39, 37, 1, no, no) \
SC(141, 39, 37, 2, no, no) \
SC(142, 39, 37, 3, no, no) \
SC(143, 39, 37, 4, no, no) \
\
SC(144, 40, 38, 1, no, no) \
SC(145, 40, 38, 2, no, no) \
SC(146, 40, 38, 3, no, no) \
SC(147, 40, 38, 4, no, no) \
\
SC(148, 41, 39, 1, no, no) \
SC(149, 41, 39, 2, no, no) \
SC(150, 41, 39, 3, no, no) \
SC(151, 41, 39, 4, no, no) \
\
SC(152, 42, 40, 1, no, no) \
SC(153, 42, 40, 2, no, no) \
SC(154, 42, 40, 3, no, no) \
SC(155, 42, 40, 4, no, no) \
\
SC(156, 43, 41, 1, no, no) \
SC(157, 43, 41, 2, no, no) \
SC(158, 43, 41, 3, no, no) \
SC(159, 43, 41, 4, no, no) \
\
SC(160, 44, 42, 1, no, no) \
SC(161, 44, 42, 2, no, no) \
SC(162, 44, 42, 3, no, no) \
SC(163, 44, 42, 4, no, no) \
\
SC(164, 45, 43, 1, no, no) \
SC(165, 45, 43, 2, no, no) \
SC(166, 45, 43, 3, no, no) \
SC(167, 45, 43, 4, no, no) \
\
SC(168, 46, 44, 1, no, no) \
SC(169, 46, 44, 2, no, no) \
SC(170, 46, 44, 3, no, no) \
SC(171, 46, 44, 4, no, no) \
\
SC(172, 47, 45, 1, no, no) \
SC(173, 47, 45, 2, no, no) \
SC(174, 47, 45, 3, no, no) \
SC(175, 47, 45, 4, no, no) \
\
SC(176, 48, 46, 1, no, no) \
SC(177, 48, 46, 2, no, no) \
SC(178, 48, 46, 3, no, no) \
SC(179, 48, 46, 4, no, no) \
\
SC(180, 49, 47, 1, no, no) \
SC(181, 49, 47, 2, no, no) \
SC(182, 49, 47, 3, no, no) \
SC(183, 49, 47, 4, no, no) \
\
SC(184, 50, 48, 1, no, no) \
SC(185, 50, 48, 2, no, no) \
SC(186, 50, 48, 3, no, no) \
SC(187, 50, 48, 4, no, no) \
\
SC(188, 51, 49, 1, no, no) \
SC(189, 51, 49, 2, no, no) \
SC(190, 51, 49, 3, no, no) \
SC(191, 51, 49, 4, no, no) \
\
SC(192, 52, 50, 1, no, no) \
SC(193, 52, 50, 2, no, no) \
SC(194, 52, 50, 3, no, no) \
SC(195, 52, 50, 4, no, no) \
\
SC(196, 53, 51, 1, no, no) \
SC(197, 53, 51, 2, no, no) \
SC(198, 53, 51, 3, no, no) \
SC(199, 53, 51, 4, no, no) \
\
SC(200, 54, 52, 1, no, no) \
SC(201, 54, 52, 2, no, no) \
SC(202, 54, 52, 3, no, no) \
SC(203, 54, 52, 4, no, no) \
\
SC(204, 55, 53, 1, no, no) \
SC(205, 55, 53, 2, no, no) \
SC(206, 55, 53, 3, no, no) \
SC(207, 55, 53, 4, no, no) \
\
SC(208, 56, 54, 1, no, no) \
SC(209, 56, 54, 2, no, no) \
SC(210, 56, 54, 3, no, no) \
SC(211, 56, 54, 4, no, no) \
\
SC(212, 57, 55, 1, no, no) \
SC(213, 57, 55, 2, no, no) \
SC(214, 57, 55, 3, no, no) \
SC(215, 57, 55, 4, no, no) \
\
SC(216, 58, 56, 1, no, no) \
SC(217, 58, 56, 2, no, no) \
SC(218, 58, 56, 3, no, no) \
SC(219, 58, 56, 4, no, no) \
\
SC(220, 59, 57, 1, no, no) \
SC(221, 59, 57, 2, no, no) \
SC(222, 59, 57, 3, no, no) \
SC(223, 59, 57, 4, no, no) \
\
SC(224, 60, 58, 1, no, no) \
SC(225, 60, 58, 2, no, no) \
SC(226, 60, 58, 3, no, no) \
SC(227, 60, 58, 4, no, no) \
\
SC(228, 61, 59, 1, no, no) \
SC(229, 61, 59, 2, no, no) \
SC(230, 61, 59, 3, no, no) \
SC(231, 61, 59, 4, no, no) \
\
SC(232, 62, 60, 1, no, no) \
SC(233, 62, 60, 2, no, no) \
SC(234, 62, 60, 3, no, no) \
SC(235, 62, 60, 4, no, no) \
\
SC(236, 63, 61, 1, no, no) \
SC(237, 63, 61, 2, no, no) \
SC(238, 63, 61, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 0
#define NLBINS 32
#define NBINS 47
#define LG_TINY_MAXCLASS "NA"
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 15) + (((size_t)3) << 13))
#endif
#if (LG_SIZEOF_PTR == 3 && LG_TINY_MIN == 3 && LG_QUANTUM == 4 && LG_PAGE == 12)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 3, 3, 0, yes, 3) \
\
SC( 1, 3, 3, 1, yes, 3) \
SC( 2, 4, 4, 1, yes, 4) \
SC( 3, 4, 4, 2, yes, 4) \
SC( 4, 4, 4, 3, yes, 4) \
\
SC( 5, 6, 4, 1, yes, 4) \
SC( 6, 6, 4, 2, yes, 4) \
SC( 7, 6, 4, 3, yes, 4) \
SC( 8, 6, 4, 4, yes, 4) \
\
SC( 9, 7, 5, 1, yes, 5) \
SC( 10, 7, 5, 2, yes, 5) \
SC( 11, 7, 5, 3, yes, 5) \
SC( 12, 7, 5, 4, yes, 5) \
\
SC( 13, 8, 6, 1, yes, 6) \
SC( 14, 8, 6, 2, yes, 6) \
SC( 15, 8, 6, 3, yes, 6) \
SC( 16, 8, 6, 4, yes, 6) \
\
SC( 17, 9, 7, 1, yes, 7) \
SC( 18, 9, 7, 2, yes, 7) \
SC( 19, 9, 7, 3, yes, 7) \
SC( 20, 9, 7, 4, yes, 7) \
\
SC( 21, 10, 8, 1, yes, 8) \
SC( 22, 10, 8, 2, yes, 8) \
SC( 23, 10, 8, 3, yes, 8) \
SC( 24, 10, 8, 4, yes, 8) \
\
SC( 25, 11, 9, 1, yes, 9) \
SC( 26, 11, 9, 2, yes, 9) \
SC( 27, 11, 9, 3, yes, 9) \
SC( 28, 11, 9, 4, no, 9) \
\
SC( 29, 12, 10, 1, no, no) \
SC( 30, 12, 10, 2, no, no) \
SC( 31, 12, 10, 3, no, no) \
SC( 32, 12, 10, 4, no, no) \
\
SC( 33, 13, 11, 1, no, no) \
SC( 34, 13, 11, 2, no, no) \
SC( 35, 13, 11, 3, no, no) \
SC( 36, 13, 11, 4, no, no) \
\
SC( 37, 14, 12, 1, no, no) \
SC( 38, 14, 12, 2, no, no) \
SC( 39, 14, 12, 3, no, no) \
SC( 40, 14, 12, 4, no, no) \
\
SC( 41, 15, 13, 1, no, no) \
SC( 42, 15, 13, 2, no, no) \
SC( 43, 15, 13, 3, no, no) \
SC( 44, 15, 13, 4, no, no) \
\
SC( 45, 16, 14, 1, no, no) \
SC( 46, 16, 14, 2, no, no) \
SC( 47, 16, 14, 3, no, no) \
SC( 48, 16, 14, 4, no, no) \
\
SC( 49, 17, 15, 1, no, no) \
SC( 50, 17, 15, 2, no, no) \
SC( 51, 17, 15, 3, no, no) \
SC( 52, 17, 15, 4, no, no) \
\
SC( 53, 18, 16, 1, no, no) \
SC( 54, 18, 16, 2, no, no) \
SC( 55, 18, 16, 3, no, no) \
SC( 56, 18, 16, 4, no, no) \
\
SC( 57, 19, 17, 1, no, no) \
SC( 58, 19, 17, 2, no, no) \
SC( 59, 19, 17, 3, no, no) \
SC( 60, 19, 17, 4, no, no) \
\
SC( 61, 20, 18, 1, no, no) \
SC( 62, 20, 18, 2, no, no) \
SC( 63, 20, 18, 3, no, no) \
SC( 64, 20, 18, 4, no, no) \
\
SC( 65, 21, 19, 1, no, no) \
SC( 66, 21, 19, 2, no, no) \
SC( 67, 21, 19, 3, no, no) \
SC( 68, 21, 19, 4, no, no) \
\
SC( 69, 22, 20, 1, no, no) \
SC( 70, 22, 20, 2, no, no) \
SC( 71, 22, 20, 3, no, no) \
SC( 72, 22, 20, 4, no, no) \
\
SC( 73, 23, 21, 1, no, no) \
SC( 74, 23, 21, 2, no, no) \
SC( 75, 23, 21, 3, no, no) \
SC( 76, 23, 21, 4, no, no) \
\
SC( 77, 24, 22, 1, no, no) \
SC( 78, 24, 22, 2, no, no) \
SC( 79, 24, 22, 3, no, no) \
SC( 80, 24, 22, 4, no, no) \
\
SC( 81, 25, 23, 1, no, no) \
SC( 82, 25, 23, 2, no, no) \
SC( 83, 25, 23, 3, no, no) \
SC( 84, 25, 23, 4, no, no) \
\
SC( 85, 26, 24, 1, no, no) \
SC( 86, 26, 24, 2, no, no) \
SC( 87, 26, 24, 3, no, no) \
SC( 88, 26, 24, 4, no, no) \
\
SC( 89, 27, 25, 1, no, no) \
SC( 90, 27, 25, 2, no, no) \
SC( 91, 27, 25, 3, no, no) \
SC( 92, 27, 25, 4, no, no) \
\
SC( 93, 28, 26, 1, no, no) \
SC( 94, 28, 26, 2, no, no) \
SC( 95, 28, 26, 3, no, no) \
SC( 96, 28, 26, 4, no, no) \
\
SC( 97, 29, 27, 1, no, no) \
SC( 98, 29, 27, 2, no, no) \
SC( 99, 29, 27, 3, no, no) \
SC(100, 29, 27, 4, no, no) \
\
SC(101, 30, 28, 1, no, no) \
SC(102, 30, 28, 2, no, no) \
SC(103, 30, 28, 3, no, no) \
SC(104, 30, 28, 4, no, no) \
\
SC(105, 31, 29, 1, no, no) \
SC(106, 31, 29, 2, no, no) \
SC(107, 31, 29, 3, no, no) \
SC(108, 31, 29, 4, no, no) \
\
SC(109, 32, 30, 1, no, no) \
SC(110, 32, 30, 2, no, no) \
SC(111, 32, 30, 3, no, no) \
SC(112, 32, 30, 4, no, no) \
\
SC(113, 33, 31, 1, no, no) \
SC(114, 33, 31, 2, no, no) \
SC(115, 33, 31, 3, no, no) \
SC(116, 33, 31, 4, no, no) \
\
SC(117, 34, 32, 1, no, no) \
SC(118, 34, 32, 2, no, no) \
SC(119, 34, 32, 3, no, no) \
SC(120, 34, 32, 4, no, no) \
\
SC(121, 35, 33, 1, no, no) \
SC(122, 35, 33, 2, no, no) \
SC(123, 35, 33, 3, no, no) \
SC(124, 35, 33, 4, no, no) \
\
SC(125, 36, 34, 1, no, no) \
SC(126, 36, 34, 2, no, no) \
SC(127, 36, 34, 3, no, no) \
SC(128, 36, 34, 4, no, no) \
\
SC(129, 37, 35, 1, no, no) \
SC(130, 37, 35, 2, no, no) \
SC(131, 37, 35, 3, no, no) \
SC(132, 37, 35, 4, no, no) \
\
SC(133, 38, 36, 1, no, no) \
SC(134, 38, 36, 2, no, no) \
SC(135, 38, 36, 3, no, no) \
SC(136, 38, 36, 4, no, no) \
\
SC(137, 39, 37, 1, no, no) \
SC(138, 39, 37, 2, no, no) \
SC(139, 39, 37, 3, no, no) \
SC(140, 39, 37, 4, no, no) \
\
SC(141, 40, 38, 1, no, no) \
SC(142, 40, 38, 2, no, no) \
SC(143, 40, 38, 3, no, no) \
SC(144, 40, 38, 4, no, no) \
\
SC(145, 41, 39, 1, no, no) \
SC(146, 41, 39, 2, no, no) \
SC(147, 41, 39, 3, no, no) \
SC(148, 41, 39, 4, no, no) \
\
SC(149, 42, 40, 1, no, no) \
SC(150, 42, 40, 2, no, no) \
SC(151, 42, 40, 3, no, no) \
SC(152, 42, 40, 4, no, no) \
\
SC(153, 43, 41, 1, no, no) \
SC(154, 43, 41, 2, no, no) \
SC(155, 43, 41, 3, no, no) \
SC(156, 43, 41, 4, no, no) \
\
SC(157, 44, 42, 1, no, no) \
SC(158, 44, 42, 2, no, no) \
SC(159, 44, 42, 3, no, no) \
SC(160, 44, 42, 4, no, no) \
\
SC(161, 45, 43, 1, no, no) \
SC(162, 45, 43, 2, no, no) \
SC(163, 45, 43, 3, no, no) \
SC(164, 45, 43, 4, no, no) \
\
SC(165, 46, 44, 1, no, no) \
SC(166, 46, 44, 2, no, no) \
SC(167, 46, 44, 3, no, no) \
SC(168, 46, 44, 4, no, no) \
\
SC(169, 47, 45, 1, no, no) \
SC(170, 47, 45, 2, no, no) \
SC(171, 47, 45, 3, no, no) \
SC(172, 47, 45, 4, no, no) \
\
SC(173, 48, 46, 1, no, no) \
SC(174, 48, 46, 2, no, no) \
SC(175, 48, 46, 3, no, no) \
SC(176, 48, 46, 4, no, no) \
\
SC(177, 49, 47, 1, no, no) \
SC(178, 49, 47, 2, no, no) \
SC(179, 49, 47, 3, no, no) \
SC(180, 49, 47, 4, no, no) \
\
SC(181, 50, 48, 1, no, no) \
SC(182, 50, 48, 2, no, no) \
SC(183, 50, 48, 3, no, no) \
SC(184, 50, 48, 4, no, no) \
\
SC(185, 51, 49, 1, no, no) \
SC(186, 51, 49, 2, no, no) \
SC(187, 51, 49, 3, no, no) \
SC(188, 51, 49, 4, no, no) \
\
SC(189, 52, 50, 1, no, no) \
SC(190, 52, 50, 2, no, no) \
SC(191, 52, 50, 3, no, no) \
SC(192, 52, 50, 4, no, no) \
\
SC(193, 53, 51, 1, no, no) \
SC(194, 53, 51, 2, no, no) \
SC(195, 53, 51, 3, no, no) \
SC(196, 53, 51, 4, no, no) \
\
SC(197, 54, 52, 1, no, no) \
SC(198, 54, 52, 2, no, no) \
SC(199, 54, 52, 3, no, no) \
SC(200, 54, 52, 4, no, no) \
\
SC(201, 55, 53, 1, no, no) \
SC(202, 55, 53, 2, no, no) \
SC(203, 55, 53, 3, no, no) \
SC(204, 55, 53, 4, no, no) \
\
SC(205, 56, 54, 1, no, no) \
SC(206, 56, 54, 2, no, no) \
SC(207, 56, 54, 3, no, no) \
SC(208, 56, 54, 4, no, no) \
\
SC(209, 57, 55, 1, no, no) \
SC(210, 57, 55, 2, no, no) \
SC(211, 57, 55, 3, no, no) \
SC(212, 57, 55, 4, no, no) \
\
SC(213, 58, 56, 1, no, no) \
SC(214, 58, 56, 2, no, no) \
SC(215, 58, 56, 3, no, no) \
SC(216, 58, 56, 4, no, no) \
\
SC(217, 59, 57, 1, no, no) \
SC(218, 59, 57, 2, no, no) \
SC(219, 59, 57, 3, no, no) \
SC(220, 59, 57, 4, no, no) \
\
SC(221, 60, 58, 1, no, no) \
SC(222, 60, 58, 2, no, no) \
SC(223, 60, 58, 3, no, no) \
SC(224, 60, 58, 4, no, no) \
\
SC(225, 61, 59, 1, no, no) \
SC(226, 61, 59, 2, no, no) \
SC(227, 61, 59, 3, no, no) \
SC(228, 61, 59, 4, no, no) \
\
SC(229, 62, 60, 1, no, no) \
SC(230, 62, 60, 2, no, no) \
SC(231, 62, 60, 3, no, no) \
SC(232, 62, 60, 4, no, no) \
\
SC(233, 63, 61, 1, no, no) \
SC(234, 63, 61, 2, no, no) \
SC(235, 63, 61, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 1
#define NLBINS 29
#define NBINS 28
#define LG_TINY_MAXCLASS 3
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 11) + (((size_t)3) << 9))
#endif
#if (LG_SIZEOF_PTR == 3 && LG_TINY_MIN == 3 && LG_QUANTUM == 4 && LG_PAGE == 13)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 3, 3, 0, yes, 3) \
\
SC( 1, 3, 3, 1, yes, 3) \
SC( 2, 4, 4, 1, yes, 4) \
SC( 3, 4, 4, 2, yes, 4) \
SC( 4, 4, 4, 3, yes, 4) \
\
SC( 5, 6, 4, 1, yes, 4) \
SC( 6, 6, 4, 2, yes, 4) \
SC( 7, 6, 4, 3, yes, 4) \
SC( 8, 6, 4, 4, yes, 4) \
\
SC( 9, 7, 5, 1, yes, 5) \
SC( 10, 7, 5, 2, yes, 5) \
SC( 11, 7, 5, 3, yes, 5) \
SC( 12, 7, 5, 4, yes, 5) \
\
SC( 13, 8, 6, 1, yes, 6) \
SC( 14, 8, 6, 2, yes, 6) \
SC( 15, 8, 6, 3, yes, 6) \
SC( 16, 8, 6, 4, yes, 6) \
\
SC( 17, 9, 7, 1, yes, 7) \
SC( 18, 9, 7, 2, yes, 7) \
SC( 19, 9, 7, 3, yes, 7) \
SC( 20, 9, 7, 4, yes, 7) \
\
SC( 21, 10, 8, 1, yes, 8) \
SC( 22, 10, 8, 2, yes, 8) \
SC( 23, 10, 8, 3, yes, 8) \
SC( 24, 10, 8, 4, yes, 8) \
\
SC( 25, 11, 9, 1, yes, 9) \
SC( 26, 11, 9, 2, yes, 9) \
SC( 27, 11, 9, 3, yes, 9) \
SC( 28, 11, 9, 4, yes, 9) \
\
SC( 29, 12, 10, 1, yes, no) \
SC( 30, 12, 10, 2, yes, no) \
SC( 31, 12, 10, 3, yes, no) \
SC( 32, 12, 10, 4, no, no) \
\
SC( 33, 13, 11, 1, no, no) \
SC( 34, 13, 11, 2, no, no) \
SC( 35, 13, 11, 3, no, no) \
SC( 36, 13, 11, 4, no, no) \
\
SC( 37, 14, 12, 1, no, no) \
SC( 38, 14, 12, 2, no, no) \
SC( 39, 14, 12, 3, no, no) \
SC( 40, 14, 12, 4, no, no) \
\
SC( 41, 15, 13, 1, no, no) \
SC( 42, 15, 13, 2, no, no) \
SC( 43, 15, 13, 3, no, no) \
SC( 44, 15, 13, 4, no, no) \
\
SC( 45, 16, 14, 1, no, no) \
SC( 46, 16, 14, 2, no, no) \
SC( 47, 16, 14, 3, no, no) \
SC( 48, 16, 14, 4, no, no) \
\
SC( 49, 17, 15, 1, no, no) \
SC( 50, 17, 15, 2, no, no) \
SC( 51, 17, 15, 3, no, no) \
SC( 52, 17, 15, 4, no, no) \
\
SC( 53, 18, 16, 1, no, no) \
SC( 54, 18, 16, 2, no, no) \
SC( 55, 18, 16, 3, no, no) \
SC( 56, 18, 16, 4, no, no) \
\
SC( 57, 19, 17, 1, no, no) \
SC( 58, 19, 17, 2, no, no) \
SC( 59, 19, 17, 3, no, no) \
SC( 60, 19, 17, 4, no, no) \
\
SC( 61, 20, 18, 1, no, no) \
SC( 62, 20, 18, 2, no, no) \
SC( 63, 20, 18, 3, no, no) \
SC( 64, 20, 18, 4, no, no) \
\
SC( 65, 21, 19, 1, no, no) \
SC( 66, 21, 19, 2, no, no) \
SC( 67, 21, 19, 3, no, no) \
SC( 68, 21, 19, 4, no, no) \
\
SC( 69, 22, 20, 1, no, no) \
SC( 70, 22, 20, 2, no, no) \
SC( 71, 22, 20, 3, no, no) \
SC( 72, 22, 20, 4, no, no) \
\
SC( 73, 23, 21, 1, no, no) \
SC( 74, 23, 21, 2, no, no) \
SC( 75, 23, 21, 3, no, no) \
SC( 76, 23, 21, 4, no, no) \
\
SC( 77, 24, 22, 1, no, no) \
SC( 78, 24, 22, 2, no, no) \
SC( 79, 24, 22, 3, no, no) \
SC( 80, 24, 22, 4, no, no) \
\
SC( 81, 25, 23, 1, no, no) \
SC( 82, 25, 23, 2, no, no) \
SC( 83, 25, 23, 3, no, no) \
SC( 84, 25, 23, 4, no, no) \
\
SC( 85, 26, 24, 1, no, no) \
SC( 86, 26, 24, 2, no, no) \
SC( 87, 26, 24, 3, no, no) \
SC( 88, 26, 24, 4, no, no) \
\
SC( 89, 27, 25, 1, no, no) \
SC( 90, 27, 25, 2, no, no) \
SC( 91, 27, 25, 3, no, no) \
SC( 92, 27, 25, 4, no, no) \
\
SC( 93, 28, 26, 1, no, no) \
SC( 94, 28, 26, 2, no, no) \
SC( 95, 28, 26, 3, no, no) \
SC( 96, 28, 26, 4, no, no) \
\
SC( 97, 29, 27, 1, no, no) \
SC( 98, 29, 27, 2, no, no) \
SC( 99, 29, 27, 3, no, no) \
SC(100, 29, 27, 4, no, no) \
\
SC(101, 30, 28, 1, no, no) \
SC(102, 30, 28, 2, no, no) \
SC(103, 30, 28, 3, no, no) \
SC(104, 30, 28, 4, no, no) \
\
SC(105, 31, 29, 1, no, no) \
SC(106, 31, 29, 2, no, no) \
SC(107, 31, 29, 3, no, no) \
SC(108, 31, 29, 4, no, no) \
\
SC(109, 32, 30, 1, no, no) \
SC(110, 32, 30, 2, no, no) \
SC(111, 32, 30, 3, no, no) \
SC(112, 32, 30, 4, no, no) \
\
SC(113, 33, 31, 1, no, no) \
SC(114, 33, 31, 2, no, no) \
SC(115, 33, 31, 3, no, no) \
SC(116, 33, 31, 4, no, no) \
\
SC(117, 34, 32, 1, no, no) \
SC(118, 34, 32, 2, no, no) \
SC(119, 34, 32, 3, no, no) \
SC(120, 34, 32, 4, no, no) \
\
SC(121, 35, 33, 1, no, no) \
SC(122, 35, 33, 2, no, no) \
SC(123, 35, 33, 3, no, no) \
SC(124, 35, 33, 4, no, no) \
\
SC(125, 36, 34, 1, no, no) \
SC(126, 36, 34, 2, no, no) \
SC(127, 36, 34, 3, no, no) \
SC(128, 36, 34, 4, no, no) \
\
SC(129, 37, 35, 1, no, no) \
SC(130, 37, 35, 2, no, no) \
SC(131, 37, 35, 3, no, no) \
SC(132, 37, 35, 4, no, no) \
\
SC(133, 38, 36, 1, no, no) \
SC(134, 38, 36, 2, no, no) \
SC(135, 38, 36, 3, no, no) \
SC(136, 38, 36, 4, no, no) \
\
SC(137, 39, 37, 1, no, no) \
SC(138, 39, 37, 2, no, no) \
SC(139, 39, 37, 3, no, no) \
SC(140, 39, 37, 4, no, no) \
\
SC(141, 40, 38, 1, no, no) \
SC(142, 40, 38, 2, no, no) \
SC(143, 40, 38, 3, no, no) \
SC(144, 40, 38, 4, no, no) \
\
SC(145, 41, 39, 1, no, no) \
SC(146, 41, 39, 2, no, no) \
SC(147, 41, 39, 3, no, no) \
SC(148, 41, 39, 4, no, no) \
\
SC(149, 42, 40, 1, no, no) \
SC(150, 42, 40, 2, no, no) \
SC(151, 42, 40, 3, no, no) \
SC(152, 42, 40, 4, no, no) \
\
SC(153, 43, 41, 1, no, no) \
SC(154, 43, 41, 2, no, no) \
SC(155, 43, 41, 3, no, no) \
SC(156, 43, 41, 4, no, no) \
\
SC(157, 44, 42, 1, no, no) \
SC(158, 44, 42, 2, no, no) \
SC(159, 44, 42, 3, no, no) \
SC(160, 44, 42, 4, no, no) \
\
SC(161, 45, 43, 1, no, no) \
SC(162, 45, 43, 2, no, no) \
SC(163, 45, 43, 3, no, no) \
SC(164, 45, 43, 4, no, no) \
\
SC(165, 46, 44, 1, no, no) \
SC(166, 46, 44, 2, no, no) \
SC(167, 46, 44, 3, no, no) \
SC(168, 46, 44, 4, no, no) \
\
SC(169, 47, 45, 1, no, no) \
SC(170, 47, 45, 2, no, no) \
SC(171, 47, 45, 3, no, no) \
SC(172, 47, 45, 4, no, no) \
\
SC(173, 48, 46, 1, no, no) \
SC(174, 48, 46, 2, no, no) \
SC(175, 48, 46, 3, no, no) \
SC(176, 48, 46, 4, no, no) \
\
SC(177, 49, 47, 1, no, no) \
SC(178, 49, 47, 2, no, no) \
SC(179, 49, 47, 3, no, no) \
SC(180, 49, 47, 4, no, no) \
\
SC(181, 50, 48, 1, no, no) \
SC(182, 50, 48, 2, no, no) \
SC(183, 50, 48, 3, no, no) \
SC(184, 50, 48, 4, no, no) \
\
SC(185, 51, 49, 1, no, no) \
SC(186, 51, 49, 2, no, no) \
SC(187, 51, 49, 3, no, no) \
SC(188, 51, 49, 4, no, no) \
\
SC(189, 52, 50, 1, no, no) \
SC(190, 52, 50, 2, no, no) \
SC(191, 52, 50, 3, no, no) \
SC(192, 52, 50, 4, no, no) \
\
SC(193, 53, 51, 1, no, no) \
SC(194, 53, 51, 2, no, no) \
SC(195, 53, 51, 3, no, no) \
SC(196, 53, 51, 4, no, no) \
\
SC(197, 54, 52, 1, no, no) \
SC(198, 54, 52, 2, no, no) \
SC(199, 54, 52, 3, no, no) \
SC(200, 54, 52, 4, no, no) \
\
SC(201, 55, 53, 1, no, no) \
SC(202, 55, 53, 2, no, no) \
SC(203, 55, 53, 3, no, no) \
SC(204, 55, 53, 4, no, no) \
\
SC(205, 56, 54, 1, no, no) \
SC(206, 56, 54, 2, no, no) \
SC(207, 56, 54, 3, no, no) \
SC(208, 56, 54, 4, no, no) \
\
SC(209, 57, 55, 1, no, no) \
SC(210, 57, 55, 2, no, no) \
SC(211, 57, 55, 3, no, no) \
SC(212, 57, 55, 4, no, no) \
\
SC(213, 58, 56, 1, no, no) \
SC(214, 58, 56, 2, no, no) \
SC(215, 58, 56, 3, no, no) \
SC(216, 58, 56, 4, no, no) \
\
SC(217, 59, 57, 1, no, no) \
SC(218, 59, 57, 2, no, no) \
SC(219, 59, 57, 3, no, no) \
SC(220, 59, 57, 4, no, no) \
\
SC(221, 60, 58, 1, no, no) \
SC(222, 60, 58, 2, no, no) \
SC(223, 60, 58, 3, no, no) \
SC(224, 60, 58, 4, no, no) \
\
SC(225, 61, 59, 1, no, no) \
SC(226, 61, 59, 2, no, no) \
SC(227, 61, 59, 3, no, no) \
SC(228, 61, 59, 4, no, no) \
\
SC(229, 62, 60, 1, no, no) \
SC(230, 62, 60, 2, no, no) \
SC(231, 62, 60, 3, no, no) \
SC(232, 62, 60, 4, no, no) \
\
SC(233, 63, 61, 1, no, no) \
SC(234, 63, 61, 2, no, no) \
SC(235, 63, 61, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 1
#define NLBINS 29
#define NBINS 32
#define LG_TINY_MAXCLASS 3
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 12) + (((size_t)3) << 10))
#endif
#if (LG_SIZEOF_PTR == 3 && LG_TINY_MIN == 3 && LG_QUANTUM == 4 && LG_PAGE == 16)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 3, 3, 0, yes, 3) \
\
SC( 1, 3, 3, 1, yes, 3) \
SC( 2, 4, 4, 1, yes, 4) \
SC( 3, 4, 4, 2, yes, 4) \
SC( 4, 4, 4, 3, yes, 4) \
\
SC( 5, 6, 4, 1, yes, 4) \
SC( 6, 6, 4, 2, yes, 4) \
SC( 7, 6, 4, 3, yes, 4) \
SC( 8, 6, 4, 4, yes, 4) \
\
SC( 9, 7, 5, 1, yes, 5) \
SC( 10, 7, 5, 2, yes, 5) \
SC( 11, 7, 5, 3, yes, 5) \
SC( 12, 7, 5, 4, yes, 5) \
\
SC( 13, 8, 6, 1, yes, 6) \
SC( 14, 8, 6, 2, yes, 6) \
SC( 15, 8, 6, 3, yes, 6) \
SC( 16, 8, 6, 4, yes, 6) \
\
SC( 17, 9, 7, 1, yes, 7) \
SC( 18, 9, 7, 2, yes, 7) \
SC( 19, 9, 7, 3, yes, 7) \
SC( 20, 9, 7, 4, yes, 7) \
\
SC( 21, 10, 8, 1, yes, 8) \
SC( 22, 10, 8, 2, yes, 8) \
SC( 23, 10, 8, 3, yes, 8) \
SC( 24, 10, 8, 4, yes, 8) \
\
SC( 25, 11, 9, 1, yes, 9) \
SC( 26, 11, 9, 2, yes, 9) \
SC( 27, 11, 9, 3, yes, 9) \
SC( 28, 11, 9, 4, yes, 9) \
\
SC( 29, 12, 10, 1, yes, no) \
SC( 30, 12, 10, 2, yes, no) \
SC( 31, 12, 10, 3, yes, no) \
SC( 32, 12, 10, 4, yes, no) \
\
SC( 33, 13, 11, 1, yes, no) \
SC( 34, 13, 11, 2, yes, no) \
SC( 35, 13, 11, 3, yes, no) \
SC( 36, 13, 11, 4, yes, no) \
\
SC( 37, 14, 12, 1, yes, no) \
SC( 38, 14, 12, 2, yes, no) \
SC( 39, 14, 12, 3, yes, no) \
SC( 40, 14, 12, 4, yes, no) \
\
SC( 41, 15, 13, 1, yes, no) \
SC( 42, 15, 13, 2, yes, no) \
SC( 43, 15, 13, 3, yes, no) \
SC( 44, 15, 13, 4, no, no) \
\
SC( 45, 16, 14, 1, no, no) \
SC( 46, 16, 14, 2, no, no) \
SC( 47, 16, 14, 3, no, no) \
SC( 48, 16, 14, 4, no, no) \
\
SC( 49, 17, 15, 1, no, no) \
SC( 50, 17, 15, 2, no, no) \
SC( 51, 17, 15, 3, no, no) \
SC( 52, 17, 15, 4, no, no) \
\
SC( 53, 18, 16, 1, no, no) \
SC( 54, 18, 16, 2, no, no) \
SC( 55, 18, 16, 3, no, no) \
SC( 56, 18, 16, 4, no, no) \
\
SC( 57, 19, 17, 1, no, no) \
SC( 58, 19, 17, 2, no, no) \
SC( 59, 19, 17, 3, no, no) \
SC( 60, 19, 17, 4, no, no) \
\
SC( 61, 20, 18, 1, no, no) \
SC( 62, 20, 18, 2, no, no) \
SC( 63, 20, 18, 3, no, no) \
SC( 64, 20, 18, 4, no, no) \
\
SC( 65, 21, 19, 1, no, no) \
SC( 66, 21, 19, 2, no, no) \
SC( 67, 21, 19, 3, no, no) \
SC( 68, 21, 19, 4, no, no) \
\
SC( 69, 22, 20, 1, no, no) \
SC( 70, 22, 20, 2, no, no) \
SC( 71, 22, 20, 3, no, no) \
SC( 72, 22, 20, 4, no, no) \
\
SC( 73, 23, 21, 1, no, no) \
SC( 74, 23, 21, 2, no, no) \
SC( 75, 23, 21, 3, no, no) \
SC( 76, 23, 21, 4, no, no) \
\
SC( 77, 24, 22, 1, no, no) \
SC( 78, 24, 22, 2, no, no) \
SC( 79, 24, 22, 3, no, no) \
SC( 80, 24, 22, 4, no, no) \
\
SC( 81, 25, 23, 1, no, no) \
SC( 82, 25, 23, 2, no, no) \
SC( 83, 25, 23, 3, no, no) \
SC( 84, 25, 23, 4, no, no) \
\
SC( 85, 26, 24, 1, no, no) \
SC( 86, 26, 24, 2, no, no) \
SC( 87, 26, 24, 3, no, no) \
SC( 88, 26, 24, 4, no, no) \
\
SC( 89, 27, 25, 1, no, no) \
SC( 90, 27, 25, 2, no, no) \
SC( 91, 27, 25, 3, no, no) \
SC( 92, 27, 25, 4, no, no) \
\
SC( 93, 28, 26, 1, no, no) \
SC( 94, 28, 26, 2, no, no) \
SC( 95, 28, 26, 3, no, no) \
SC( 96, 28, 26, 4, no, no) \
\
SC( 97, 29, 27, 1, no, no) \
SC( 98, 29, 27, 2, no, no) \
SC( 99, 29, 27, 3, no, no) \
SC(100, 29, 27, 4, no, no) \
\
SC(101, 30, 28, 1, no, no) \
SC(102, 30, 28, 2, no, no) \
SC(103, 30, 28, 3, no, no) \
SC(104, 30, 28, 4, no, no) \
\
SC(105, 31, 29, 1, no, no) \
SC(106, 31, 29, 2, no, no) \
SC(107, 31, 29, 3, no, no) \
SC(108, 31, 29, 4, no, no) \
\
SC(109, 32, 30, 1, no, no) \
SC(110, 32, 30, 2, no, no) \
SC(111, 32, 30, 3, no, no) \
SC(112, 32, 30, 4, no, no) \
\
SC(113, 33, 31, 1, no, no) \
SC(114, 33, 31, 2, no, no) \
SC(115, 33, 31, 3, no, no) \
SC(116, 33, 31, 4, no, no) \
\
SC(117, 34, 32, 1, no, no) \
SC(118, 34, 32, 2, no, no) \
SC(119, 34, 32, 3, no, no) \
SC(120, 34, 32, 4, no, no) \
\
SC(121, 35, 33, 1, no, no) \
SC(122, 35, 33, 2, no, no) \
SC(123, 35, 33, 3, no, no) \
SC(124, 35, 33, 4, no, no) \
\
SC(125, 36, 34, 1, no, no) \
SC(126, 36, 34, 2, no, no) \
SC(127, 36, 34, 3, no, no) \
SC(128, 36, 34, 4, no, no) \
\
SC(129, 37, 35, 1, no, no) \
SC(130, 37, 35, 2, no, no) \
SC(131, 37, 35, 3, no, no) \
SC(132, 37, 35, 4, no, no) \
\
SC(133, 38, 36, 1, no, no) \
SC(134, 38, 36, 2, no, no) \
SC(135, 38, 36, 3, no, no) \
SC(136, 38, 36, 4, no, no) \
\
SC(137, 39, 37, 1, no, no) \
SC(138, 39, 37, 2, no, no) \
SC(139, 39, 37, 3, no, no) \
SC(140, 39, 37, 4, no, no) \
\
SC(141, 40, 38, 1, no, no) \
SC(142, 40, 38, 2, no, no) \
SC(143, 40, 38, 3, no, no) \
SC(144, 40, 38, 4, no, no) \
\
SC(145, 41, 39, 1, no, no) \
SC(146, 41, 39, 2, no, no) \
SC(147, 41, 39, 3, no, no) \
SC(148, 41, 39, 4, no, no) \
\
SC(149, 42, 40, 1, no, no) \
SC(150, 42, 40, 2, no, no) \
SC(151, 42, 40, 3, no, no) \
SC(152, 42, 40, 4, no, no) \
\
SC(153, 43, 41, 1, no, no) \
SC(154, 43, 41, 2, no, no) \
SC(155, 43, 41, 3, no, no) \
SC(156, 43, 41, 4, no, no) \
\
SC(157, 44, 42, 1, no, no) \
SC(158, 44, 42, 2, no, no) \
SC(159, 44, 42, 3, no, no) \
SC(160, 44, 42, 4, no, no) \
\
SC(161, 45, 43, 1, no, no) \
SC(162, 45, 43, 2, no, no) \
SC(163, 45, 43, 3, no, no) \
SC(164, 45, 43, 4, no, no) \
\
SC(165, 46, 44, 1, no, no) \
SC(166, 46, 44, 2, no, no) \
SC(167, 46, 44, 3, no, no) \
SC(168, 46, 44, 4, no, no) \
\
SC(169, 47, 45, 1, no, no) \
SC(170, 47, 45, 2, no, no) \
SC(171, 47, 45, 3, no, no) \
SC(172, 47, 45, 4, no, no) \
\
SC(173, 48, 46, 1, no, no) \
SC(174, 48, 46, 2, no, no) \
SC(175, 48, 46, 3, no, no) \
SC(176, 48, 46, 4, no, no) \
\
SC(177, 49, 47, 1, no, no) \
SC(178, 49, 47, 2, no, no) \
SC(179, 49, 47, 3, no, no) \
SC(180, 49, 47, 4, no, no) \
\
SC(181, 50, 48, 1, no, no) \
SC(182, 50, 48, 2, no, no) \
SC(183, 50, 48, 3, no, no) \
SC(184, 50, 48, 4, no, no) \
\
SC(185, 51, 49, 1, no, no) \
SC(186, 51, 49, 2, no, no) \
SC(187, 51, 49, 3, no, no) \
SC(188, 51, 49, 4, no, no) \
\
SC(189, 52, 50, 1, no, no) \
SC(190, 52, 50, 2, no, no) \
SC(191, 52, 50, 3, no, no) \
SC(192, 52, 50, 4, no, no) \
\
SC(193, 53, 51, 1, no, no) \
SC(194, 53, 51, 2, no, no) \
SC(195, 53, 51, 3, no, no) \
SC(196, 53, 51, 4, no, no) \
\
SC(197, 54, 52, 1, no, no) \
SC(198, 54, 52, 2, no, no) \
SC(199, 54, 52, 3, no, no) \
SC(200, 54, 52, 4, no, no) \
\
SC(201, 55, 53, 1, no, no) \
SC(202, 55, 53, 2, no, no) \
SC(203, 55, 53, 3, no, no) \
SC(204, 55, 53, 4, no, no) \
\
SC(205, 56, 54, 1, no, no) \
SC(206, 56, 54, 2, no, no) \
SC(207, 56, 54, 3, no, no) \
SC(208, 56, 54, 4, no, no) \
\
SC(209, 57, 55, 1, no, no) \
SC(210, 57, 55, 2, no, no) \
SC(211, 57, 55, 3, no, no) \
SC(212, 57, 55, 4, no, no) \
\
SC(213, 58, 56, 1, no, no) \
SC(214, 58, 56, 2, no, no) \
SC(215, 58, 56, 3, no, no) \
SC(216, 58, 56, 4, no, no) \
\
SC(217, 59, 57, 1, no, no) \
SC(218, 59, 57, 2, no, no) \
SC(219, 59, 57, 3, no, no) \
SC(220, 59, 57, 4, no, no) \
\
SC(221, 60, 58, 1, no, no) \
SC(222, 60, 58, 2, no, no) \
SC(223, 60, 58, 3, no, no) \
SC(224, 60, 58, 4, no, no) \
\
SC(225, 61, 59, 1, no, no) \
SC(226, 61, 59, 2, no, no) \
SC(227, 61, 59, 3, no, no) \
SC(228, 61, 59, 4, no, no) \
\
SC(229, 62, 60, 1, no, no) \
SC(230, 62, 60, 2, no, no) \
SC(231, 62, 60, 3, no, no) \
SC(232, 62, 60, 4, no, no) \
\
SC(233, 63, 61, 1, no, no) \
SC(234, 63, 61, 2, no, no) \
SC(235, 63, 61, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 1
#define NLBINS 29
#define NBINS 44
#define LG_TINY_MAXCLASS 3
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 15) + (((size_t)3) << 13))
#endif
#if (LG_SIZEOF_PTR == 3 && LG_TINY_MIN == 4 && LG_QUANTUM == 4 && LG_PAGE == 12)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 4, 4, 0, yes, 4) \
SC( 1, 4, 4, 1, yes, 4) \
SC( 2, 4, 4, 2, yes, 4) \
SC( 3, 4, 4, 3, yes, 4) \
\
SC( 4, 6, 4, 1, yes, 4) \
SC( 5, 6, 4, 2, yes, 4) \
SC( 6, 6, 4, 3, yes, 4) \
SC( 7, 6, 4, 4, yes, 4) \
\
SC( 8, 7, 5, 1, yes, 5) \
SC( 9, 7, 5, 2, yes, 5) \
SC( 10, 7, 5, 3, yes, 5) \
SC( 11, 7, 5, 4, yes, 5) \
\
SC( 12, 8, 6, 1, yes, 6) \
SC( 13, 8, 6, 2, yes, 6) \
SC( 14, 8, 6, 3, yes, 6) \
SC( 15, 8, 6, 4, yes, 6) \
\
SC( 16, 9, 7, 1, yes, 7) \
SC( 17, 9, 7, 2, yes, 7) \
SC( 18, 9, 7, 3, yes, 7) \
SC( 19, 9, 7, 4, yes, 7) \
\
SC( 20, 10, 8, 1, yes, 8) \
SC( 21, 10, 8, 2, yes, 8) \
SC( 22, 10, 8, 3, yes, 8) \
SC( 23, 10, 8, 4, yes, 8) \
\
SC( 24, 11, 9, 1, yes, 9) \
SC( 25, 11, 9, 2, yes, 9) \
SC( 26, 11, 9, 3, yes, 9) \
SC( 27, 11, 9, 4, no, 9) \
\
SC( 28, 12, 10, 1, no, no) \
SC( 29, 12, 10, 2, no, no) \
SC( 30, 12, 10, 3, no, no) \
SC( 31, 12, 10, 4, no, no) \
\
SC( 32, 13, 11, 1, no, no) \
SC( 33, 13, 11, 2, no, no) \
SC( 34, 13, 11, 3, no, no) \
SC( 35, 13, 11, 4, no, no) \
\
SC( 36, 14, 12, 1, no, no) \
SC( 37, 14, 12, 2, no, no) \
SC( 38, 14, 12, 3, no, no) \
SC( 39, 14, 12, 4, no, no) \
\
SC( 40, 15, 13, 1, no, no) \
SC( 41, 15, 13, 2, no, no) \
SC( 42, 15, 13, 3, no, no) \
SC( 43, 15, 13, 4, no, no) \
\
SC( 44, 16, 14, 1, no, no) \
SC( 45, 16, 14, 2, no, no) \
SC( 46, 16, 14, 3, no, no) \
SC( 47, 16, 14, 4, no, no) \
\
SC( 48, 17, 15, 1, no, no) \
SC( 49, 17, 15, 2, no, no) \
SC( 50, 17, 15, 3, no, no) \
SC( 51, 17, 15, 4, no, no) \
\
SC( 52, 18, 16, 1, no, no) \
SC( 53, 18, 16, 2, no, no) \
SC( 54, 18, 16, 3, no, no) \
SC( 55, 18, 16, 4, no, no) \
\
SC( 56, 19, 17, 1, no, no) \
SC( 57, 19, 17, 2, no, no) \
SC( 58, 19, 17, 3, no, no) \
SC( 59, 19, 17, 4, no, no) \
\
SC( 60, 20, 18, 1, no, no) \
SC( 61, 20, 18, 2, no, no) \
SC( 62, 20, 18, 3, no, no) \
SC( 63, 20, 18, 4, no, no) \
\
SC( 64, 21, 19, 1, no, no) \
SC( 65, 21, 19, 2, no, no) \
SC( 66, 21, 19, 3, no, no) \
SC( 67, 21, 19, 4, no, no) \
\
SC( 68, 22, 20, 1, no, no) \
SC( 69, 22, 20, 2, no, no) \
SC( 70, 22, 20, 3, no, no) \
SC( 71, 22, 20, 4, no, no) \
\
SC( 72, 23, 21, 1, no, no) \
SC( 73, 23, 21, 2, no, no) \
SC( 74, 23, 21, 3, no, no) \
SC( 75, 23, 21, 4, no, no) \
\
SC( 76, 24, 22, 1, no, no) \
SC( 77, 24, 22, 2, no, no) \
SC( 78, 24, 22, 3, no, no) \
SC( 79, 24, 22, 4, no, no) \
\
SC( 80, 25, 23, 1, no, no) \
SC( 81, 25, 23, 2, no, no) \
SC( 82, 25, 23, 3, no, no) \
SC( 83, 25, 23, 4, no, no) \
\
SC( 84, 26, 24, 1, no, no) \
SC( 85, 26, 24, 2, no, no) \
SC( 86, 26, 24, 3, no, no) \
SC( 87, 26, 24, 4, no, no) \
\
SC( 88, 27, 25, 1, no, no) \
SC( 89, 27, 25, 2, no, no) \
SC( 90, 27, 25, 3, no, no) \
SC( 91, 27, 25, 4, no, no) \
\
SC( 92, 28, 26, 1, no, no) \
SC( 93, 28, 26, 2, no, no) \
SC( 94, 28, 26, 3, no, no) \
SC( 95, 28, 26, 4, no, no) \
\
SC( 96, 29, 27, 1, no, no) \
SC( 97, 29, 27, 2, no, no) \
SC( 98, 29, 27, 3, no, no) \
SC( 99, 29, 27, 4, no, no) \
\
SC(100, 30, 28, 1, no, no) \
SC(101, 30, 28, 2, no, no) \
SC(102, 30, 28, 3, no, no) \
SC(103, 30, 28, 4, no, no) \
\
SC(104, 31, 29, 1, no, no) \
SC(105, 31, 29, 2, no, no) \
SC(106, 31, 29, 3, no, no) \
SC(107, 31, 29, 4, no, no) \
\
SC(108, 32, 30, 1, no, no) \
SC(109, 32, 30, 2, no, no) \
SC(110, 32, 30, 3, no, no) \
SC(111, 32, 30, 4, no, no) \
\
SC(112, 33, 31, 1, no, no) \
SC(113, 33, 31, 2, no, no) \
SC(114, 33, 31, 3, no, no) \
SC(115, 33, 31, 4, no, no) \
\
SC(116, 34, 32, 1, no, no) \
SC(117, 34, 32, 2, no, no) \
SC(118, 34, 32, 3, no, no) \
SC(119, 34, 32, 4, no, no) \
\
SC(120, 35, 33, 1, no, no) \
SC(121, 35, 33, 2, no, no) \
SC(122, 35, 33, 3, no, no) \
SC(123, 35, 33, 4, no, no) \
\
SC(124, 36, 34, 1, no, no) \
SC(125, 36, 34, 2, no, no) \
SC(126, 36, 34, 3, no, no) \
SC(127, 36, 34, 4, no, no) \
\
SC(128, 37, 35, 1, no, no) \
SC(129, 37, 35, 2, no, no) \
SC(130, 37, 35, 3, no, no) \
SC(131, 37, 35, 4, no, no) \
\
SC(132, 38, 36, 1, no, no) \
SC(133, 38, 36, 2, no, no) \
SC(134, 38, 36, 3, no, no) \
SC(135, 38, 36, 4, no, no) \
\
SC(136, 39, 37, 1, no, no) \
SC(137, 39, 37, 2, no, no) \
SC(138, 39, 37, 3, no, no) \
SC(139, 39, 37, 4, no, no) \
\
SC(140, 40, 38, 1, no, no) \
SC(141, 40, 38, 2, no, no) \
SC(142, 40, 38, 3, no, no) \
SC(143, 40, 38, 4, no, no) \
\
SC(144, 41, 39, 1, no, no) \
SC(145, 41, 39, 2, no, no) \
SC(146, 41, 39, 3, no, no) \
SC(147, 41, 39, 4, no, no) \
\
SC(148, 42, 40, 1, no, no) \
SC(149, 42, 40, 2, no, no) \
SC(150, 42, 40, 3, no, no) \
SC(151, 42, 40, 4, no, no) \
\
SC(152, 43, 41, 1, no, no) \
SC(153, 43, 41, 2, no, no) \
SC(154, 43, 41, 3, no, no) \
SC(155, 43, 41, 4, no, no) \
\
SC(156, 44, 42, 1, no, no) \
SC(157, 44, 42, 2, no, no) \
SC(158, 44, 42, 3, no, no) \
SC(159, 44, 42, 4, no, no) \
\
SC(160, 45, 43, 1, no, no) \
SC(161, 45, 43, 2, no, no) \
SC(162, 45, 43, 3, no, no) \
SC(163, 45, 43, 4, no, no) \
\
SC(164, 46, 44, 1, no, no) \
SC(165, 46, 44, 2, no, no) \
SC(166, 46, 44, 3, no, no) \
SC(167, 46, 44, 4, no, no) \
\
SC(168, 47, 45, 1, no, no) \
SC(169, 47, 45, 2, no, no) \
SC(170, 47, 45, 3, no, no) \
SC(171, 47, 45, 4, no, no) \
\
SC(172, 48, 46, 1, no, no) \
SC(173, 48, 46, 2, no, no) \
SC(174, 48, 46, 3, no, no) \
SC(175, 48, 46, 4, no, no) \
\
SC(176, 49, 47, 1, no, no) \
SC(177, 49, 47, 2, no, no) \
SC(178, 49, 47, 3, no, no) \
SC(179, 49, 47, 4, no, no) \
\
SC(180, 50, 48, 1, no, no) \
SC(181, 50, 48, 2, no, no) \
SC(182, 50, 48, 3, no, no) \
SC(183, 50, 48, 4, no, no) \
\
SC(184, 51, 49, 1, no, no) \
SC(185, 51, 49, 2, no, no) \
SC(186, 51, 49, 3, no, no) \
SC(187, 51, 49, 4, no, no) \
\
SC(188, 52, 50, 1, no, no) \
SC(189, 52, 50, 2, no, no) \
SC(190, 52, 50, 3, no, no) \
SC(191, 52, 50, 4, no, no) \
\
SC(192, 53, 51, 1, no, no) \
SC(193, 53, 51, 2, no, no) \
SC(194, 53, 51, 3, no, no) \
SC(195, 53, 51, 4, no, no) \
\
SC(196, 54, 52, 1, no, no) \
SC(197, 54, 52, 2, no, no) \
SC(198, 54, 52, 3, no, no) \
SC(199, 54, 52, 4, no, no) \
\
SC(200, 55, 53, 1, no, no) \
SC(201, 55, 53, 2, no, no) \
SC(202, 55, 53, 3, no, no) \
SC(203, 55, 53, 4, no, no) \
\
SC(204, 56, 54, 1, no, no) \
SC(205, 56, 54, 2, no, no) \
SC(206, 56, 54, 3, no, no) \
SC(207, 56, 54, 4, no, no) \
\
SC(208, 57, 55, 1, no, no) \
SC(209, 57, 55, 2, no, no) \
SC(210, 57, 55, 3, no, no) \
SC(211, 57, 55, 4, no, no) \
\
SC(212, 58, 56, 1, no, no) \
SC(213, 58, 56, 2, no, no) \
SC(214, 58, 56, 3, no, no) \
SC(215, 58, 56, 4, no, no) \
\
SC(216, 59, 57, 1, no, no) \
SC(217, 59, 57, 2, no, no) \
SC(218, 59, 57, 3, no, no) \
SC(219, 59, 57, 4, no, no) \
\
SC(220, 60, 58, 1, no, no) \
SC(221, 60, 58, 2, no, no) \
SC(222, 60, 58, 3, no, no) \
SC(223, 60, 58, 4, no, no) \
\
SC(224, 61, 59, 1, no, no) \
SC(225, 61, 59, 2, no, no) \
SC(226, 61, 59, 3, no, no) \
SC(227, 61, 59, 4, no, no) \
\
SC(228, 62, 60, 1, no, no) \
SC(229, 62, 60, 2, no, no) \
SC(230, 62, 60, 3, no, no) \
SC(231, 62, 60, 4, no, no) \
\
SC(232, 63, 61, 1, no, no) \
SC(233, 63, 61, 2, no, no) \
SC(234, 63, 61, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 0
#define NLBINS 28
#define NBINS 27
#define LG_TINY_MAXCLASS "NA"
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 11) + (((size_t)3) << 9))
#endif
#if (LG_SIZEOF_PTR == 3 && LG_TINY_MIN == 4 && LG_QUANTUM == 4 && LG_PAGE == 13)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 4, 4, 0, yes, 4) \
SC( 1, 4, 4, 1, yes, 4) \
SC( 2, 4, 4, 2, yes, 4) \
SC( 3, 4, 4, 3, yes, 4) \
\
SC( 4, 6, 4, 1, yes, 4) \
SC( 5, 6, 4, 2, yes, 4) \
SC( 6, 6, 4, 3, yes, 4) \
SC( 7, 6, 4, 4, yes, 4) \
\
SC( 8, 7, 5, 1, yes, 5) \
SC( 9, 7, 5, 2, yes, 5) \
SC( 10, 7, 5, 3, yes, 5) \
SC( 11, 7, 5, 4, yes, 5) \
\
SC( 12, 8, 6, 1, yes, 6) \
SC( 13, 8, 6, 2, yes, 6) \
SC( 14, 8, 6, 3, yes, 6) \
SC( 15, 8, 6, 4, yes, 6) \
\
SC( 16, 9, 7, 1, yes, 7) \
SC( 17, 9, 7, 2, yes, 7) \
SC( 18, 9, 7, 3, yes, 7) \
SC( 19, 9, 7, 4, yes, 7) \
\
SC( 20, 10, 8, 1, yes, 8) \
SC( 21, 10, 8, 2, yes, 8) \
SC( 22, 10, 8, 3, yes, 8) \
SC( 23, 10, 8, 4, yes, 8) \
\
SC( 24, 11, 9, 1, yes, 9) \
SC( 25, 11, 9, 2, yes, 9) \
SC( 26, 11, 9, 3, yes, 9) \
SC( 27, 11, 9, 4, yes, 9) \
\
SC( 28, 12, 10, 1, yes, no) \
SC( 29, 12, 10, 2, yes, no) \
SC( 30, 12, 10, 3, yes, no) \
SC( 31, 12, 10, 4, no, no) \
\
SC( 32, 13, 11, 1, no, no) \
SC( 33, 13, 11, 2, no, no) \
SC( 34, 13, 11, 3, no, no) \
SC( 35, 13, 11, 4, no, no) \
\
SC( 36, 14, 12, 1, no, no) \
SC( 37, 14, 12, 2, no, no) \
SC( 38, 14, 12, 3, no, no) \
SC( 39, 14, 12, 4, no, no) \
\
SC( 40, 15, 13, 1, no, no) \
SC( 41, 15, 13, 2, no, no) \
SC( 42, 15, 13, 3, no, no) \
SC( 43, 15, 13, 4, no, no) \
\
SC( 44, 16, 14, 1, no, no) \
SC( 45, 16, 14, 2, no, no) \
SC( 46, 16, 14, 3, no, no) \
SC( 47, 16, 14, 4, no, no) \
\
SC( 48, 17, 15, 1, no, no) \
SC( 49, 17, 15, 2, no, no) \
SC( 50, 17, 15, 3, no, no) \
SC( 51, 17, 15, 4, no, no) \
\
SC( 52, 18, 16, 1, no, no) \
SC( 53, 18, 16, 2, no, no) \
SC( 54, 18, 16, 3, no, no) \
SC( 55, 18, 16, 4, no, no) \
\
SC( 56, 19, 17, 1, no, no) \
SC( 57, 19, 17, 2, no, no) \
SC( 58, 19, 17, 3, no, no) \
SC( 59, 19, 17, 4, no, no) \
\
SC( 60, 20, 18, 1, no, no) \
SC( 61, 20, 18, 2, no, no) \
SC( 62, 20, 18, 3, no, no) \
SC( 63, 20, 18, 4, no, no) \
\
SC( 64, 21, 19, 1, no, no) \
SC( 65, 21, 19, 2, no, no) \
SC( 66, 21, 19, 3, no, no) \
SC( 67, 21, 19, 4, no, no) \
\
SC( 68, 22, 20, 1, no, no) \
SC( 69, 22, 20, 2, no, no) \
SC( 70, 22, 20, 3, no, no) \
SC( 71, 22, 20, 4, no, no) \
\
SC( 72, 23, 21, 1, no, no) \
SC( 73, 23, 21, 2, no, no) \
SC( 74, 23, 21, 3, no, no) \
SC( 75, 23, 21, 4, no, no) \
\
SC( 76, 24, 22, 1, no, no) \
SC( 77, 24, 22, 2, no, no) \
SC( 78, 24, 22, 3, no, no) \
SC( 79, 24, 22, 4, no, no) \
\
SC( 80, 25, 23, 1, no, no) \
SC( 81, 25, 23, 2, no, no) \
SC( 82, 25, 23, 3, no, no) \
SC( 83, 25, 23, 4, no, no) \
\
SC( 84, 26, 24, 1, no, no) \
SC( 85, 26, 24, 2, no, no) \
SC( 86, 26, 24, 3, no, no) \
SC( 87, 26, 24, 4, no, no) \
\
SC( 88, 27, 25, 1, no, no) \
SC( 89, 27, 25, 2, no, no) \
SC( 90, 27, 25, 3, no, no) \
SC( 91, 27, 25, 4, no, no) \
\
SC( 92, 28, 26, 1, no, no) \
SC( 93, 28, 26, 2, no, no) \
SC( 94, 28, 26, 3, no, no) \
SC( 95, 28, 26, 4, no, no) \
\
SC( 96, 29, 27, 1, no, no) \
SC( 97, 29, 27, 2, no, no) \
SC( 98, 29, 27, 3, no, no) \
SC( 99, 29, 27, 4, no, no) \
\
SC(100, 30, 28, 1, no, no) \
SC(101, 30, 28, 2, no, no) \
SC(102, 30, 28, 3, no, no) \
SC(103, 30, 28, 4, no, no) \
\
SC(104, 31, 29, 1, no, no) \
SC(105, 31, 29, 2, no, no) \
SC(106, 31, 29, 3, no, no) \
SC(107, 31, 29, 4, no, no) \
\
SC(108, 32, 30, 1, no, no) \
SC(109, 32, 30, 2, no, no) \
SC(110, 32, 30, 3, no, no) \
SC(111, 32, 30, 4, no, no) \
\
SC(112, 33, 31, 1, no, no) \
SC(113, 33, 31, 2, no, no) \
SC(114, 33, 31, 3, no, no) \
SC(115, 33, 31, 4, no, no) \
\
SC(116, 34, 32, 1, no, no) \
SC(117, 34, 32, 2, no, no) \
SC(118, 34, 32, 3, no, no) \
SC(119, 34, 32, 4, no, no) \
\
SC(120, 35, 33, 1, no, no) \
SC(121, 35, 33, 2, no, no) \
SC(122, 35, 33, 3, no, no) \
SC(123, 35, 33, 4, no, no) \
\
SC(124, 36, 34, 1, no, no) \
SC(125, 36, 34, 2, no, no) \
SC(126, 36, 34, 3, no, no) \
SC(127, 36, 34, 4, no, no) \
\
SC(128, 37, 35, 1, no, no) \
SC(129, 37, 35, 2, no, no) \
SC(130, 37, 35, 3, no, no) \
SC(131, 37, 35, 4, no, no) \
\
SC(132, 38, 36, 1, no, no) \
SC(133, 38, 36, 2, no, no) \
SC(134, 38, 36, 3, no, no) \
SC(135, 38, 36, 4, no, no) \
\
SC(136, 39, 37, 1, no, no) \
SC(137, 39, 37, 2, no, no) \
SC(138, 39, 37, 3, no, no) \
SC(139, 39, 37, 4, no, no) \
\
SC(140, 40, 38, 1, no, no) \
SC(141, 40, 38, 2, no, no) \
SC(142, 40, 38, 3, no, no) \
SC(143, 40, 38, 4, no, no) \
\
SC(144, 41, 39, 1, no, no) \
SC(145, 41, 39, 2, no, no) \
SC(146, 41, 39, 3, no, no) \
SC(147, 41, 39, 4, no, no) \
\
SC(148, 42, 40, 1, no, no) \
SC(149, 42, 40, 2, no, no) \
SC(150, 42, 40, 3, no, no) \
SC(151, 42, 40, 4, no, no) \
\
SC(152, 43, 41, 1, no, no) \
SC(153, 43, 41, 2, no, no) \
SC(154, 43, 41, 3, no, no) \
SC(155, 43, 41, 4, no, no) \
\
SC(156, 44, 42, 1, no, no) \
SC(157, 44, 42, 2, no, no) \
SC(158, 44, 42, 3, no, no) \
SC(159, 44, 42, 4, no, no) \
\
SC(160, 45, 43, 1, no, no) \
SC(161, 45, 43, 2, no, no) \
SC(162, 45, 43, 3, no, no) \
SC(163, 45, 43, 4, no, no) \
\
SC(164, 46, 44, 1, no, no) \
SC(165, 46, 44, 2, no, no) \
SC(166, 46, 44, 3, no, no) \
SC(167, 46, 44, 4, no, no) \
\
SC(168, 47, 45, 1, no, no) \
SC(169, 47, 45, 2, no, no) \
SC(170, 47, 45, 3, no, no) \
SC(171, 47, 45, 4, no, no) \
\
SC(172, 48, 46, 1, no, no) \
SC(173, 48, 46, 2, no, no) \
SC(174, 48, 46, 3, no, no) \
SC(175, 48, 46, 4, no, no) \
\
SC(176, 49, 47, 1, no, no) \
SC(177, 49, 47, 2, no, no) \
SC(178, 49, 47, 3, no, no) \
SC(179, 49, 47, 4, no, no) \
\
SC(180, 50, 48, 1, no, no) \
SC(181, 50, 48, 2, no, no) \
SC(182, 50, 48, 3, no, no) \
SC(183, 50, 48, 4, no, no) \
\
SC(184, 51, 49, 1, no, no) \
SC(185, 51, 49, 2, no, no) \
SC(186, 51, 49, 3, no, no) \
SC(187, 51, 49, 4, no, no) \
\
SC(188, 52, 50, 1, no, no) \
SC(189, 52, 50, 2, no, no) \
SC(190, 52, 50, 3, no, no) \
SC(191, 52, 50, 4, no, no) \
\
SC(192, 53, 51, 1, no, no) \
SC(193, 53, 51, 2, no, no) \
SC(194, 53, 51, 3, no, no) \
SC(195, 53, 51, 4, no, no) \
\
SC(196, 54, 52, 1, no, no) \
SC(197, 54, 52, 2, no, no) \
SC(198, 54, 52, 3, no, no) \
SC(199, 54, 52, 4, no, no) \
\
SC(200, 55, 53, 1, no, no) \
SC(201, 55, 53, 2, no, no) \
SC(202, 55, 53, 3, no, no) \
SC(203, 55, 53, 4, no, no) \
\
SC(204, 56, 54, 1, no, no) \
SC(205, 56, 54, 2, no, no) \
SC(206, 56, 54, 3, no, no) \
SC(207, 56, 54, 4, no, no) \
\
SC(208, 57, 55, 1, no, no) \
SC(209, 57, 55, 2, no, no) \
SC(210, 57, 55, 3, no, no) \
SC(211, 57, 55, 4, no, no) \
\
SC(212, 58, 56, 1, no, no) \
SC(213, 58, 56, 2, no, no) \
SC(214, 58, 56, 3, no, no) \
SC(215, 58, 56, 4, no, no) \
\
SC(216, 59, 57, 1, no, no) \
SC(217, 59, 57, 2, no, no) \
SC(218, 59, 57, 3, no, no) \
SC(219, 59, 57, 4, no, no) \
\
SC(220, 60, 58, 1, no, no) \
SC(221, 60, 58, 2, no, no) \
SC(222, 60, 58, 3, no, no) \
SC(223, 60, 58, 4, no, no) \
\
SC(224, 61, 59, 1, no, no) \
SC(225, 61, 59, 2, no, no) \
SC(226, 61, 59, 3, no, no) \
SC(227, 61, 59, 4, no, no) \
\
SC(228, 62, 60, 1, no, no) \
SC(229, 62, 60, 2, no, no) \
SC(230, 62, 60, 3, no, no) \
SC(231, 62, 60, 4, no, no) \
\
SC(232, 63, 61, 1, no, no) \
SC(233, 63, 61, 2, no, no) \
SC(234, 63, 61, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 0
#define NLBINS 28
#define NBINS 31
#define LG_TINY_MAXCLASS "NA"
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 12) + (((size_t)3) << 10))
#endif
#if (LG_SIZEOF_PTR == 3 && LG_TINY_MIN == 4 && LG_QUANTUM == 4 && LG_PAGE == 16)
#define SIZE_CLASSES \
/* index, lg_grp, lg_delta, ndelta, bin, lg_delta_lookup */ \
SC( 0, 4, 4, 0, yes, 4) \
SC( 1, 4, 4, 1, yes, 4) \
SC( 2, 4, 4, 2, yes, 4) \
SC( 3, 4, 4, 3, yes, 4) \
\
SC( 4, 6, 4, 1, yes, 4) \
SC( 5, 6, 4, 2, yes, 4) \
SC( 6, 6, 4, 3, yes, 4) \
SC( 7, 6, 4, 4, yes, 4) \
\
SC( 8, 7, 5, 1, yes, 5) \
SC( 9, 7, 5, 2, yes, 5) \
SC( 10, 7, 5, 3, yes, 5) \
SC( 11, 7, 5, 4, yes, 5) \
\
SC( 12, 8, 6, 1, yes, 6) \
SC( 13, 8, 6, 2, yes, 6) \
SC( 14, 8, 6, 3, yes, 6) \
SC( 15, 8, 6, 4, yes, 6) \
\
SC( 16, 9, 7, 1, yes, 7) \
SC( 17, 9, 7, 2, yes, 7) \
SC( 18, 9, 7, 3, yes, 7) \
SC( 19, 9, 7, 4, yes, 7) \
\
SC( 20, 10, 8, 1, yes, 8) \
SC( 21, 10, 8, 2, yes, 8) \
SC( 22, 10, 8, 3, yes, 8) \
SC( 23, 10, 8, 4, yes, 8) \
\
SC( 24, 11, 9, 1, yes, 9) \
SC( 25, 11, 9, 2, yes, 9) \
SC( 26, 11, 9, 3, yes, 9) \
SC( 27, 11, 9, 4, yes, 9) \
\
SC( 28, 12, 10, 1, yes, no) \
SC( 29, 12, 10, 2, yes, no) \
SC( 30, 12, 10, 3, yes, no) \
SC( 31, 12, 10, 4, yes, no) \
\
SC( 32, 13, 11, 1, yes, no) \
SC( 33, 13, 11, 2, yes, no) \
SC( 34, 13, 11, 3, yes, no) \
SC( 35, 13, 11, 4, yes, no) \
\
SC( 36, 14, 12, 1, yes, no) \
SC( 37, 14, 12, 2, yes, no) \
SC( 38, 14, 12, 3, yes, no) \
SC( 39, 14, 12, 4, yes, no) \
\
SC( 40, 15, 13, 1, yes, no) \
SC( 41, 15, 13, 2, yes, no) \
SC( 42, 15, 13, 3, yes, no) \
SC( 43, 15, 13, 4, no, no) \
\
SC( 44, 16, 14, 1, no, no) \
SC( 45, 16, 14, 2, no, no) \
SC( 46, 16, 14, 3, no, no) \
SC( 47, 16, 14, 4, no, no) \
\
SC( 48, 17, 15, 1, no, no) \
SC( 49, 17, 15, 2, no, no) \
SC( 50, 17, 15, 3, no, no) \
SC( 51, 17, 15, 4, no, no) \
\
SC( 52, 18, 16, 1, no, no) \
SC( 53, 18, 16, 2, no, no) \
SC( 54, 18, 16, 3, no, no) \
SC( 55, 18, 16, 4, no, no) \
\
SC( 56, 19, 17, 1, no, no) \
SC( 57, 19, 17, 2, no, no) \
SC( 58, 19, 17, 3, no, no) \
SC( 59, 19, 17, 4, no, no) \
\
SC( 60, 20, 18, 1, no, no) \
SC( 61, 20, 18, 2, no, no) \
SC( 62, 20, 18, 3, no, no) \
SC( 63, 20, 18, 4, no, no) \
\
SC( 64, 21, 19, 1, no, no) \
SC( 65, 21, 19, 2, no, no) \
SC( 66, 21, 19, 3, no, no) \
SC( 67, 21, 19, 4, no, no) \
\
SC( 68, 22, 20, 1, no, no) \
SC( 69, 22, 20, 2, no, no) \
SC( 70, 22, 20, 3, no, no) \
SC( 71, 22, 20, 4, no, no) \
\
SC( 72, 23, 21, 1, no, no) \
SC( 73, 23, 21, 2, no, no) \
SC( 74, 23, 21, 3, no, no) \
SC( 75, 23, 21, 4, no, no) \
\
SC( 76, 24, 22, 1, no, no) \
SC( 77, 24, 22, 2, no, no) \
SC( 78, 24, 22, 3, no, no) \
SC( 79, 24, 22, 4, no, no) \
\
SC( 80, 25, 23, 1, no, no) \
SC( 81, 25, 23, 2, no, no) \
SC( 82, 25, 23, 3, no, no) \
SC( 83, 25, 23, 4, no, no) \
\
SC( 84, 26, 24, 1, no, no) \
SC( 85, 26, 24, 2, no, no) \
SC( 86, 26, 24, 3, no, no) \
SC( 87, 26, 24, 4, no, no) \
\
SC( 88, 27, 25, 1, no, no) \
SC( 89, 27, 25, 2, no, no) \
SC( 90, 27, 25, 3, no, no) \
SC( 91, 27, 25, 4, no, no) \
\
SC( 92, 28, 26, 1, no, no) \
SC( 93, 28, 26, 2, no, no) \
SC( 94, 28, 26, 3, no, no) \
SC( 95, 28, 26, 4, no, no) \
\
SC( 96, 29, 27, 1, no, no) \
SC( 97, 29, 27, 2, no, no) \
SC( 98, 29, 27, 3, no, no) \
SC( 99, 29, 27, 4, no, no) \
\
SC(100, 30, 28, 1, no, no) \
SC(101, 30, 28, 2, no, no) \
SC(102, 30, 28, 3, no, no) \
SC(103, 30, 28, 4, no, no) \
\
SC(104, 31, 29, 1, no, no) \
SC(105, 31, 29, 2, no, no) \
SC(106, 31, 29, 3, no, no) \
SC(107, 31, 29, 4, no, no) \
\
SC(108, 32, 30, 1, no, no) \
SC(109, 32, 30, 2, no, no) \
SC(110, 32, 30, 3, no, no) \
SC(111, 32, 30, 4, no, no) \
\
SC(112, 33, 31, 1, no, no) \
SC(113, 33, 31, 2, no, no) \
SC(114, 33, 31, 3, no, no) \
SC(115, 33, 31, 4, no, no) \
\
SC(116, 34, 32, 1, no, no) \
SC(117, 34, 32, 2, no, no) \
SC(118, 34, 32, 3, no, no) \
SC(119, 34, 32, 4, no, no) \
\
SC(120, 35, 33, 1, no, no) \
SC(121, 35, 33, 2, no, no) \
SC(122, 35, 33, 3, no, no) \
SC(123, 35, 33, 4, no, no) \
\
SC(124, 36, 34, 1, no, no) \
SC(125, 36, 34, 2, no, no) \
SC(126, 36, 34, 3, no, no) \
SC(127, 36, 34, 4, no, no) \
\
SC(128, 37, 35, 1, no, no) \
SC(129, 37, 35, 2, no, no) \
SC(130, 37, 35, 3, no, no) \
SC(131, 37, 35, 4, no, no) \
\
SC(132, 38, 36, 1, no, no) \
SC(133, 38, 36, 2, no, no) \
SC(134, 38, 36, 3, no, no) \
SC(135, 38, 36, 4, no, no) \
\
SC(136, 39, 37, 1, no, no) \
SC(137, 39, 37, 2, no, no) \
SC(138, 39, 37, 3, no, no) \
SC(139, 39, 37, 4, no, no) \
\
SC(140, 40, 38, 1, no, no) \
SC(141, 40, 38, 2, no, no) \
SC(142, 40, 38, 3, no, no) \
SC(143, 40, 38, 4, no, no) \
\
SC(144, 41, 39, 1, no, no) \
SC(145, 41, 39, 2, no, no) \
SC(146, 41, 39, 3, no, no) \
SC(147, 41, 39, 4, no, no) \
\
SC(148, 42, 40, 1, no, no) \
SC(149, 42, 40, 2, no, no) \
SC(150, 42, 40, 3, no, no) \
SC(151, 42, 40, 4, no, no) \
\
SC(152, 43, 41, 1, no, no) \
SC(153, 43, 41, 2, no, no) \
SC(154, 43, 41, 3, no, no) \
SC(155, 43, 41, 4, no, no) \
\
SC(156, 44, 42, 1, no, no) \
SC(157, 44, 42, 2, no, no) \
SC(158, 44, 42, 3, no, no) \
SC(159, 44, 42, 4, no, no) \
\
SC(160, 45, 43, 1, no, no) \
SC(161, 45, 43, 2, no, no) \
SC(162, 45, 43, 3, no, no) \
SC(163, 45, 43, 4, no, no) \
\
SC(164, 46, 44, 1, no, no) \
SC(165, 46, 44, 2, no, no) \
SC(166, 46, 44, 3, no, no) \
SC(167, 46, 44, 4, no, no) \
\
SC(168, 47, 45, 1, no, no) \
SC(169, 47, 45, 2, no, no) \
SC(170, 47, 45, 3, no, no) \
SC(171, 47, 45, 4, no, no) \
\
SC(172, 48, 46, 1, no, no) \
SC(173, 48, 46, 2, no, no) \
SC(174, 48, 46, 3, no, no) \
SC(175, 48, 46, 4, no, no) \
\
SC(176, 49, 47, 1, no, no) \
SC(177, 49, 47, 2, no, no) \
SC(178, 49, 47, 3, no, no) \
SC(179, 49, 47, 4, no, no) \
\
SC(180, 50, 48, 1, no, no) \
SC(181, 50, 48, 2, no, no) \
SC(182, 50, 48, 3, no, no) \
SC(183, 50, 48, 4, no, no) \
\
SC(184, 51, 49, 1, no, no) \
SC(185, 51, 49, 2, no, no) \
SC(186, 51, 49, 3, no, no) \
SC(187, 51, 49, 4, no, no) \
\
SC(188, 52, 50, 1, no, no) \
SC(189, 52, 50, 2, no, no) \
SC(190, 52, 50, 3, no, no) \
SC(191, 52, 50, 4, no, no) \
\
SC(192, 53, 51, 1, no, no) \
SC(193, 53, 51, 2, no, no) \
SC(194, 53, 51, 3, no, no) \
SC(195, 53, 51, 4, no, no) \
\
SC(196, 54, 52, 1, no, no) \
SC(197, 54, 52, 2, no, no) \
SC(198, 54, 52, 3, no, no) \
SC(199, 54, 52, 4, no, no) \
\
SC(200, 55, 53, 1, no, no) \
SC(201, 55, 53, 2, no, no) \
SC(202, 55, 53, 3, no, no) \
SC(203, 55, 53, 4, no, no) \
\
SC(204, 56, 54, 1, no, no) \
SC(205, 56, 54, 2, no, no) \
SC(206, 56, 54, 3, no, no) \
SC(207, 56, 54, 4, no, no) \
\
SC(208, 57, 55, 1, no, no) \
SC(209, 57, 55, 2, no, no) \
SC(210, 57, 55, 3, no, no) \
SC(211, 57, 55, 4, no, no) \
\
SC(212, 58, 56, 1, no, no) \
SC(213, 58, 56, 2, no, no) \
SC(214, 58, 56, 3, no, no) \
SC(215, 58, 56, 4, no, no) \
\
SC(216, 59, 57, 1, no, no) \
SC(217, 59, 57, 2, no, no) \
SC(218, 59, 57, 3, no, no) \
SC(219, 59, 57, 4, no, no) \
\
SC(220, 60, 58, 1, no, no) \
SC(221, 60, 58, 2, no, no) \
SC(222, 60, 58, 3, no, no) \
SC(223, 60, 58, 4, no, no) \
\
SC(224, 61, 59, 1, no, no) \
SC(225, 61, 59, 2, no, no) \
SC(226, 61, 59, 3, no, no) \
SC(227, 61, 59, 4, no, no) \
\
SC(228, 62, 60, 1, no, no) \
SC(229, 62, 60, 2, no, no) \
SC(230, 62, 60, 3, no, no) \
SC(231, 62, 60, 4, no, no) \
\
SC(232, 63, 61, 1, no, no) \
SC(233, 63, 61, 2, no, no) \
SC(234, 63, 61, 3, no, no) \
#define SIZE_CLASSES_DEFINED
#define NTBINS 0
#define NLBINS 28
#define NBINS 43
#define LG_TINY_MAXCLASS "NA"
#define LOOKUP_MAXCLASS ((((size_t)1) << 11) + (((size_t)4) << 9))
#define SMALL_MAXCLASS ((((size_t)1) << 15) + (((size_t)3) << 13))
#endif
#ifndef SIZE_CLASSES_DEFINED
# error "No size class definitions match configuration"
#endif
#undef SIZE_CLASSES_DEFINED
/*
* 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_t's bits field.
*/
#if (NBINS > 255)
# error "Too many small size classes"
#endif
#endif /* JEMALLOC_H_TYPES */
/******************************************************************************/
#ifdef JEMALLOC_H_STRUCTS
#endif /* JEMALLOC_H_STRUCTS */
/******************************************************************************/
#ifdef JEMALLOC_H_EXTERNS
#endif /* JEMALLOC_H_EXTERNS */
/******************************************************************************/
#ifdef JEMALLOC_H_INLINES
#endif /* JEMALLOC_H_INLINES */
/******************************************************************************/
| 199,875 | 46.931894 | 80 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/jemalloc_gen/include/jemalloc/internal/private_namespace.h
|
#define a0calloc JEMALLOC_N(a0calloc)
#define a0free JEMALLOC_N(a0free)
#define a0malloc JEMALLOC_N(a0malloc)
#define arena_alloc_junk_small JEMALLOC_N(arena_alloc_junk_small)
#define arena_bin_index JEMALLOC_N(arena_bin_index)
#define arena_bin_info JEMALLOC_N(arena_bin_info)
#define arena_boot JEMALLOC_N(arena_boot)
#define arena_chunk_alloc_huge JEMALLOC_N(arena_chunk_alloc_huge)
#define arena_chunk_dalloc_huge JEMALLOC_N(arena_chunk_dalloc_huge)
#define arena_dalloc JEMALLOC_N(arena_dalloc)
#define arena_dalloc_bin JEMALLOC_N(arena_dalloc_bin)
#define arena_dalloc_bin_locked JEMALLOC_N(arena_dalloc_bin_locked)
#define arena_dalloc_junk_large JEMALLOC_N(arena_dalloc_junk_large)
#define arena_dalloc_junk_small JEMALLOC_N(arena_dalloc_junk_small)
#define arena_dalloc_large JEMALLOC_N(arena_dalloc_large)
#define arena_dalloc_large_locked JEMALLOC_N(arena_dalloc_large_locked)
#define arena_dalloc_small JEMALLOC_N(arena_dalloc_small)
#define arena_dss_prec_get JEMALLOC_N(arena_dss_prec_get)
#define arena_dss_prec_set JEMALLOC_N(arena_dss_prec_set)
#define arena_malloc JEMALLOC_N(arena_malloc)
#define arena_malloc_large JEMALLOC_N(arena_malloc_large)
#define arena_malloc_small JEMALLOC_N(arena_malloc_small)
#define arena_mapbits_allocated_get JEMALLOC_N(arena_mapbits_allocated_get)
#define arena_mapbits_binind_get JEMALLOC_N(arena_mapbits_binind_get)
#define arena_mapbits_dirty_get JEMALLOC_N(arena_mapbits_dirty_get)
#define arena_mapbits_get JEMALLOC_N(arena_mapbits_get)
#define arena_mapbits_large_binind_set JEMALLOC_N(arena_mapbits_large_binind_set)
#define arena_mapbits_large_get JEMALLOC_N(arena_mapbits_large_get)
#define arena_mapbits_large_set JEMALLOC_N(arena_mapbits_large_set)
#define arena_mapbits_large_size_get JEMALLOC_N(arena_mapbits_large_size_get)
#define arena_mapbits_small_runind_get JEMALLOC_N(arena_mapbits_small_runind_get)
#define arena_mapbits_small_set JEMALLOC_N(arena_mapbits_small_set)
#define arena_mapbits_unallocated_set JEMALLOC_N(arena_mapbits_unallocated_set)
#define arena_mapbits_unallocated_size_get JEMALLOC_N(arena_mapbits_unallocated_size_get)
#define arena_mapbits_unallocated_size_set JEMALLOC_N(arena_mapbits_unallocated_size_set)
#define arena_mapbits_unzeroed_get JEMALLOC_N(arena_mapbits_unzeroed_get)
#define arena_mapbits_unzeroed_set JEMALLOC_N(arena_mapbits_unzeroed_set)
#define arena_mapbitsp_get JEMALLOC_N(arena_mapbitsp_get)
#define arena_mapbitsp_read JEMALLOC_N(arena_mapbitsp_read)
#define arena_mapbitsp_write JEMALLOC_N(arena_mapbitsp_write)
#define arena_mapelm_to_pageind JEMALLOC_N(arena_mapelm_to_pageind)
#define arena_mapp_get JEMALLOC_N(arena_mapp_get)
#define arena_maxclass JEMALLOC_N(arena_maxclass)
#define arena_new JEMALLOC_N(arena_new)
#define arena_palloc JEMALLOC_N(arena_palloc)
#define arena_postfork_child JEMALLOC_N(arena_postfork_child)
#define arena_postfork_parent JEMALLOC_N(arena_postfork_parent)
#define arena_prefork JEMALLOC_N(arena_prefork)
#define arena_prof_accum JEMALLOC_N(arena_prof_accum)
#define arena_prof_accum_impl JEMALLOC_N(arena_prof_accum_impl)
#define arena_prof_accum_locked JEMALLOC_N(arena_prof_accum_locked)
#define arena_prof_ctx_get JEMALLOC_N(arena_prof_ctx_get)
#define arena_prof_ctx_set JEMALLOC_N(arena_prof_ctx_set)
#define arena_prof_promoted JEMALLOC_N(arena_prof_promoted)
#define arena_ptr_small_binind_get JEMALLOC_N(arena_ptr_small_binind_get)
#define arena_purge_all JEMALLOC_N(arena_purge_all)
#define arena_quarantine_junk_small JEMALLOC_N(arena_quarantine_junk_small)
#define arena_ralloc JEMALLOC_N(arena_ralloc)
#define arena_ralloc_junk_large JEMALLOC_N(arena_ralloc_junk_large)
#define arena_ralloc_no_move JEMALLOC_N(arena_ralloc_no_move)
#define arena_redzone_corruption JEMALLOC_N(arena_redzone_corruption)
#define arena_run_regind JEMALLOC_N(arena_run_regind)
#define arena_runs_avail_tree_iter JEMALLOC_N(arena_runs_avail_tree_iter)
#define arena_salloc JEMALLOC_N(arena_salloc)
#define arena_stats_merge JEMALLOC_N(arena_stats_merge)
#define arena_tcache_fill_small JEMALLOC_N(arena_tcache_fill_small)
#define arenas JEMALLOC_N(arenas)
#define pools JEMALLOC_N(pools)
#define arenas_booted JEMALLOC_N(arenas_booted)
#define arenas_cleanup JEMALLOC_N(arenas_cleanup)
#define arenas_extend JEMALLOC_N(arenas_extend)
#define arenas_initialized JEMALLOC_N(arenas_initialized)
#define arenas_lock JEMALLOC_N(arenas_lock)
#define arenas_tls JEMALLOC_N(arenas_tls)
#define arenas_tsd JEMALLOC_N(arenas_tsd)
#define arenas_tsd_boot JEMALLOC_N(arenas_tsd_boot)
#define arenas_tsd_cleanup_wrapper JEMALLOC_N(arenas_tsd_cleanup_wrapper)
#define arenas_tsd_get JEMALLOC_N(arenas_tsd_get)
#define arenas_tsd_get_wrapper JEMALLOC_N(arenas_tsd_get_wrapper)
#define arenas_tsd_init_head JEMALLOC_N(arenas_tsd_init_head)
#define arenas_tsd_set JEMALLOC_N(arenas_tsd_set)
#define atomic_add_u JEMALLOC_N(atomic_add_u)
#define atomic_add_uint32 JEMALLOC_N(atomic_add_uint32)
#define atomic_add_uint64 JEMALLOC_N(atomic_add_uint64)
#define atomic_add_z JEMALLOC_N(atomic_add_z)
#define atomic_sub_u JEMALLOC_N(atomic_sub_u)
#define atomic_sub_uint32 JEMALLOC_N(atomic_sub_uint32)
#define atomic_sub_uint64 JEMALLOC_N(atomic_sub_uint64)
#define atomic_sub_z JEMALLOC_N(atomic_sub_z)
#define base_alloc JEMALLOC_N(base_alloc)
#define base_boot JEMALLOC_N(base_boot)
#define base_calloc JEMALLOC_N(base_calloc)
#define base_free_fn JEMALLOC_N(base_free_fn)
#define base_malloc_fn JEMALLOC_N(base_malloc_fn)
#define base_node_alloc JEMALLOC_N(base_node_alloc)
#define base_node_dalloc JEMALLOC_N(base_node_dalloc)
#define base_pool JEMALLOC_N(base_pool)
#define base_postfork_child JEMALLOC_N(base_postfork_child)
#define base_postfork_parent JEMALLOC_N(base_postfork_parent)
#define base_prefork JEMALLOC_N(base_prefork)
#define bitmap_full JEMALLOC_N(bitmap_full)
#define bitmap_get JEMALLOC_N(bitmap_get)
#define bitmap_info_init JEMALLOC_N(bitmap_info_init)
#define bitmap_info_ngroups JEMALLOC_N(bitmap_info_ngroups)
#define bitmap_init JEMALLOC_N(bitmap_init)
#define bitmap_set JEMALLOC_N(bitmap_set)
#define bitmap_sfu JEMALLOC_N(bitmap_sfu)
#define bitmap_size JEMALLOC_N(bitmap_size)
#define bitmap_unset JEMALLOC_N(bitmap_unset)
#define bt_init JEMALLOC_N(bt_init)
#define buferror JEMALLOC_N(buferror)
#define choose_arena JEMALLOC_N(choose_arena)
#define choose_arena_hard JEMALLOC_N(choose_arena_hard)
#define chunk_alloc_arena JEMALLOC_N(chunk_alloc_arena)
#define chunk_alloc_base JEMALLOC_N(chunk_alloc_base)
#define chunk_alloc_default JEMALLOC_N(chunk_alloc_default)
#define chunk_alloc_dss JEMALLOC_N(chunk_alloc_dss)
#define chunk_alloc_mmap JEMALLOC_N(chunk_alloc_mmap)
#define chunk_global_boot JEMALLOC_N(chunk_global_boot)
#define chunk_boot JEMALLOC_N(chunk_boot)
#define chunk_dalloc_default JEMALLOC_N(chunk_dalloc_default)
#define chunk_dalloc_mmap JEMALLOC_N(chunk_dalloc_mmap)
#define chunk_dss_boot JEMALLOC_N(chunk_dss_boot)
#define chunk_dss_postfork_child JEMALLOC_N(chunk_dss_postfork_child)
#define chunk_dss_postfork_parent JEMALLOC_N(chunk_dss_postfork_parent)
#define chunk_dss_prec_get JEMALLOC_N(chunk_dss_prec_get)
#define chunk_dss_prec_set JEMALLOC_N(chunk_dss_prec_set)
#define chunk_dss_prefork JEMALLOC_N(chunk_dss_prefork)
#define chunk_in_dss JEMALLOC_N(chunk_in_dss)
#define chunk_npages JEMALLOC_N(chunk_npages)
#define chunk_postfork_child JEMALLOC_N(chunk_postfork_child)
#define chunk_postfork_parent JEMALLOC_N(chunk_postfork_parent)
#define chunk_prefork JEMALLOC_N(chunk_prefork)
#define chunk_unmap JEMALLOC_N(chunk_unmap)
#define chunk_record JEMALLOC_N(chunk_record)
#define chunks_mtx JEMALLOC_N(chunks_mtx)
#define chunks_rtree JEMALLOC_N(chunks_rtree)
#define chunksize JEMALLOC_N(chunksize)
#define chunksize_mask JEMALLOC_N(chunksize_mask)
#define ckh_bucket_search JEMALLOC_N(ckh_bucket_search)
#define ckh_count JEMALLOC_N(ckh_count)
#define ckh_delete JEMALLOC_N(ckh_delete)
#define ckh_evict_reloc_insert JEMALLOC_N(ckh_evict_reloc_insert)
#define ckh_insert JEMALLOC_N(ckh_insert)
#define ckh_isearch JEMALLOC_N(ckh_isearch)
#define ckh_iter JEMALLOC_N(ckh_iter)
#define ckh_new JEMALLOC_N(ckh_new)
#define ckh_pointer_hash JEMALLOC_N(ckh_pointer_hash)
#define ckh_pointer_keycomp JEMALLOC_N(ckh_pointer_keycomp)
#define ckh_rebuild JEMALLOC_N(ckh_rebuild)
#define ckh_remove JEMALLOC_N(ckh_remove)
#define ckh_search JEMALLOC_N(ckh_search)
#define ckh_string_hash JEMALLOC_N(ckh_string_hash)
#define ckh_string_keycomp JEMALLOC_N(ckh_string_keycomp)
#define ckh_try_bucket_insert JEMALLOC_N(ckh_try_bucket_insert)
#define ckh_try_insert JEMALLOC_N(ckh_try_insert)
#define ctl_boot JEMALLOC_N(ctl_boot)
#define ctl_bymib JEMALLOC_N(ctl_bymib)
#define ctl_byname JEMALLOC_N(ctl_byname)
#define ctl_nametomib JEMALLOC_N(ctl_nametomib)
#define ctl_postfork_child JEMALLOC_N(ctl_postfork_child)
#define ctl_postfork_parent JEMALLOC_N(ctl_postfork_parent)
#define ctl_prefork JEMALLOC_N(ctl_prefork)
#define dss_prec_names JEMALLOC_N(dss_prec_names)
#define extent_tree_ad_first JEMALLOC_N(extent_tree_ad_first)
#define extent_tree_ad_insert JEMALLOC_N(extent_tree_ad_insert)
#define extent_tree_ad_iter JEMALLOC_N(extent_tree_ad_iter)
#define extent_tree_ad_iter_recurse JEMALLOC_N(extent_tree_ad_iter_recurse)
#define extent_tree_ad_iter_start JEMALLOC_N(extent_tree_ad_iter_start)
#define extent_tree_ad_last JEMALLOC_N(extent_tree_ad_last)
#define extent_tree_ad_new JEMALLOC_N(extent_tree_ad_new)
#define extent_tree_ad_next JEMALLOC_N(extent_tree_ad_next)
#define extent_tree_ad_nsearch JEMALLOC_N(extent_tree_ad_nsearch)
#define extent_tree_ad_prev JEMALLOC_N(extent_tree_ad_prev)
#define extent_tree_ad_psearch JEMALLOC_N(extent_tree_ad_psearch)
#define extent_tree_ad_remove JEMALLOC_N(extent_tree_ad_remove)
#define extent_tree_ad_reverse_iter JEMALLOC_N(extent_tree_ad_reverse_iter)
#define extent_tree_ad_reverse_iter_recurse JEMALLOC_N(extent_tree_ad_reverse_iter_recurse)
#define extent_tree_ad_reverse_iter_start JEMALLOC_N(extent_tree_ad_reverse_iter_start)
#define extent_tree_ad_search JEMALLOC_N(extent_tree_ad_search)
#define extent_tree_szad_first JEMALLOC_N(extent_tree_szad_first)
#define extent_tree_szad_insert JEMALLOC_N(extent_tree_szad_insert)
#define extent_tree_szad_iter JEMALLOC_N(extent_tree_szad_iter)
#define extent_tree_szad_iter_recurse JEMALLOC_N(extent_tree_szad_iter_recurse)
#define extent_tree_szad_iter_start JEMALLOC_N(extent_tree_szad_iter_start)
#define extent_tree_szad_last JEMALLOC_N(extent_tree_szad_last)
#define extent_tree_szad_new JEMALLOC_N(extent_tree_szad_new)
#define extent_tree_szad_next JEMALLOC_N(extent_tree_szad_next)
#define extent_tree_szad_nsearch JEMALLOC_N(extent_tree_szad_nsearch)
#define extent_tree_szad_prev JEMALLOC_N(extent_tree_szad_prev)
#define extent_tree_szad_psearch JEMALLOC_N(extent_tree_szad_psearch)
#define extent_tree_szad_remove JEMALLOC_N(extent_tree_szad_remove)
#define extent_tree_szad_reverse_iter JEMALLOC_N(extent_tree_szad_reverse_iter)
#define extent_tree_szad_reverse_iter_recurse JEMALLOC_N(extent_tree_szad_reverse_iter_recurse)
#define extent_tree_szad_reverse_iter_start JEMALLOC_N(extent_tree_szad_reverse_iter_start)
#define extent_tree_szad_search JEMALLOC_N(extent_tree_szad_search)
#define get_errno JEMALLOC_N(get_errno)
#define hash JEMALLOC_N(hash)
#define hash_fmix_32 JEMALLOC_N(hash_fmix_32)
#define hash_fmix_64 JEMALLOC_N(hash_fmix_64)
#define hash_get_block_32 JEMALLOC_N(hash_get_block_32)
#define hash_get_block_64 JEMALLOC_N(hash_get_block_64)
#define hash_rotl_32 JEMALLOC_N(hash_rotl_32)
#define hash_rotl_64 JEMALLOC_N(hash_rotl_64)
#define hash_x64_128 JEMALLOC_N(hash_x64_128)
#define hash_x86_128 JEMALLOC_N(hash_x86_128)
#define hash_x86_32 JEMALLOC_N(hash_x86_32)
#define huge_allocated JEMALLOC_N(huge_allocated)
#define huge_boot JEMALLOC_N(huge_boot)
#define huge_dalloc JEMALLOC_N(huge_dalloc)
#define huge_dalloc_junk JEMALLOC_N(huge_dalloc_junk)
#define huge_malloc JEMALLOC_N(huge_malloc)
#define huge_ndalloc JEMALLOC_N(huge_ndalloc)
#define huge_nmalloc JEMALLOC_N(huge_nmalloc)
#define huge_palloc JEMALLOC_N(huge_palloc)
#define huge_postfork_child JEMALLOC_N(huge_postfork_child)
#define huge_postfork_parent JEMALLOC_N(huge_postfork_parent)
#define huge_prefork JEMALLOC_N(huge_prefork)
#define huge_prof_ctx_get JEMALLOC_N(huge_prof_ctx_get)
#define huge_prof_ctx_set JEMALLOC_N(huge_prof_ctx_set)
#define huge_ralloc JEMALLOC_N(huge_ralloc)
#define huge_ralloc_no_move JEMALLOC_N(huge_ralloc_no_move)
#define huge_salloc JEMALLOC_N(huge_salloc)
#define icalloc JEMALLOC_N(icalloc)
#define icalloct JEMALLOC_N(icalloct)
#define idalloc JEMALLOC_N(idalloc)
#define idalloct JEMALLOC_N(idalloct)
#define imalloc JEMALLOC_N(imalloc)
#define imalloct JEMALLOC_N(imalloct)
#define in_valgrind JEMALLOC_N(in_valgrind)
#define ipalloc JEMALLOC_N(ipalloc)
#define ipalloct JEMALLOC_N(ipalloct)
#define iqalloc JEMALLOC_N(iqalloc)
#define iqalloct JEMALLOC_N(iqalloct)
#define iralloc JEMALLOC_N(iralloc)
#define iralloct JEMALLOC_N(iralloct)
#define iralloct_realign JEMALLOC_N(iralloct_realign)
#define isalloc JEMALLOC_N(isalloc)
#define isthreaded JEMALLOC_N(isthreaded)
#define ivsalloc JEMALLOC_N(ivsalloc)
#define ixalloc JEMALLOC_N(ixalloc)
#define jemalloc_postfork_child JEMALLOC_N(jemalloc_postfork_child)
#define jemalloc_postfork_parent JEMALLOC_N(jemalloc_postfork_parent)
#define jemalloc_prefork JEMALLOC_N(jemalloc_prefork)
#define lg_floor JEMALLOC_N(lg_floor)
#define malloc_cprintf JEMALLOC_N(malloc_cprintf)
#define malloc_mutex_init JEMALLOC_N(malloc_mutex_init)
#define malloc_mutex_lock JEMALLOC_N(malloc_mutex_lock)
#define malloc_mutex_postfork_child JEMALLOC_N(malloc_mutex_postfork_child)
#define malloc_mutex_postfork_parent JEMALLOC_N(malloc_mutex_postfork_parent)
#define malloc_mutex_prefork JEMALLOC_N(malloc_mutex_prefork)
#define malloc_mutex_unlock JEMALLOC_N(malloc_mutex_unlock)
#define malloc_rwlock_init JEMALLOC_N(malloc_rwlock_init)
#define malloc_rwlock_postfork_child JEMALLOC_N(malloc_rwlock_postfork_child)
#define malloc_rwlock_postfork_parent JEMALLOC_N(malloc_rwlock_postfork_parent)
#define malloc_rwlock_prefork JEMALLOC_N(malloc_rwlock_prefork)
#define malloc_rwlock_rdlock JEMALLOC_N(malloc_rwlock_rdlock)
#define malloc_rwlock_wrlock JEMALLOC_N(malloc_rwlock_wrlock)
#define malloc_rwlock_unlock JEMALLOC_N(malloc_rwlock_unlock)
#define malloc_rwlock_destroy JEMALLOC_N(malloc_rwlock_destroy)
#define malloc_printf JEMALLOC_N(malloc_printf)
#define malloc_snprintf JEMALLOC_N(malloc_snprintf)
#define malloc_strtoumax JEMALLOC_N(malloc_strtoumax)
#define malloc_tsd_boot JEMALLOC_N(malloc_tsd_boot)
#define malloc_tsd_cleanup_register JEMALLOC_N(malloc_tsd_cleanup_register)
#define malloc_tsd_dalloc JEMALLOC_N(malloc_tsd_dalloc)
#define malloc_tsd_malloc JEMALLOC_N(malloc_tsd_malloc)
#define malloc_tsd_no_cleanup JEMALLOC_N(malloc_tsd_no_cleanup)
#define malloc_vcprintf JEMALLOC_N(malloc_vcprintf)
#define malloc_vsnprintf JEMALLOC_N(malloc_vsnprintf)
#define malloc_write JEMALLOC_N(malloc_write)
#define map_bias JEMALLOC_N(map_bias)
#define mb_write JEMALLOC_N(mb_write)
#define mutex_boot JEMALLOC_N(mutex_boot)
#define narenas_auto JEMALLOC_N(narenas_auto)
#define narenas_total JEMALLOC_N(narenas_total)
#define narenas_total_get JEMALLOC_N(narenas_total_get)
#define ncpus JEMALLOC_N(ncpus)
#define nhbins JEMALLOC_N(nhbins)
#define npools JEMALLOC_N(npools)
#define npools_cnt JEMALLOC_N(npools_cnt)
#define opt_abort JEMALLOC_N(opt_abort)
#define opt_dss JEMALLOC_N(opt_dss)
#define opt_junk JEMALLOC_N(opt_junk)
#define opt_lg_chunk JEMALLOC_N(opt_lg_chunk)
#define opt_lg_dirty_mult JEMALLOC_N(opt_lg_dirty_mult)
#define opt_lg_prof_interval JEMALLOC_N(opt_lg_prof_interval)
#define opt_lg_prof_sample JEMALLOC_N(opt_lg_prof_sample)
#define opt_lg_tcache_max JEMALLOC_N(opt_lg_tcache_max)
#define opt_narenas JEMALLOC_N(opt_narenas)
#define opt_prof JEMALLOC_N(opt_prof)
#define opt_prof_accum JEMALLOC_N(opt_prof_accum)
#define opt_prof_active JEMALLOC_N(opt_prof_active)
#define opt_prof_final JEMALLOC_N(opt_prof_final)
#define opt_prof_gdump JEMALLOC_N(opt_prof_gdump)
#define opt_prof_leak JEMALLOC_N(opt_prof_leak)
#define opt_prof_prefix JEMALLOC_N(opt_prof_prefix)
#define opt_quarantine JEMALLOC_N(opt_quarantine)
#define opt_redzone JEMALLOC_N(opt_redzone)
#define opt_stats_print JEMALLOC_N(opt_stats_print)
#define opt_tcache JEMALLOC_N(opt_tcache)
#define opt_utrace JEMALLOC_N(opt_utrace)
#define opt_xmalloc JEMALLOC_N(opt_xmalloc)
#define opt_zero JEMALLOC_N(opt_zero)
#define p2rz JEMALLOC_N(p2rz)
#define pages_purge JEMALLOC_N(pages_purge)
#define pools_shared_data_initialized JEMALLOC_N(pools_shared_data_initialized)
#define pow2_ceil JEMALLOC_N(pow2_ceil)
#define prof_backtrace JEMALLOC_N(prof_backtrace)
#define prof_boot0 JEMALLOC_N(prof_boot0)
#define prof_boot1 JEMALLOC_N(prof_boot1)
#define prof_boot2 JEMALLOC_N(prof_boot2)
#define prof_bt_count JEMALLOC_N(prof_bt_count)
#define prof_ctx_get JEMALLOC_N(prof_ctx_get)
#define prof_ctx_set JEMALLOC_N(prof_ctx_set)
#define prof_dump_open JEMALLOC_N(prof_dump_open)
#define prof_free JEMALLOC_N(prof_free)
#define prof_gdump JEMALLOC_N(prof_gdump)
#define prof_idump JEMALLOC_N(prof_idump)
#define prof_interval JEMALLOC_N(prof_interval)
#define prof_lookup JEMALLOC_N(prof_lookup)
#define prof_malloc JEMALLOC_N(prof_malloc)
#define prof_malloc_record_object JEMALLOC_N(prof_malloc_record_object)
#define prof_mdump JEMALLOC_N(prof_mdump)
#define prof_postfork_child JEMALLOC_N(prof_postfork_child)
#define prof_postfork_parent JEMALLOC_N(prof_postfork_parent)
#define prof_prefork JEMALLOC_N(prof_prefork)
#define prof_realloc JEMALLOC_N(prof_realloc)
#define prof_sample_accum_update JEMALLOC_N(prof_sample_accum_update)
#define prof_sample_threshold_update JEMALLOC_N(prof_sample_threshold_update)
#define prof_tdata_booted JEMALLOC_N(prof_tdata_booted)
#define prof_tdata_cleanup JEMALLOC_N(prof_tdata_cleanup)
#define prof_tdata_get JEMALLOC_N(prof_tdata_get)
#define prof_tdata_init JEMALLOC_N(prof_tdata_init)
#define prof_tdata_initialized JEMALLOC_N(prof_tdata_initialized)
#define prof_tdata_tls JEMALLOC_N(prof_tdata_tls)
#define prof_tdata_tsd JEMALLOC_N(prof_tdata_tsd)
#define prof_tdata_tsd_boot JEMALLOC_N(prof_tdata_tsd_boot)
#define prof_tdata_tsd_cleanup_wrapper JEMALLOC_N(prof_tdata_tsd_cleanup_wrapper)
#define prof_tdata_tsd_get JEMALLOC_N(prof_tdata_tsd_get)
#define prof_tdata_tsd_get_wrapper JEMALLOC_N(prof_tdata_tsd_get_wrapper)
#define prof_tdata_tsd_init_head JEMALLOC_N(prof_tdata_tsd_init_head)
#define prof_tdata_tsd_set JEMALLOC_N(prof_tdata_tsd_set)
#define quarantine JEMALLOC_N(quarantine)
#define quarantine_alloc_hook JEMALLOC_N(quarantine_alloc_hook)
#define quarantine_boot JEMALLOC_N(quarantine_boot)
#define quarantine_booted JEMALLOC_N(quarantine_booted)
#define quarantine_cleanup JEMALLOC_N(quarantine_cleanup)
#define quarantine_init JEMALLOC_N(quarantine_init)
#define quarantine_tls JEMALLOC_N(quarantine_tls)
#define quarantine_tsd JEMALLOC_N(quarantine_tsd)
#define quarantine_tsd_boot JEMALLOC_N(quarantine_tsd_boot)
#define quarantine_tsd_cleanup_wrapper JEMALLOC_N(quarantine_tsd_cleanup_wrapper)
#define quarantine_tsd_get JEMALLOC_N(quarantine_tsd_get)
#define quarantine_tsd_get_wrapper JEMALLOC_N(quarantine_tsd_get_wrapper)
#define quarantine_tsd_init_head JEMALLOC_N(quarantine_tsd_init_head)
#define quarantine_tsd_set JEMALLOC_N(quarantine_tsd_set)
#define register_zone JEMALLOC_N(register_zone)
#define rtree_delete JEMALLOC_N(rtree_delete)
#define rtree_get JEMALLOC_N(rtree_get)
#define rtree_get_locked JEMALLOC_N(rtree_get_locked)
#define rtree_new JEMALLOC_N(rtree_new)
#define rtree_postfork_child JEMALLOC_N(rtree_postfork_child)
#define rtree_postfork_parent JEMALLOC_N(rtree_postfork_parent)
#define rtree_prefork JEMALLOC_N(rtree_prefork)
#define rtree_set JEMALLOC_N(rtree_set)
#define s2u JEMALLOC_N(s2u)
#define sa2u JEMALLOC_N(sa2u)
#define set_errno JEMALLOC_N(set_errno)
#define small_bin2size JEMALLOC_N(small_bin2size)
#define small_bin2size_compute JEMALLOC_N(small_bin2size_compute)
#define small_bin2size_lookup JEMALLOC_N(small_bin2size_lookup)
#define small_bin2size_tab JEMALLOC_N(small_bin2size_tab)
#define small_s2u JEMALLOC_N(small_s2u)
#define small_s2u_compute JEMALLOC_N(small_s2u_compute)
#define small_s2u_lookup JEMALLOC_N(small_s2u_lookup)
#define small_size2bin JEMALLOC_N(small_size2bin)
#define small_size2bin_compute JEMALLOC_N(small_size2bin_compute)
#define small_size2bin_lookup JEMALLOC_N(small_size2bin_lookup)
#define small_size2bin_tab JEMALLOC_N(small_size2bin_tab)
#define stats_cactive JEMALLOC_N(stats_cactive)
#define stats_cactive_add JEMALLOC_N(stats_cactive_add)
#define stats_cactive_get JEMALLOC_N(stats_cactive_get)
#define stats_cactive_sub JEMALLOC_N(stats_cactive_sub)
#define stats_chunks JEMALLOC_N(stats_chunks)
#define stats_print JEMALLOC_N(stats_print)
#define tcache_alloc_easy JEMALLOC_N(tcache_alloc_easy)
#define tcache_alloc_large JEMALLOC_N(tcache_alloc_large)
#define tcache_alloc_small JEMALLOC_N(tcache_alloc_small)
#define tcache_alloc_small_hard JEMALLOC_N(tcache_alloc_small_hard)
#define tcache_arena_associate JEMALLOC_N(tcache_arena_associate)
#define tcache_arena_dissociate JEMALLOC_N(tcache_arena_dissociate)
#define tcache_bin_flush_large JEMALLOC_N(tcache_bin_flush_large)
#define tcache_bin_flush_small JEMALLOC_N(tcache_bin_flush_small)
#define tcache_bin_info JEMALLOC_N(tcache_bin_info)
#define tcache_boot0 JEMALLOC_N(tcache_boot0)
#define tcache_boot1 JEMALLOC_N(tcache_boot1)
#define tcache_booted JEMALLOC_N(tcache_booted)
#define tcache_create JEMALLOC_N(tcache_create)
#define tcache_dalloc_large JEMALLOC_N(tcache_dalloc_large)
#define tcache_dalloc_small JEMALLOC_N(tcache_dalloc_small)
#define tcache_destroy JEMALLOC_N(tcache_destroy)
#define tcache_enabled_booted JEMALLOC_N(tcache_enabled_booted)
#define tcache_enabled_get JEMALLOC_N(tcache_enabled_get)
#define tcache_enabled_initialized JEMALLOC_N(tcache_enabled_initialized)
#define tcache_enabled_set JEMALLOC_N(tcache_enabled_set)
#define tcache_enabled_tls JEMALLOC_N(tcache_enabled_tls)
#define tcache_enabled_tsd JEMALLOC_N(tcache_enabled_tsd)
#define tcache_enabled_tsd_boot JEMALLOC_N(tcache_enabled_tsd_boot)
#define tcache_enabled_tsd_cleanup_wrapper JEMALLOC_N(tcache_enabled_tsd_cleanup_wrapper)
#define tcache_enabled_tsd_get JEMALLOC_N(tcache_enabled_tsd_get)
#define tcache_enabled_tsd_get_wrapper JEMALLOC_N(tcache_enabled_tsd_get_wrapper)
#define tcache_enabled_tsd_init_head JEMALLOC_N(tcache_enabled_tsd_init_head)
#define tcache_enabled_tsd_set JEMALLOC_N(tcache_enabled_tsd_set)
#define tcache_event JEMALLOC_N(tcache_event)
#define tcache_event_hard JEMALLOC_N(tcache_event_hard)
#define tcache_flush JEMALLOC_N(tcache_flush)
#define tcache_get JEMALLOC_N(tcache_get)
#define tcache_get_hard JEMALLOC_N(tcache_get_hard)
#define tcache_initialized JEMALLOC_N(tcache_initialized)
#define tcache_maxclass JEMALLOC_N(tcache_maxclass)
#define tcache_salloc JEMALLOC_N(tcache_salloc)
#define tcache_stats_merge JEMALLOC_N(tcache_stats_merge)
#define tcache_thread_cleanup JEMALLOC_N(tcache_thread_cleanup)
#define tcache_tls JEMALLOC_N(tcache_tls)
#define tcache_tsd JEMALLOC_N(tcache_tsd)
#define tcache_tsd_boot JEMALLOC_N(tcache_tsd_boot)
#define tcache_tsd_cleanup_wrapper JEMALLOC_N(tcache_tsd_cleanup_wrapper)
#define tcache_tsd_get JEMALLOC_N(tcache_tsd_get)
#define tcache_tsd_get_wrapper JEMALLOC_N(tcache_tsd_get_wrapper)
#define tcache_tsd_init_head JEMALLOC_N(tcache_tsd_init_head)
#define tcache_tsd_set JEMALLOC_N(tcache_tsd_set)
#define thread_allocated_booted JEMALLOC_N(thread_allocated_booted)
#define thread_allocated_initialized JEMALLOC_N(thread_allocated_initialized)
#define thread_allocated_tls JEMALLOC_N(thread_allocated_tls)
#define thread_allocated_tsd JEMALLOC_N(thread_allocated_tsd)
#define thread_allocated_tsd_boot JEMALLOC_N(thread_allocated_tsd_boot)
#define thread_allocated_tsd_cleanup_wrapper JEMALLOC_N(thread_allocated_tsd_cleanup_wrapper)
#define thread_allocated_tsd_get JEMALLOC_N(thread_allocated_tsd_get)
#define thread_allocated_tsd_get_wrapper JEMALLOC_N(thread_allocated_tsd_get_wrapper)
#define thread_allocated_tsd_init_head JEMALLOC_N(thread_allocated_tsd_init_head)
#define thread_allocated_tsd_set JEMALLOC_N(thread_allocated_tsd_set)
#define tsd_init_check_recursion JEMALLOC_N(tsd_init_check_recursion)
#define tsd_init_finish JEMALLOC_N(tsd_init_finish)
#define u2rz JEMALLOC_N(u2rz)
#define valgrind_freelike_block JEMALLOC_N(valgrind_freelike_block)
#define valgrind_make_mem_defined JEMALLOC_N(valgrind_make_mem_defined)
#define valgrind_make_mem_noaccess JEMALLOC_N(valgrind_make_mem_noaccess)
#define valgrind_make_mem_undefined JEMALLOC_N(valgrind_make_mem_undefined)
#define pool_new JEMALLOC_N(pool_new)
#define pool_destroy JEMALLOC_N(pool_destroy)
#define pools_lock JEMALLOC_N(pools_lock)
#define pool_base_lock JEMALLOC_N(pool_base_lock)
#define pool_prefork JEMALLOC_N(pool_prefork)
#define pool_postfork_parent JEMALLOC_N(pool_postfork_parent)
#define pool_postfork_child JEMALLOC_N(pool_postfork_child)
#define pool_alloc JEMALLOC_N(pool_alloc)
#define vec_get JEMALLOC_N(vec_get)
#define vec_set JEMALLOC_N(vec_set)
#define vec_delete JEMALLOC_N(vec_delete)
| 25,252 | 53.778742 | 95 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/jemalloc_gen/include/jemalloc/internal/jemalloc_internal_defs.h
|
/* ./../windows/jemalloc_gen/include/jemalloc/internal/jemalloc_internal_defs.h. Generated from jemalloc_internal_defs.h.in by configure. */
#ifndef JEMALLOC_INTERNAL_DEFS_H_
#define JEMALLOC_INTERNAL_DEFS_H_
/*
* If JEMALLOC_PREFIX is defined via --with-jemalloc-prefix, it will cause all
* public APIs to be prefixed. This makes it possible, with some care, to use
* multiple allocators simultaneously.
*/
#define JEMALLOC_PREFIX "je_vmem_"
#define JEMALLOC_CPREFIX "JE_VMEM_"
/*
* JEMALLOC_PRIVATE_NAMESPACE is used as a prefix for all library-private APIs.
* For shared libraries, symbol visibility mechanisms prevent these symbols
* from being exported, but for static libraries, naming collisions are a real
* possibility.
*/
#define JEMALLOC_PRIVATE_NAMESPACE je_vmem_je_
/*
* Hyper-threaded CPUs may need a special instruction inside spin loops in
* order to yield to another virtual CPU.
*/
#define CPU_SPINWAIT
/* Defined if the equivalent of FreeBSD's atomic(9) functions are available. */
/* #undef JEMALLOC_ATOMIC9 */
/*
* Defined if OSAtomic*() functions are available, as provided by Darwin, and
* documented in the atomic(3) manual page.
*/
/* #undef JEMALLOC_OSATOMIC */
/*
* Defined if __sync_add_and_fetch(uint32_t *, uint32_t) and
* __sync_sub_and_fetch(uint32_t *, uint32_t) are available, despite
* __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 not being defined (which means the
* functions are defined in libgcc instead of being inlines)
*/
/* #undef JE_FORCE_SYNC_COMPARE_AND_SWAP_4 */
/*
* Defined if __sync_add_and_fetch(uint64_t *, uint64_t) and
* __sync_sub_and_fetch(uint64_t *, uint64_t) are available, despite
* __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 not being defined (which means the
* functions are defined in libgcc instead of being inlines)
*/
/* #undef JE_FORCE_SYNC_COMPARE_AND_SWAP_8 */
/*
* Defined if __builtin_clz() and __builtin_clzl() are available.
*/
/* #undef JEMALLOC_HAVE_BUILTIN_CLZ */
/*
* Defined if madvise(2) is available.
*/
/* #undef JEMALLOC_HAVE_MADVISE */
/*
* Defined if OSSpin*() functions are available, as provided by Darwin, and
* documented in the spinlock(3) manual page.
*/
/* #undef JEMALLOC_OSSPIN */
/*
* Defined if _malloc_thread_cleanup() exists. At least in the case of
* FreeBSD, pthread_key_create() allocates, which if used during malloc
* bootstrapping will cause recursion into the pthreads library. Therefore, if
* _malloc_thread_cleanup() exists, use it as the basis for thread cleanup in
* malloc_tsd.
*/
/* #undef JEMALLOC_MALLOC_THREAD_CLEANUP */
/*
* Defined if threaded initialization is known to be safe on this platform.
* Among other things, it must be possible to initialize a mutex without
* triggering allocation in order for threaded allocation to be safe.
*/
/* #undef JEMALLOC_THREADED_INIT */
/*
* Defined if the pthreads implementation defines
* _pthread_mutex_init_calloc_cb(), in which case the function is used in order
* to avoid recursive allocation during mutex initialization.
*/
/* #undef JEMALLOC_MUTEX_INIT_CB */
/* Non-empty if the tls_model attribute is supported. */
#define JEMALLOC_TLS_MODEL
/* JEMALLOC_CC_SILENCE enables code that silences unuseful compiler warnings. */
#define JEMALLOC_CC_SILENCE
/* JEMALLOC_CODE_COVERAGE enables test code coverage analysis. */
/* #undef JEMALLOC_CODE_COVERAGE */
/*
* JEMALLOC_DEBUG enables assertions and other sanity checks, and disables
* inline functions.
*/
/* #undef JEMALLOC_DEBUG */
/* JEMALLOC_STATS enables statistics calculation. */
#define JEMALLOC_STATS
/* JEMALLOC_PROF enables allocation profiling. */
/* #undef JEMALLOC_PROF */
/* Use libunwind for profile backtracing if defined. */
/* #undef JEMALLOC_PROF_LIBUNWIND */
/* Use libgcc for profile backtracing if defined. */
/* #undef JEMALLOC_PROF_LIBGCC */
/* Use gcc intrinsics for profile backtracing if defined. */
/* #undef JEMALLOC_PROF_GCC */
/*
* JEMALLOC_TCACHE enables a thread-specific caching layer for small objects.
* This makes it possible to allocate/deallocate objects without any locking
* when the cache is in the steady state.
*/
#define JEMALLOC_TCACHE
/*
* JEMALLOC_DSS enables use of sbrk(2) to allocate chunks from the data storage
* segment (DSS).
*/
/* #undef JEMALLOC_DSS */
/* Support memory filling (junk/zero/quarantine/redzone). */
#define JEMALLOC_FILL
/* Support utrace(2)-based tracing. */
/* #undef JEMALLOC_UTRACE */
/* Support Valgrind. */
/* #undef JEMALLOC_VALGRIND */
/* Support optional abort() on OOM. */
/* #undef JEMALLOC_XMALLOC */
/* Support lazy locking (avoid locking unless a second thread is launched). */
/* #undef JEMALLOC_LAZY_LOCK */
/* One page is 2^STATIC_PAGE_SHIFT bytes. */
#define STATIC_PAGE_SHIFT 12
/*
* If defined, use munmap() to unmap freed chunks, rather than storing them for
* later reuse. This is disabled by default on Linux because common sequences
* of mmap()/munmap() calls will cause virtual memory map holes.
*/
/* #undef JEMALLOC_MUNMAP */
/* TLS is used to map arenas and magazine caches to threads. */
/* #undef JEMALLOC_TLS */
/*
* ffs()/ffsl() functions to use for bitmapping. Don't use these directly;
* instead, use jemalloc_ffs() or jemalloc_ffsl() from util.h.
*/
#define JEMALLOC_INTERNAL_FFSL ffsl
#define JEMALLOC_INTERNAL_FFS ffs
/*
* JEMALLOC_IVSALLOC enables ivsalloc(), which verifies that pointers reside
* within jemalloc-owned chunks before dereferencing them.
*/
/* #undef JEMALLOC_IVSALLOC */
/*
* Darwin (OS X) uses zones to work around Mach-O symbol override shortcomings.
*/
/* #undef JEMALLOC_ZONE */
/* #undef JEMALLOC_ZONE_VERSION */
/*
* Methods for purging unused pages differ between operating systems.
*
* madvise(..., MADV_DONTNEED) : On Linux, this immediately discards pages,
* such that new pages will be demand-zeroed if
* the address region is later touched.
* madvise(..., MADV_FREE) : On FreeBSD and Darwin, this marks pages as being
* unused, such that they will be discarded rather
* than swapped out.
*/
/* #undef JEMALLOC_PURGE_MADVISE_DONTNEED */
/* #undef JEMALLOC_PURGE_MADVISE_FREE */
/*
* Define if operating system has alloca.h header.
*/
/* #undef JEMALLOC_HAS_ALLOCA_H */
/* C99 restrict keyword supported. */
/* #undef JEMALLOC_HAS_RESTRICT */
/* For use by hash code. */
/* #undef JEMALLOC_BIG_ENDIAN */
/* sizeof(int) == 2^LG_SIZEOF_INT. */
#define LG_SIZEOF_INT 2
/* sizeof(long) == 2^LG_SIZEOF_LONG. */
#define LG_SIZEOF_LONG 2
/* sizeof(intmax_t) == 2^LG_SIZEOF_INTMAX_T. */
#define LG_SIZEOF_INTMAX_T 3
#endif /* JEMALLOC_INTERNAL_DEFS_H_ */
| 6,731 | 30.457944 | 142 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/jemalloc_gen/include/jemalloc/internal/public_unnamespace.h
|
#undef je_pool_create
#undef je_pool_delete
#undef je_pool_malloc
#undef je_pool_calloc
#undef je_pool_ralloc
#undef je_pool_aligned_alloc
#undef je_pool_free
#undef je_pool_malloc_usable_size
#undef je_pool_malloc_stats_print
#undef je_pool_extend
#undef je_pool_set_alloc_funcs
#undef je_pool_check
#undef je_malloc_conf
#undef je_malloc_message
#undef je_malloc
#undef je_calloc
#undef je_posix_memalign
#undef je_aligned_alloc
#undef je_realloc
#undef je_free
#undef je_mallocx
#undef je_rallocx
#undef je_xallocx
#undef je_sallocx
#undef je_dallocx
#undef je_nallocx
#undef je_mallctl
#undef je_mallctlnametomib
#undef je_mallctlbymib
#undef je_navsnprintf
#undef je_malloc_stats_print
#undef je_malloc_usable_size
| 720 | 20.848485 | 33 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/jemalloc_gen/include/jemalloc/internal/public_namespace.h
|
#define je_pool_create JEMALLOC_N(pool_create)
#define je_pool_delete JEMALLOC_N(pool_delete)
#define je_pool_malloc JEMALLOC_N(pool_malloc)
#define je_pool_calloc JEMALLOC_N(pool_calloc)
#define je_pool_ralloc JEMALLOC_N(pool_ralloc)
#define je_pool_aligned_alloc JEMALLOC_N(pool_aligned_alloc)
#define je_pool_free JEMALLOC_N(pool_free)
#define je_pool_malloc_usable_size JEMALLOC_N(pool_malloc_usable_size)
#define je_pool_malloc_stats_print JEMALLOC_N(pool_malloc_stats_print)
#define je_pool_extend JEMALLOC_N(pool_extend)
#define je_pool_set_alloc_funcs JEMALLOC_N(pool_set_alloc_funcs)
#define je_pool_check JEMALLOC_N(pool_check)
#define je_malloc_conf JEMALLOC_N(malloc_conf)
#define je_malloc_message JEMALLOC_N(malloc_message)
#define je_malloc JEMALLOC_N(malloc)
#define je_calloc JEMALLOC_N(calloc)
#define je_posix_memalign JEMALLOC_N(posix_memalign)
#define je_aligned_alloc JEMALLOC_N(aligned_alloc)
#define je_realloc JEMALLOC_N(realloc)
#define je_free JEMALLOC_N(free)
#define je_mallocx JEMALLOC_N(mallocx)
#define je_rallocx JEMALLOC_N(rallocx)
#define je_xallocx JEMALLOC_N(xallocx)
#define je_sallocx JEMALLOC_N(sallocx)
#define je_dallocx JEMALLOC_N(dallocx)
#define je_nallocx JEMALLOC_N(nallocx)
#define je_mallctl JEMALLOC_N(mallctl)
#define je_mallctlnametomib JEMALLOC_N(mallctlnametomib)
#define je_mallctlbymib JEMALLOC_N(mallctlbymib)
#define je_navsnprintf JEMALLOC_N(navsnprintf)
#define je_malloc_stats_print JEMALLOC_N(malloc_stats_print)
#define je_malloc_usable_size JEMALLOC_N(malloc_usable_size)
| 1,536 | 45.575758 | 70 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/jemalloc_gen/include/jemalloc/internal/jemalloc_internal.h
|
#ifndef JEMALLOC_INTERNAL_H
#define JEMALLOC_INTERNAL_H
#include "jemalloc_internal_defs.h"
#include "jemalloc/internal/jemalloc_internal_decls.h"
#ifdef JEMALLOC_UTRACE
#include <sys/ktrace.h>
#endif
#define JEMALLOC_NO_DEMANGLE
#ifdef JEMALLOC_JET
# define JEMALLOC_N(n) jet_##n
# include "jemalloc/internal/public_namespace.h"
# define JEMALLOC_NO_RENAME
# include "jemalloc/jemalloc.h"
# undef JEMALLOC_NO_RENAME
#else
# define JEMALLOC_N(n) je_vmem_je_##n
# include "jemalloc/jemalloc.h"
#endif
#include "jemalloc/internal/private_namespace.h"
static const bool config_debug =
#ifdef JEMALLOC_DEBUG
true
#else
false
#endif
;
static const bool have_dss =
#ifdef JEMALLOC_DSS
true
#else
false
#endif
;
static const bool config_fill =
#ifdef JEMALLOC_FILL
true
#else
false
#endif
;
static const bool config_lazy_lock =
#ifdef JEMALLOC_LAZY_LOCK
true
#else
false
#endif
;
static const bool config_prof =
#ifdef JEMALLOC_PROF
true
#else
false
#endif
;
static const bool config_prof_libgcc =
#ifdef JEMALLOC_PROF_LIBGCC
true
#else
false
#endif
;
static const bool config_prof_libunwind =
#ifdef JEMALLOC_PROF_LIBUNWIND
true
#else
false
#endif
;
static const bool config_munmap =
#ifdef JEMALLOC_MUNMAP
true
#else
false
#endif
;
static const bool config_stats =
#ifdef JEMALLOC_STATS
true
#else
false
#endif
;
static const bool config_tcache =
#ifdef JEMALLOC_TCACHE
true
#else
false
#endif
;
static const bool config_tls =
#ifdef JEMALLOC_TLS
true
#else
false
#endif
;
static const bool config_utrace =
#ifdef JEMALLOC_UTRACE
true
#else
false
#endif
;
static const bool config_valgrind =
#ifdef JEMALLOC_VALGRIND
true
#else
false
#endif
;
static const bool config_xmalloc =
#ifdef JEMALLOC_XMALLOC
true
#else
false
#endif
;
static const bool config_ivsalloc =
#ifdef JEMALLOC_IVSALLOC
true
#else
false
#endif
;
#ifdef JEMALLOC_ATOMIC9
#include <machine/atomic.h>
#endif
#if (defined(JEMALLOC_OSATOMIC) || defined(JEMALLOC_OSSPIN))
#include <libkern/OSAtomic.h>
#endif
#ifdef JEMALLOC_ZONE
#include <mach/mach_error.h>
#include <mach/mach_init.h>
#include <mach/vm_map.h>
#include <malloc/malloc.h>
#endif
#define RB_COMPACT
#include "jemalloc/internal/rb.h"
#include "jemalloc/internal/qr.h"
#include "jemalloc/internal/ql.h"
/*
* jemalloc can conceptually be broken into components (arena, tcache, etc.),
* but there are circular dependencies that cannot be broken without
* substantial performance degradation. In order to reduce the effect on
* visual code flow, read the header files in multiple passes, with one of the
* following cpp variables defined during each pass:
*
* JEMALLOC_H_TYPES : Preprocessor-defined constants and psuedo-opaque data
* types.
* JEMALLOC_H_STRUCTS : Data structures.
* JEMALLOC_H_EXTERNS : Extern data declarations and function prototypes.
* JEMALLOC_H_INLINES : Inline functions.
*/
/******************************************************************************/
#define JEMALLOC_H_TYPES
#include "jemalloc/internal/jemalloc_internal_macros.h"
#define MALLOCX_LG_ALIGN_MASK ((int)0x3f)
/* Smallest size class to support. */
#define LG_TINY_MIN 3
#define TINY_MIN (1U << LG_TINY_MIN)
/*
* Minimum alignment of allocations is 2^LG_QUANTUM bytes (ignoring tiny size
* classes).
*/
#ifndef LG_QUANTUM
# if (defined(__i386__) || defined(_M_IX86))
# define LG_QUANTUM 4
# endif
# ifdef __ia64__
# define LG_QUANTUM 4
# endif
# ifdef __alpha__
# define LG_QUANTUM 4
# endif
# ifdef __sparc64__
# define LG_QUANTUM 4
# endif
# if (defined(__amd64__) || defined(__x86_64__) || defined(_M_X64))
# define LG_QUANTUM 4
# endif
# ifdef __arm__
# define LG_QUANTUM 3
# endif
# ifdef __aarch64__
# define LG_QUANTUM 4
# endif
# ifdef __hppa__
# define LG_QUANTUM 4
# endif
# ifdef __mips__
# define LG_QUANTUM 3
# endif
# ifdef __powerpc__
# define LG_QUANTUM 4
# endif
# ifdef __s390__
# define LG_QUANTUM 4
# endif
# ifdef __SH4__
# define LG_QUANTUM 4
# endif
# ifdef __tile__
# define LG_QUANTUM 4
# endif
# ifdef __le32__
# define LG_QUANTUM 4
# endif
# ifndef LG_QUANTUM
# error "No LG_QUANTUM definition for architecture; specify via CPPFLAGS"
# endif
#endif
#define QUANTUM ((size_t)(1U << LG_QUANTUM))
#define QUANTUM_MASK (QUANTUM - 1)
/* Return the smallest quantum multiple that is >= a. */
#define QUANTUM_CEILING(a) \
(((a) + QUANTUM_MASK) & ~QUANTUM_MASK)
#define LONG ((size_t)(1U << LG_SIZEOF_LONG))
#define LONG_MASK (LONG - 1)
/* Return the smallest long multiple that is >= a. */
#define LONG_CEILING(a) \
(((a) + LONG_MASK) & ~LONG_MASK)
#define SIZEOF_PTR (1U << LG_SIZEOF_PTR)
#define PTR_MASK (SIZEOF_PTR - 1)
/* Return the smallest (void *) multiple that is >= a. */
#define PTR_CEILING(a) \
(((a) + PTR_MASK) & ~PTR_MASK)
/*
* Maximum size of L1 cache line. This is used to avoid cache line aliasing.
* In addition, this controls the spacing of cacheline-spaced size classes.
*
* CACHELINE cannot be based on LG_CACHELINE because __declspec(align()) can
* only handle raw constants.
*/
#define LG_CACHELINE 6
#define CACHELINE 64
#define CACHELINE_MASK (CACHELINE - 1)
/* Return the smallest cacheline multiple that is >= s. */
#define CACHELINE_CEILING(s) \
(((s) + CACHELINE_MASK) & ~CACHELINE_MASK)
/* Page size. STATIC_PAGE_SHIFT is determined by the configure script. */
#ifdef PAGE_MASK
# undef PAGE_MASK
#endif
#define LG_PAGE STATIC_PAGE_SHIFT
#define PAGE ((size_t)(1U << STATIC_PAGE_SHIFT))
#define PAGE_MASK ((size_t)(PAGE - 1))
/* Return the smallest pagesize multiple that is >= s. */
#define PAGE_CEILING(s) \
(((s) + PAGE_MASK) & ~PAGE_MASK)
/* Return the nearest aligned address at or below a. */
#define ALIGNMENT_ADDR2BASE(a, alignment) \
((void *)((uintptr_t)(a) & (-(alignment))))
/* Return the offset between a and the nearest aligned address at or below a. */
#define ALIGNMENT_ADDR2OFFSET(a, alignment) \
((size_t)((uintptr_t)(a) & ((alignment) - 1)))
/* Return the smallest alignment multiple that is >= s. */
#define ALIGNMENT_CEILING(s, alignment) \
(((s) + ((alignment) - 1)) & (-(alignment)))
/* Declare a variable length array */
#if __STDC_VERSION__ < 199901L
# ifdef _MSC_VER
# include <malloc.h>
#ifndef alloca
# define alloca _alloca
#endif
# else
# ifdef JEMALLOC_HAS_ALLOCA_H
# include <alloca.h>
# else
# include <stdlib.h>
# endif
# endif
# define VARIABLE_ARRAY(type, name, count) \
type *name = alloca(sizeof(type) * (count))
#else
# define VARIABLE_ARRAY(type, name, count) type name[(count)]
#endif
#include "jemalloc/internal/valgrind.h"
#include "jemalloc/internal/util.h"
#include "jemalloc/internal/atomic.h"
#include "jemalloc/internal/prng.h"
#include "jemalloc/internal/ckh.h"
#include "jemalloc/internal/size_classes.h"
#include "jemalloc/internal/stats.h"
#include "jemalloc/internal/ctl.h"
#include "jemalloc/internal/mutex.h"
#include "jemalloc/internal/tsd.h"
#include "jemalloc/internal/mb.h"
#include "jemalloc/internal/extent.h"
#include "jemalloc/internal/arena.h"
#include "jemalloc/internal/bitmap.h"
#include "jemalloc/internal/base.h"
#include "jemalloc/internal/chunk.h"
#include "jemalloc/internal/huge.h"
#include "jemalloc/internal/rtree.h"
#include "jemalloc/internal/tcache.h"
#include "jemalloc/internal/hash.h"
#include "jemalloc/internal/quarantine.h"
#include "jemalloc/internal/prof.h"
#include "jemalloc/internal/pool.h"
#include "jemalloc/internal/vector.h"
#undef JEMALLOC_H_TYPES
/******************************************************************************/
#define JEMALLOC_H_STRUCTS
#include "jemalloc/internal/valgrind.h"
#include "jemalloc/internal/util.h"
#include "jemalloc/internal/atomic.h"
#include "jemalloc/internal/prng.h"
#include "jemalloc/internal/ckh.h"
#include "jemalloc/internal/size_classes.h"
#include "jemalloc/internal/stats.h"
#include "jemalloc/internal/ctl.h"
#include "jemalloc/internal/mutex.h"
#include "jemalloc/internal/tsd.h"
#include "jemalloc/internal/mb.h"
#include "jemalloc/internal/bitmap.h"
#include "jemalloc/internal/extent.h"
#include "jemalloc/internal/arena.h"
#include "jemalloc/internal/base.h"
#include "jemalloc/internal/chunk.h"
#include "jemalloc/internal/huge.h"
#include "jemalloc/internal/rtree.h"
#include "jemalloc/internal/tcache.h"
#include "jemalloc/internal/hash.h"
#include "jemalloc/internal/quarantine.h"
#include "jemalloc/internal/prof.h"
#include "jemalloc/internal/pool.h"
#include "jemalloc/internal/vector.h"
typedef struct {
uint64_t allocated;
uint64_t deallocated;
} thread_allocated_t;
/*
* The JEMALLOC_ARG_CONCAT() wrapper is necessary to pass {0, 0} via a cpp macro
* argument.
*/
#define THREAD_ALLOCATED_INITIALIZER JEMALLOC_ARG_CONCAT({0, 0})
#undef JEMALLOC_H_STRUCTS
/******************************************************************************/
#define JEMALLOC_H_EXTERNS
extern bool opt_abort;
extern bool opt_junk;
extern size_t opt_quarantine;
extern bool opt_redzone;
extern bool opt_utrace;
extern bool opt_xmalloc;
extern bool opt_zero;
extern size_t opt_narenas;
extern bool in_valgrind;
/* Number of CPUs. */
extern unsigned ncpus;
extern unsigned npools;
extern unsigned npools_cnt;
extern pool_t base_pool;
extern pool_t **pools;
extern malloc_mutex_t pools_lock;
extern void *(*base_malloc_fn)(size_t);
extern void (*base_free_fn)(void *);
extern bool pools_shared_data_create(void);
arena_t *arenas_extend(pool_t *pool, unsigned ind);
bool arenas_tsd_extend(tsd_pool_t *tsd, unsigned len);
void arenas_cleanup(void *arg);
arena_t *choose_arena_hard(pool_t *pool);
void jemalloc_prefork(void);
void jemalloc_postfork_parent(void);
void jemalloc_postfork_child(void);
#include "jemalloc/internal/valgrind.h"
#include "jemalloc/internal/util.h"
#include "jemalloc/internal/atomic.h"
#include "jemalloc/internal/prng.h"
#include "jemalloc/internal/ckh.h"
#include "jemalloc/internal/size_classes.h"
#include "jemalloc/internal/stats.h"
#include "jemalloc/internal/ctl.h"
#include "jemalloc/internal/mutex.h"
#include "jemalloc/internal/tsd.h"
#include "jemalloc/internal/mb.h"
#include "jemalloc/internal/bitmap.h"
#include "jemalloc/internal/extent.h"
#include "jemalloc/internal/arena.h"
#include "jemalloc/internal/base.h"
#include "jemalloc/internal/chunk.h"
#include "jemalloc/internal/huge.h"
#include "jemalloc/internal/rtree.h"
#include "jemalloc/internal/tcache.h"
#include "jemalloc/internal/hash.h"
#include "jemalloc/internal/quarantine.h"
#include "jemalloc/internal/prof.h"
#include "jemalloc/internal/pool.h"
#include "jemalloc/internal/vector.h"
#undef JEMALLOC_H_EXTERNS
/******************************************************************************/
#define JEMALLOC_H_INLINES
#include "jemalloc/internal/pool.h"
#include "jemalloc/internal/valgrind.h"
#include "jemalloc/internal/util.h"
#include "jemalloc/internal/atomic.h"
#include "jemalloc/internal/prng.h"
#include "jemalloc/internal/ckh.h"
#include "jemalloc/internal/size_classes.h"
#include "jemalloc/internal/stats.h"
#include "jemalloc/internal/ctl.h"
#include "jemalloc/internal/mutex.h"
#include "jemalloc/internal/tsd.h"
#include "jemalloc/internal/mb.h"
#include "jemalloc/internal/extent.h"
#include "jemalloc/internal/base.h"
#include "jemalloc/internal/chunk.h"
#include "jemalloc/internal/huge.h"
/*
* Include arena.h the first time in order to provide inline functions for this
* header's inlines.
*/
#define JEMALLOC_ARENA_INLINE_A
#include "jemalloc/internal/arena.h"
#undef JEMALLOC_ARENA_INLINE_A
#ifndef JEMALLOC_ENABLE_INLINE
malloc_tsd_protos(JEMALLOC_ATTR(unused), arenas, tsd_pool_t)
size_t s2u(size_t size);
size_t sa2u(size_t size, size_t alignment);
unsigned narenas_total_get(pool_t *pool);
arena_t *choose_arena(arena_t *arena);
#endif
#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_C_))
/*
* Map of pthread_self() --> arenas[???], used for selecting an arena to use
* for allocations.
*/
malloc_tsd_externs(arenas, tsd_pool_t)
malloc_tsd_funcs(JEMALLOC_ALWAYS_INLINE, arenas, tsd_pool_t, {0},
arenas_cleanup)
/*
* Check if the arena is dummy.
*/
JEMALLOC_ALWAYS_INLINE bool
is_arena_dummy(arena_t *arena) {
return (arena->ind == ARENA_DUMMY_IND);
}
/*
* Compute usable size that would result from allocating an object with the
* specified size.
*/
JEMALLOC_ALWAYS_INLINE size_t
s2u(size_t size)
{
if (size <= SMALL_MAXCLASS)
return (small_s2u(size));
if (size <= arena_maxclass)
return (PAGE_CEILING(size));
return (CHUNK_CEILING(size));
}
/*
* Compute usable size that would result from allocating an object with the
* specified size and alignment.
*/
JEMALLOC_ALWAYS_INLINE size_t
sa2u(size_t size, size_t alignment)
{
size_t usize;
assert(alignment != 0 && ((alignment - 1) & alignment) == 0);
/*
* Round size up to the nearest multiple of alignment.
*
* This done, we can take advantage of the fact that for each small
* size class, every object is aligned at the smallest power of two
* that is non-zero in the base two representation of the size. For
* example:
*
* Size | Base 2 | Minimum alignment
* -----+----------+------------------
* 96 | 1100000 | 32
* 144 | 10100000 | 32
* 192 | 11000000 | 64
*/
usize = ALIGNMENT_CEILING(size, alignment);
/*
* (usize < size) protects against the combination of maximal
* alignment and size greater than maximal alignment.
*/
if (usize < size) {
/* size_t overflow. */
return (0);
}
if (usize <= arena_maxclass && alignment <= PAGE) {
if (usize <= SMALL_MAXCLASS)
return (small_s2u(usize));
return (PAGE_CEILING(usize));
} else {
size_t run_size;
/*
* We can't achieve subpage alignment, so round up alignment
* permanently; it makes later calculations simpler.
*/
alignment = PAGE_CEILING(alignment);
usize = PAGE_CEILING(size);
/*
* (usize < size) protects against very large sizes within
* PAGE of SIZE_T_MAX.
*
* (usize + alignment < usize) protects against the
* combination of maximal alignment and usize large enough
* to cause overflow. This is similar to the first overflow
* check above, but it needs to be repeated due to the new
* usize value, which may now be *equal* to maximal
* alignment, whereas before we only detected overflow if the
* original size was *greater* than maximal alignment.
*/
if (usize < size || usize + alignment < usize) {
/* size_t overflow. */
return (0);
}
/*
* Calculate the size of the over-size run that arena_palloc()
* would need to allocate in order to guarantee the alignment.
* If the run wouldn't fit within a chunk, round up to a huge
* allocation size.
*/
run_size = usize + alignment - PAGE;
if (run_size <= arena_maxclass)
return (PAGE_CEILING(usize));
return (CHUNK_CEILING(usize));
}
}
JEMALLOC_INLINE unsigned
narenas_total_get(pool_t *pool)
{
unsigned narenas;
malloc_rwlock_rdlock(&pool->arenas_lock);
narenas = pool->narenas_total;
malloc_rwlock_unlock(&pool->arenas_lock);
return (narenas);
}
/*
* Choose an arena based on a per-thread value.
* Arena pointer must be either a valid arena pointer or a dummy arena with
* pool field filled.
*/
JEMALLOC_INLINE arena_t *
choose_arena(arena_t *arena)
{
arena_t *ret;
tsd_pool_t *tsd;
pool_t *pool;
if (!is_arena_dummy(arena))
return (arena);
pool = arena->pool;
tsd = arenas_tsd_get();
/* expand arenas array if necessary */
if ((tsd->npools <= pool->pool_id) &&
arenas_tsd_extend(tsd, pool->pool_id)) {
return (NULL);
}
if ( (tsd->seqno[pool->pool_id] != pool->seqno) ||
(ret = tsd->arenas[pool->pool_id]) == NULL) {
ret = choose_arena_hard(pool);
assert(ret != NULL);
}
return (ret);
}
#endif
#include "jemalloc/internal/bitmap.h"
#include "jemalloc/internal/rtree.h"
/*
* Include arena.h the second and third times in order to resolve circular
* dependencies with tcache.h.
*/
#define JEMALLOC_ARENA_INLINE_B
#include "jemalloc/internal/arena.h"
#undef JEMALLOC_ARENA_INLINE_B
#include "jemalloc/internal/tcache.h"
#define JEMALLOC_ARENA_INLINE_C
#include "jemalloc/internal/arena.h"
#undef JEMALLOC_ARENA_INLINE_C
#include "jemalloc/internal/hash.h"
#include "jemalloc/internal/quarantine.h"
#ifndef JEMALLOC_ENABLE_INLINE
void *imalloct(size_t size, bool try_tcache, arena_t *arena);
void *imalloc(size_t size);
void *pool_imalloc(pool_t *pool, size_t size);
void *icalloct(size_t size, bool try_tcache, arena_t *arena);
void *icalloc(size_t size);
void *pool_icalloc(pool_t *pool, size_t size);
void *ipalloct(size_t usize, size_t alignment, bool zero, bool try_tcache,
arena_t *arena);
void *ipalloc(size_t usize, size_t alignment, bool zero);
void *pool_ipalloc(pool_t *pool, size_t usize, size_t alignment, bool zero);
size_t isalloc(const void *ptr, bool demote);
size_t pool_isalloc(pool_t *pool, const void *ptr, bool demote);
size_t ivsalloc(const void *ptr, bool demote);
size_t u2rz(size_t usize);
size_t p2rz(const void *ptr);
void idalloct(void *ptr, bool try_tcache);
void pool_idalloct(pool_t *pool, void *ptr, bool try_tcache);
void idalloc(void *ptr);
void iqalloct(void *ptr, bool try_tcache);
void pool_iqalloct(pool_t *pool, void *ptr, bool try_tcache);
void iqalloc(void *ptr);
void *iralloct_realign(void *ptr, size_t oldsize, size_t size, size_t extra,
size_t alignment, bool zero, bool try_tcache_alloc, bool try_tcache_dalloc,
arena_t *arena);
void *iralloct(void *ptr, size_t size, size_t extra, size_t alignment,
bool zero, bool try_tcache_alloc, bool try_tcache_dalloc, arena_t *arena);
void *iralloc(void *ptr, size_t size, size_t extra, size_t alignment,
bool zero);
void *pool_iralloc(pool_t *pool, void *ptr, size_t size, size_t extra,
size_t alignment, bool zero);
bool ixalloc(void *ptr, size_t size, size_t extra, size_t alignment,
bool zero);
int msc_clz(unsigned int val);
malloc_tsd_protos(JEMALLOC_ATTR(unused), thread_allocated, thread_allocated_t)
#endif
#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_C_))
# ifdef _MSC_VER
JEMALLOC_ALWAYS_INLINE int
msc_clz(unsigned int val)
{
unsigned int res = 0;
# if LG_SIZEOF_INT == 2
if (_BitScanReverse(&res, val)) {
return 31 - res;
}
else {
return 32;
}
# elif LG_SIZEOF_INT == 3
if (_BitScanReverse64(&res, val)) {
return 63 - res;
}
else {
return 64;
}
# else
# error "Unsupported clz function for that size of int"
# endif
}
#endif
JEMALLOC_ALWAYS_INLINE void *
imalloct(size_t size, bool try_tcache, arena_t *arena)
{
assert(size != 0);
if (size <= arena_maxclass)
return (arena_malloc(arena, size, false, try_tcache));
else
return (huge_malloc(arena, size, false));
}
JEMALLOC_ALWAYS_INLINE void *
imalloc(size_t size)
{
arena_t dummy;
DUMMY_ARENA_INITIALIZE(dummy, &base_pool);
return (imalloct(size, true, &dummy));
}
JEMALLOC_ALWAYS_INLINE void *
pool_imalloc(pool_t *pool, size_t size)
{
arena_t dummy;
DUMMY_ARENA_INITIALIZE(dummy, pool);
return (imalloct(size, true, &dummy));
}
JEMALLOC_ALWAYS_INLINE void *
icalloct(size_t size, bool try_tcache, arena_t *arena)
{
if (size <= arena_maxclass)
return (arena_malloc(arena, size, true, try_tcache));
else
return (huge_malloc(arena, size, true));
}
JEMALLOC_ALWAYS_INLINE void *
icalloc(size_t size)
{
arena_t dummy;
DUMMY_ARENA_INITIALIZE(dummy, &base_pool);
return (icalloct(size, true, &dummy));
}
JEMALLOC_ALWAYS_INLINE void *
pool_icalloc(pool_t *pool, size_t size)
{
arena_t dummy;
DUMMY_ARENA_INITIALIZE(dummy, pool);
return (icalloct(size, true, &dummy));
}
JEMALLOC_ALWAYS_INLINE void *
ipalloct(size_t usize, size_t alignment, bool zero, bool try_tcache,
arena_t *arena)
{
void *ret;
assert(usize != 0);
assert(usize == sa2u(usize, alignment));
if (usize <= arena_maxclass && alignment <= PAGE)
ret = arena_malloc(arena, usize, zero, try_tcache);
else {
if (usize <= arena_maxclass) {
ret = arena_palloc(choose_arena(arena), usize,
alignment, zero);
} else if (alignment <= chunksize)
ret = huge_malloc(arena, usize, zero);
else
ret = huge_palloc(arena, usize, alignment, zero);
}
assert(ALIGNMENT_ADDR2BASE(ret, alignment) == ret);
return (ret);
}
JEMALLOC_ALWAYS_INLINE void *
ipalloc(size_t usize, size_t alignment, bool zero)
{
arena_t dummy;
DUMMY_ARENA_INITIALIZE(dummy, &base_pool);
return (ipalloct(usize, alignment, zero, true, &dummy));
}
JEMALLOC_ALWAYS_INLINE void *
pool_ipalloc(pool_t *pool, size_t usize, size_t alignment, bool zero)
{
arena_t dummy;
DUMMY_ARENA_INITIALIZE(dummy, pool);
return (ipalloct(usize, alignment, zero, true, &dummy));
}
/*
* Typical usage:
* void *ptr = [...]
* size_t sz = isalloc(ptr, config_prof);
*/
JEMALLOC_ALWAYS_INLINE size_t
isalloc(const void *ptr, bool demote)
{
size_t ret;
arena_chunk_t *chunk;
assert(ptr != NULL);
/* Demotion only makes sense if config_prof is true. */
assert(config_prof || demote == false);
chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr);
if (chunk != ptr)
ret = arena_salloc(ptr, demote);
else
ret = huge_salloc(ptr);
return (ret);
}
/*
* Typical usage:
* void *ptr = [...]
* size_t sz = isalloc(ptr, config_prof);
*/
JEMALLOC_ALWAYS_INLINE size_t
pool_isalloc(pool_t *pool, const void *ptr, bool demote)
{
size_t ret;
arena_chunk_t *chunk;
assert(ptr != NULL);
/* Demotion only makes sense if config_prof is true. */
assert(config_prof || demote == false);
chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr);
if (chunk != ptr)
ret = arena_salloc(ptr, demote);
else
ret = huge_pool_salloc(pool, ptr);
return (ret);
}
JEMALLOC_ALWAYS_INLINE size_t
ivsalloc(const void *ptr, bool demote)
{
size_t i;
malloc_mutex_lock(&pools_lock);
unsigned n = npools;
for (i = 0; i < n; ++i) {
pool_t *pool = pools[i];
if (pool == NULL)
continue;
/* Return 0 if ptr is not within a chunk managed by jemalloc. */
if (rtree_get(pool->chunks_rtree,
(uintptr_t)CHUNK_ADDR2BASE(ptr)) != 0)
break;
}
malloc_mutex_unlock(&pools_lock);
if (i == n)
return 0;
return (isalloc(ptr, demote));
}
JEMALLOC_INLINE size_t
u2rz(size_t usize)
{
size_t ret;
if (usize <= SMALL_MAXCLASS) {
size_t binind = small_size2bin(usize);
assert(binind < NBINS);
ret = arena_bin_info[binind].redzone_size;
} else
ret = 0;
return (ret);
}
JEMALLOC_INLINE size_t
p2rz(const void *ptr)
{
size_t usize = isalloc(ptr, false);
return (u2rz(usize));
}
JEMALLOC_ALWAYS_INLINE void
idalloct(void *ptr, bool try_tcache)
{
arena_chunk_t *chunk;
assert(ptr != NULL);
chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr);
if (chunk != ptr)
arena_dalloc(chunk, ptr, try_tcache);
else
huge_dalloc(&base_pool, ptr);
}
JEMALLOC_ALWAYS_INLINE void
pool_idalloct(pool_t *pool, void *ptr, bool try_tcache)
{
arena_chunk_t *chunk;
assert(ptr != NULL);
chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr);
if (chunk != ptr)
arena_dalloc(chunk, ptr, try_tcache);
else
huge_dalloc(pool, ptr);
}
JEMALLOC_ALWAYS_INLINE void
idalloc(void *ptr)
{
idalloct(ptr, true);
}
JEMALLOC_ALWAYS_INLINE void
iqalloct(void *ptr, bool try_tcache)
{
if (config_fill && opt_quarantine)
quarantine(ptr);
else
idalloct(ptr, try_tcache);
}
JEMALLOC_ALWAYS_INLINE void
pool_iqalloct(pool_t *pool, void *ptr, bool try_tcache)
{
if (config_fill && opt_quarantine)
quarantine(ptr);
else
pool_idalloct(pool, ptr, try_tcache);
}
JEMALLOC_ALWAYS_INLINE void
iqalloc(void *ptr)
{
iqalloct(ptr, true);
}
JEMALLOC_ALWAYS_INLINE void *
iralloct_realign(void *ptr, size_t oldsize, size_t size, size_t extra,
size_t alignment, bool zero, bool try_tcache_alloc, bool try_tcache_dalloc,
arena_t *arena)
{
void *p;
size_t usize, copysize;
usize = sa2u(size + extra, alignment);
if (usize == 0)
return (NULL);
p = ipalloct(usize, alignment, zero, try_tcache_alloc, arena);
if (p == NULL) {
if (extra == 0)
return (NULL);
/* Try again, without extra this time. */
usize = sa2u(size, alignment);
if (usize == 0)
return (NULL);
p = ipalloct(usize, alignment, zero, try_tcache_alloc, arena);
if (p == NULL)
return (NULL);
}
/*
* Copy at most size bytes (not size+extra), since the caller has no
* expectation that the extra bytes will be reliably preserved.
*/
copysize = (size < oldsize) ? size : oldsize;
memcpy(p, ptr, copysize);
pool_iqalloct(arena->pool, ptr, try_tcache_dalloc);
return (p);
}
JEMALLOC_ALWAYS_INLINE void *
iralloct(void *ptr, size_t size, size_t extra, size_t alignment, bool zero,
bool try_tcache_alloc, bool try_tcache_dalloc, arena_t *arena)
{
size_t oldsize;
assert(ptr != NULL);
assert(size != 0);
oldsize = isalloc(ptr, config_prof);
if (alignment != 0 && ((uintptr_t)ptr & ((uintptr_t)alignment-1))
!= 0) {
/*
* Existing object alignment is inadequate; allocate new space
* and copy.
*/
return (iralloct_realign(ptr, oldsize, size, extra, alignment,
zero, try_tcache_alloc, try_tcache_dalloc, arena));
}
if (size + extra <= arena_maxclass) {
void *ret;
ret = arena_ralloc(arena, ptr, oldsize, size, extra,
alignment, zero, try_tcache_alloc,
try_tcache_dalloc);
if ((ret != NULL) || (size + extra > oldsize))
return (ret);
if (oldsize > chunksize) {
size_t old_usize JEMALLOC_CC_SILENCE_INIT(0);
UNUSED size_t old_rzsize JEMALLOC_CC_SILENCE_INIT(0);
if (config_valgrind && in_valgrind) {
old_usize = isalloc(ptr, config_prof);
old_rzsize = config_prof ?
p2rz(ptr) : u2rz(old_usize);
}
ret = huge_ralloc(arena, ptr, oldsize, chunksize, 0,
alignment, zero, try_tcache_dalloc);
JEMALLOC_VALGRIND_REALLOC(true, ret, s2u(chunksize),
true, ptr, old_usize, old_rzsize, true, false);
if (ret != NULL) {
/* Now, it should succeed... */
return arena_ralloc(arena, ret, chunksize, size,
extra, alignment, zero, try_tcache_alloc,
try_tcache_dalloc);
}
}
return NULL;
} else {
return (huge_ralloc(arena, ptr, oldsize, size, extra,
alignment, zero, try_tcache_dalloc));
}
}
JEMALLOC_ALWAYS_INLINE void *
iralloc(void *ptr, size_t size, size_t extra, size_t alignment, bool zero)
{
arena_t dummy;
DUMMY_ARENA_INITIALIZE(dummy, &base_pool);
return (iralloct(ptr, size, extra, alignment, zero, true, true, &dummy));
}
JEMALLOC_ALWAYS_INLINE void *
pool_iralloc(pool_t *pool, void *ptr, size_t size, size_t extra,
size_t alignment, bool zero)
{
arena_t dummy;
DUMMY_ARENA_INITIALIZE(dummy, pool);
return (iralloct(ptr, size, extra, alignment, zero, true, true, &dummy));
}
JEMALLOC_ALWAYS_INLINE bool
ixalloc(void *ptr, size_t size, size_t extra, size_t alignment, bool zero)
{
size_t oldsize;
assert(ptr != NULL);
assert(size != 0);
oldsize = isalloc(ptr, config_prof);
if (alignment != 0 && ((uintptr_t)ptr & ((uintptr_t)alignment-1))
!= 0) {
/* Existing object alignment is inadequate. */
return (true);
}
if (size <= arena_maxclass)
return (arena_ralloc_no_move(ptr, oldsize, size, extra, zero));
else
return (huge_ralloc_no_move(&base_pool, ptr, oldsize, size, extra, zero));
}
malloc_tsd_externs(thread_allocated, thread_allocated_t)
malloc_tsd_funcs(JEMALLOC_ALWAYS_INLINE, thread_allocated, thread_allocated_t,
THREAD_ALLOCATED_INITIALIZER, malloc_tsd_no_cleanup)
#endif
#include "jemalloc/internal/prof.h"
#undef JEMALLOC_H_INLINES
#ifdef _WIN32
#define __builtin_clz(x) msc_clz(x)
#endif
/******************************************************************************/
#endif /* JEMALLOC_INTERNAL_H */
| 27,780 | 24.095754 | 80 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/jemalloc_gen/include/jemalloc/internal/private_unnamespace.h
|
#undef a0calloc
#undef a0free
#undef a0malloc
#undef arena_alloc_junk_small
#undef arena_bin_index
#undef arena_bin_info
#undef arena_boot
#undef arena_chunk_alloc_huge
#undef arena_chunk_dalloc_huge
#undef arena_dalloc
#undef arena_dalloc_bin
#undef arena_dalloc_bin_locked
#undef arena_dalloc_junk_large
#undef arena_dalloc_junk_small
#undef arena_dalloc_large
#undef arena_dalloc_large_locked
#undef arena_dalloc_small
#undef arena_dss_prec_get
#undef arena_dss_prec_set
#undef arena_malloc
#undef arena_malloc_large
#undef arena_malloc_small
#undef arena_mapbits_allocated_get
#undef arena_mapbits_binind_get
#undef arena_mapbits_dirty_get
#undef arena_mapbits_get
#undef arena_mapbits_large_binind_set
#undef arena_mapbits_large_get
#undef arena_mapbits_large_set
#undef arena_mapbits_large_size_get
#undef arena_mapbits_small_runind_get
#undef arena_mapbits_small_set
#undef arena_mapbits_unallocated_set
#undef arena_mapbits_unallocated_size_get
#undef arena_mapbits_unallocated_size_set
#undef arena_mapbits_unzeroed_get
#undef arena_mapbits_unzeroed_set
#undef arena_mapbitsp_get
#undef arena_mapbitsp_read
#undef arena_mapbitsp_write
#undef arena_mapelm_to_pageind
#undef arena_mapp_get
#undef arena_maxclass
#undef arena_new
#undef arena_palloc
#undef arena_postfork_child
#undef arena_postfork_parent
#undef arena_prefork
#undef arena_prof_accum
#undef arena_prof_accum_impl
#undef arena_prof_accum_locked
#undef arena_prof_ctx_get
#undef arena_prof_ctx_set
#undef arena_prof_promoted
#undef arena_ptr_small_binind_get
#undef arena_purge_all
#undef arena_quarantine_junk_small
#undef arena_ralloc
#undef arena_ralloc_junk_large
#undef arena_ralloc_no_move
#undef arena_redzone_corruption
#undef arena_run_regind
#undef arena_runs_avail_tree_iter
#undef arena_salloc
#undef arena_stats_merge
#undef arena_tcache_fill_small
#undef arenas
#undef pools
#undef arenas_booted
#undef arenas_cleanup
#undef arenas_extend
#undef arenas_initialized
#undef arenas_lock
#undef arenas_tls
#undef arenas_tsd
#undef arenas_tsd_boot
#undef arenas_tsd_cleanup_wrapper
#undef arenas_tsd_get
#undef arenas_tsd_get_wrapper
#undef arenas_tsd_init_head
#undef arenas_tsd_set
#undef atomic_add_u
#undef atomic_add_uint32
#undef atomic_add_uint64
#undef atomic_add_z
#undef atomic_sub_u
#undef atomic_sub_uint32
#undef atomic_sub_uint64
#undef atomic_sub_z
#undef base_alloc
#undef base_boot
#undef base_calloc
#undef base_free_fn
#undef base_malloc_fn
#undef base_node_alloc
#undef base_node_dalloc
#undef base_pool
#undef base_postfork_child
#undef base_postfork_parent
#undef base_prefork
#undef bitmap_full
#undef bitmap_get
#undef bitmap_info_init
#undef bitmap_info_ngroups
#undef bitmap_init
#undef bitmap_set
#undef bitmap_sfu
#undef bitmap_size
#undef bitmap_unset
#undef bt_init
#undef buferror
#undef choose_arena
#undef choose_arena_hard
#undef chunk_alloc_arena
#undef chunk_alloc_base
#undef chunk_alloc_default
#undef chunk_alloc_dss
#undef chunk_alloc_mmap
#undef chunk_global_boot
#undef chunk_boot
#undef chunk_dalloc_default
#undef chunk_dalloc_mmap
#undef chunk_dss_boot
#undef chunk_dss_postfork_child
#undef chunk_dss_postfork_parent
#undef chunk_dss_prec_get
#undef chunk_dss_prec_set
#undef chunk_dss_prefork
#undef chunk_in_dss
#undef chunk_npages
#undef chunk_postfork_child
#undef chunk_postfork_parent
#undef chunk_prefork
#undef chunk_unmap
#undef chunk_record
#undef chunks_mtx
#undef chunks_rtree
#undef chunksize
#undef chunksize_mask
#undef ckh_bucket_search
#undef ckh_count
#undef ckh_delete
#undef ckh_evict_reloc_insert
#undef ckh_insert
#undef ckh_isearch
#undef ckh_iter
#undef ckh_new
#undef ckh_pointer_hash
#undef ckh_pointer_keycomp
#undef ckh_rebuild
#undef ckh_remove
#undef ckh_search
#undef ckh_string_hash
#undef ckh_string_keycomp
#undef ckh_try_bucket_insert
#undef ckh_try_insert
#undef ctl_boot
#undef ctl_bymib
#undef ctl_byname
#undef ctl_nametomib
#undef ctl_postfork_child
#undef ctl_postfork_parent
#undef ctl_prefork
#undef dss_prec_names
#undef extent_tree_ad_first
#undef extent_tree_ad_insert
#undef extent_tree_ad_iter
#undef extent_tree_ad_iter_recurse
#undef extent_tree_ad_iter_start
#undef extent_tree_ad_last
#undef extent_tree_ad_new
#undef extent_tree_ad_next
#undef extent_tree_ad_nsearch
#undef extent_tree_ad_prev
#undef extent_tree_ad_psearch
#undef extent_tree_ad_remove
#undef extent_tree_ad_reverse_iter
#undef extent_tree_ad_reverse_iter_recurse
#undef extent_tree_ad_reverse_iter_start
#undef extent_tree_ad_search
#undef extent_tree_szad_first
#undef extent_tree_szad_insert
#undef extent_tree_szad_iter
#undef extent_tree_szad_iter_recurse
#undef extent_tree_szad_iter_start
#undef extent_tree_szad_last
#undef extent_tree_szad_new
#undef extent_tree_szad_next
#undef extent_tree_szad_nsearch
#undef extent_tree_szad_prev
#undef extent_tree_szad_psearch
#undef extent_tree_szad_remove
#undef extent_tree_szad_reverse_iter
#undef extent_tree_szad_reverse_iter_recurse
#undef extent_tree_szad_reverse_iter_start
#undef extent_tree_szad_search
#undef get_errno
#undef hash
#undef hash_fmix_32
#undef hash_fmix_64
#undef hash_get_block_32
#undef hash_get_block_64
#undef hash_rotl_32
#undef hash_rotl_64
#undef hash_x64_128
#undef hash_x86_128
#undef hash_x86_32
#undef huge_allocated
#undef huge_boot
#undef huge_dalloc
#undef huge_dalloc_junk
#undef huge_malloc
#undef huge_ndalloc
#undef huge_nmalloc
#undef huge_palloc
#undef huge_postfork_child
#undef huge_postfork_parent
#undef huge_prefork
#undef huge_prof_ctx_get
#undef huge_prof_ctx_set
#undef huge_ralloc
#undef huge_ralloc_no_move
#undef huge_salloc
#undef icalloc
#undef icalloct
#undef idalloc
#undef idalloct
#undef imalloc
#undef imalloct
#undef in_valgrind
#undef ipalloc
#undef ipalloct
#undef iqalloc
#undef iqalloct
#undef iralloc
#undef iralloct
#undef iralloct_realign
#undef isalloc
#undef isthreaded
#undef ivsalloc
#undef ixalloc
#undef jemalloc_postfork_child
#undef jemalloc_postfork_parent
#undef jemalloc_prefork
#undef lg_floor
#undef malloc_cprintf
#undef malloc_mutex_init
#undef malloc_mutex_lock
#undef malloc_mutex_postfork_child
#undef malloc_mutex_postfork_parent
#undef malloc_mutex_prefork
#undef malloc_mutex_unlock
#undef malloc_rwlock_init
#undef malloc_rwlock_postfork_child
#undef malloc_rwlock_postfork_parent
#undef malloc_rwlock_prefork
#undef malloc_rwlock_rdlock
#undef malloc_rwlock_wrlock
#undef malloc_rwlock_unlock
#undef malloc_rwlock_destroy
#undef malloc_printf
#undef malloc_snprintf
#undef malloc_strtoumax
#undef malloc_tsd_boot
#undef malloc_tsd_cleanup_register
#undef malloc_tsd_dalloc
#undef malloc_tsd_malloc
#undef malloc_tsd_no_cleanup
#undef malloc_vcprintf
#undef malloc_vsnprintf
#undef malloc_write
#undef map_bias
#undef mb_write
#undef mutex_boot
#undef narenas_auto
#undef narenas_total
#undef narenas_total_get
#undef ncpus
#undef nhbins
#undef npools
#undef npools_cnt
#undef opt_abort
#undef opt_dss
#undef opt_junk
#undef opt_lg_chunk
#undef opt_lg_dirty_mult
#undef opt_lg_prof_interval
#undef opt_lg_prof_sample
#undef opt_lg_tcache_max
#undef opt_narenas
#undef opt_prof
#undef opt_prof_accum
#undef opt_prof_active
#undef opt_prof_final
#undef opt_prof_gdump
#undef opt_prof_leak
#undef opt_prof_prefix
#undef opt_quarantine
#undef opt_redzone
#undef opt_stats_print
#undef opt_tcache
#undef opt_utrace
#undef opt_xmalloc
#undef opt_zero
#undef p2rz
#undef pages_purge
#undef pools_shared_data_initialized
#undef pow2_ceil
#undef prof_backtrace
#undef prof_boot0
#undef prof_boot1
#undef prof_boot2
#undef prof_bt_count
#undef prof_ctx_get
#undef prof_ctx_set
#undef prof_dump_open
#undef prof_free
#undef prof_gdump
#undef prof_idump
#undef prof_interval
#undef prof_lookup
#undef prof_malloc
#undef prof_malloc_record_object
#undef prof_mdump
#undef prof_postfork_child
#undef prof_postfork_parent
#undef prof_prefork
#undef prof_realloc
#undef prof_sample_accum_update
#undef prof_sample_threshold_update
#undef prof_tdata_booted
#undef prof_tdata_cleanup
#undef prof_tdata_get
#undef prof_tdata_init
#undef prof_tdata_initialized
#undef prof_tdata_tls
#undef prof_tdata_tsd
#undef prof_tdata_tsd_boot
#undef prof_tdata_tsd_cleanup_wrapper
#undef prof_tdata_tsd_get
#undef prof_tdata_tsd_get_wrapper
#undef prof_tdata_tsd_init_head
#undef prof_tdata_tsd_set
#undef quarantine
#undef quarantine_alloc_hook
#undef quarantine_boot
#undef quarantine_booted
#undef quarantine_cleanup
#undef quarantine_init
#undef quarantine_tls
#undef quarantine_tsd
#undef quarantine_tsd_boot
#undef quarantine_tsd_cleanup_wrapper
#undef quarantine_tsd_get
#undef quarantine_tsd_get_wrapper
#undef quarantine_tsd_init_head
#undef quarantine_tsd_set
#undef register_zone
#undef rtree_delete
#undef rtree_get
#undef rtree_get_locked
#undef rtree_new
#undef rtree_postfork_child
#undef rtree_postfork_parent
#undef rtree_prefork
#undef rtree_set
#undef s2u
#undef sa2u
#undef set_errno
#undef small_bin2size
#undef small_bin2size_compute
#undef small_bin2size_lookup
#undef small_bin2size_tab
#undef small_s2u
#undef small_s2u_compute
#undef small_s2u_lookup
#undef small_size2bin
#undef small_size2bin_compute
#undef small_size2bin_lookup
#undef small_size2bin_tab
#undef stats_cactive
#undef stats_cactive_add
#undef stats_cactive_get
#undef stats_cactive_sub
#undef stats_chunks
#undef stats_print
#undef tcache_alloc_easy
#undef tcache_alloc_large
#undef tcache_alloc_small
#undef tcache_alloc_small_hard
#undef tcache_arena_associate
#undef tcache_arena_dissociate
#undef tcache_bin_flush_large
#undef tcache_bin_flush_small
#undef tcache_bin_info
#undef tcache_boot0
#undef tcache_boot1
#undef tcache_booted
#undef tcache_create
#undef tcache_dalloc_large
#undef tcache_dalloc_small
#undef tcache_destroy
#undef tcache_enabled_booted
#undef tcache_enabled_get
#undef tcache_enabled_initialized
#undef tcache_enabled_set
#undef tcache_enabled_tls
#undef tcache_enabled_tsd
#undef tcache_enabled_tsd_boot
#undef tcache_enabled_tsd_cleanup_wrapper
#undef tcache_enabled_tsd_get
#undef tcache_enabled_tsd_get_wrapper
#undef tcache_enabled_tsd_init_head
#undef tcache_enabled_tsd_set
#undef tcache_event
#undef tcache_event_hard
#undef tcache_flush
#undef tcache_get
#undef tcache_get_hard
#undef tcache_initialized
#undef tcache_maxclass
#undef tcache_salloc
#undef tcache_stats_merge
#undef tcache_thread_cleanup
#undef tcache_tls
#undef tcache_tsd
#undef tcache_tsd_boot
#undef tcache_tsd_cleanup_wrapper
#undef tcache_tsd_get
#undef tcache_tsd_get_wrapper
#undef tcache_tsd_init_head
#undef tcache_tsd_set
#undef thread_allocated_booted
#undef thread_allocated_initialized
#undef thread_allocated_tls
#undef thread_allocated_tsd
#undef thread_allocated_tsd_boot
#undef thread_allocated_tsd_cleanup_wrapper
#undef thread_allocated_tsd_get
#undef thread_allocated_tsd_get_wrapper
#undef thread_allocated_tsd_init_head
#undef thread_allocated_tsd_set
#undef tsd_init_check_recursion
#undef tsd_init_finish
#undef u2rz
#undef valgrind_freelike_block
#undef valgrind_make_mem_defined
#undef valgrind_make_mem_noaccess
#undef valgrind_make_mem_undefined
#undef pool_new
#undef pool_destroy
#undef pools_lock
#undef pool_base_lock
#undef pool_prefork
#undef pool_postfork_parent
#undef pool_postfork_child
#undef pool_alloc
#undef vec_get
#undef vec_set
#undef vec_delete
| 11,246 | 23.396963 | 44 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/include/err.h
|
/*
* Copyright 2016-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* err.h - error and warning messages
*/
#ifndef ERR_H
#define ERR_H 1
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
/*
* err - windows implementation of unix err function
*/
__declspec(noreturn) static void
err(int eval, const char *fmt, ...)
{
va_list vl;
va_start(vl, fmt);
vfprintf(stderr, fmt, vl);
va_end(vl);
exit(eval);
}
/*
* warn - windows implementation of unix warn function
*/
static void
warn(const char *fmt, ...)
{
va_list vl;
va_start(vl, fmt);
fprintf(stderr, "Warning: ");
vfprintf(stderr, fmt, vl);
va_end(vl);
}
#endif /* ERR_H */
| 2,190 | 29.859155 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/include/sched.h
|
/*
* Copyright 2017, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* fake sched.h
*/
| 1,620 | 44.027778 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/include/win_mmap.h
|
/*
* Copyright 2015-2018, Intel Corporation
* Copyright (c) 2016, Microsoft Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* win_mmap.h -- (internal) tracks the regions mapped by mmap
*/
#ifndef WIN_MMAP_H
#define WIN_MMAP_H 1
#include "queue.h"
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
#define rounddown(x, y) (((x) / (y)) * (y))
void win_mmap_init(void);
void win_mmap_fini(void);
/* allocation/mmap granularity */
extern unsigned long long Mmap_align;
typedef enum FILE_MAPPING_TRACKER_FLAGS {
FILE_MAPPING_TRACKER_FLAG_DIRECT_MAPPED = 0x0001,
/*
* This should hold the value of all flags ORed for debug purpose.
*/
FILE_MAPPING_TRACKER_FLAGS_MASK =
FILE_MAPPING_TRACKER_FLAG_DIRECT_MAPPED
} FILE_MAPPING_TRACKER_FLAGS;
/*
* this structure tracks the file mappings outstanding per file handle
*/
typedef struct FILE_MAPPING_TRACKER {
SORTEDQ_ENTRY(FILE_MAPPING_TRACKER) ListEntry;
HANDLE FileHandle;
HANDLE FileMappingHandle;
void *BaseAddress;
void *EndAddress;
DWORD Access;
os_off_t Offset;
size_t FileLen;
FILE_MAPPING_TRACKER_FLAGS Flags;
} FILE_MAPPING_TRACKER, *PFILE_MAPPING_TRACKER;
extern SRWLOCK FileMappingQLock;
extern SORTEDQ_HEAD(FMLHead, FILE_MAPPING_TRACKER) FileMappingQHead;
#endif /* WIN_MMAP_H */
| 2,817 | 33.790123 | 74 |
h
|
null |
NearPMSW-main/nearpmMDsync/checkpointing/redis-NDP-chekpoint/deps/pmdk/src/windows/include/platform.h
|
/*
* Copyright 2015-2018, Intel Corporation
* Copyright (c) 2016, Microsoft Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* platform.h -- dirty hacks to compile Linux code on Windows using VC++
*
* This is included to each source file using "/FI" (forced include) option.
*
* XXX - it is a subject for refactoring
*/
#ifndef PLATFORM_H
#define PLATFORM_H 1
#pragma warning(disable : 4996)
#pragma warning(disable : 4200) /* allow flexible array member */
#pragma warning(disable : 4819) /* non unicode characteres */
#ifdef __cplusplus
extern "C" {
#endif
/* Prevent PMDK compilation for 32-bit platforms */
#if defined(_WIN32) && !defined(_WIN64)
#error "32-bit builds of PMDK are not supported!"
#endif
#define _CRT_RAND_S /* rand_s() */
#include <windows.h>
#include <stdint.h>
#include <time.h>
#include <io.h>
#include <process.h>
#include <fcntl.h>
#include <sys/types.h>
#include <malloc.h>
#include <signal.h>
#include <intrin.h>
#include <direct.h>
/* use uuid_t definition from util.h */
#ifdef uuid_t
#undef uuid_t
#endif
/* a few trivial substitutions */
#define PATH_MAX MAX_PATH
#define __thread __declspec(thread)
#define __func__ __FUNCTION__
#ifdef _DEBUG
#define DEBUG
#endif
/*
* The inline keyword is available only in VC++.
* https://msdn.microsoft.com/en-us/library/bw1hbe6y.aspx
*/
#ifndef __cplusplus
#define inline __inline
#endif
/* XXX - no equivalents in VC++ */
#define __attribute__(a)
#define __builtin_constant_p(cnd) 0
/*
* missing definitions
*/
/* errno.h */
#define ELIBACC 79 /* cannot access a needed shared library */
/* sys/stat.h */
#define S_IRUSR S_IREAD
#define S_IWUSR S_IWRITE
#define S_IRGRP S_IRUSR
#define S_IWGRP S_IWUSR
#define O_SYNC 0
typedef int mode_t;
#define fchmod(fd, mode) 0 /* XXX - dummy */
#define setlinebuf(fp) setvbuf(fp, NULL, _IOLBF, BUFSIZ);
/* unistd.h */
typedef long long os_off_t;
typedef long long ssize_t;
int setenv(const char *name, const char *value, int overwrite);
int unsetenv(const char *name);
/* fcntl.h */
int posix_fallocate(int fd, os_off_t offset, os_off_t len);
/* string.h */
#define strtok_r strtok_s
/* time.h */
#define CLOCK_MONOTONIC 1
#define CLOCK_REALTIME 2
int clock_gettime(int id, struct timespec *ts);
/* signal.h */
typedef unsigned long long sigset_t; /* one bit for each signal */
C_ASSERT(NSIG <= sizeof(sigset_t) * 8);
struct sigaction {
void (*sa_handler) (int signum);
/* void (*sa_sigaction)(int, siginfo_t *, void *); */
sigset_t sa_mask;
int sa_flags;
void (*sa_restorer) (void);
};
__inline int
sigemptyset(sigset_t *set)
{
*set = 0;
return 0;
}
__inline int
sigfillset(sigset_t *set)
{
*set = ~0;
return 0;
}
__inline int
sigaddset(sigset_t *set, int signum)
{
if (signum <= 0 || signum >= NSIG) {
errno = EINVAL;
return -1;
}
*set |= (1ULL << (signum - 1));
return 0;
}
__inline int
sigdelset(sigset_t *set, int signum)
{
if (signum <= 0 || signum >= NSIG) {
errno = EINVAL;
return -1;
}
*set &= ~(1ULL << (signum - 1));
return 0;
}
__inline int
sigismember(const sigset_t *set, int signum)
{
if (signum <= 0 || signum >= NSIG) {
errno = EINVAL;
return -1;
}
return ((*set & (1ULL << (signum - 1))) ? 1 : 0);
}
/* sched.h */
/*
* sched_yield -- yield the processor
*/
__inline int
sched_yield(void)
{
SwitchToThread();
return 0; /* always succeeds */
}
/*
* helper macros for library ctor/dtor function declarations
*/
#define MSVC_CONSTR(func) \
void func(void); \
__pragma(comment(linker, "/include:_" #func)) \
__pragma(section(".CRT$XCU", read)) \
__declspec(allocate(".CRT$XCU")) \
const void (WINAPI *_##func)(void) = (const void (WINAPI *)(void))func;
#define MSVC_DESTR(func) \
void func(void); \
static void _##func##_reg(void) { atexit(func); }; \
MSVC_CONSTR(_##func##_reg)
#ifdef __cplusplus
}
#endif
#endif /* PLATFORM_H */
| 5,389 | 22.744493 | 76 |
h
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.