view release on metacpan or search on metacpan
lib/Alien/Judy.pm view on Meta::CPAN
# ABSTRACT: A wrapper for installing the Judy library
use strict;
use warnings;
use vars qw( $VERSION $DEBUG $HANDLE );
use Config ();
use Cwd ();
use File::Spec ();
use DynaLoader ();
# This module allows users to import its three public functions
# inc_dirs(), lib_dirs(), and dl_load_libjudy().
use Sub::Exporter -setup => {
exports => [qw( inc_dirs lib_dirs dl_load_libjudy )]
};
# The provided functions inc_dirs() and lib_dirs() are currently
# identical. Initially, they weren't.
*lib_dirs = \&inc_dirs;
# TODO: add literate documentation
src/judy-1.0.5/COPYING view on Meta::CPAN
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
src/judy-1.0.5/COPYING view on Meta::CPAN
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
src/judy-1.0.5/aclocal.m4 view on Meta::CPAN
dnl not a library. It's possible we should let each
dnl tag define a new lt_????_link_test_code variable,
dnl but it's only used here...
ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
int a;
void foo (void) { a = 0; }
EOF
],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
class Foo
{
public:
Foo (void) { a = 0; }
private:
int a;
};
EOF
],[$1],[F77],[cat > conftest.$ac_ext <<EOF
subroutine foo
implicit none
integer*4 a
a=0
return
end
EOF
],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
public class foo {
private int a;
public void bar (void) {
a = 0;
}
};
EOF
])
dnl Parse the compiler output and extract the necessary
dnl objects, libraries and library flags.
if AC_TRY_EVAL(ac_compile); then
# Parse the compiler output and extract the necessary
# objects, libraries and library flags.
src/judy-1.0.5/aclocal.m4 view on Meta::CPAN
ac_ext=java
# Object file extension for compiled Java test sources.
objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
lt_simple_compile_test_code="class foo {}\n"
# Code to be used in simple link tests
lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_AC_SYS_COMPILER
# save warnings/boilerplate of simple test code
_LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
lt_save_CC="$CC"
src/judy-1.0.5/autom4te.cache/output.0 view on Meta::CPAN
LD_CXX="$LD"
## CAVEAT EMPTOR:
## There is no encapsulation within the following macros, do not change
## the running order or otherwise move them around unless you know exactly
## what you are doing...
cat > conftest.$ac_ext <<EOF
class Foo
{
public:
Foo (void) { a = 0; }
private:
int a;
};
EOF
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
src/judy-1.0.5/autom4te.cache/output.0 view on Meta::CPAN
ac_ext=java
# Object file extension for compiled Java test sources.
objext=o
objext_GCJ=$objext
# Code to be used in simple compile tests
lt_simple_compile_test_code="class foo {}\n"
# Code to be used in simple link tests
lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
# If no C compiler flags were specified, use CFLAGS.
LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
# Allow CC to be a program name with arguments.
src/judy-1.0.5/autom4te.cache/output.1 view on Meta::CPAN
echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
test "$ld_shlibs_CXX" = no && can_build_shared=no
GCC_CXX="$GXX"
LD_CXX="$LD"
cat > conftest.$ac_ext <<EOF
class Foo
{
public:
Foo (void) { a = 0; }
private:
int a;
};
EOF
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
src/judy-1.0.5/autom4te.cache/output.1 view on Meta::CPAN
ac_ext=java
# Object file extension for compiled Java test sources.
objext=o
objext_GCJ=$objext
# Code to be used in simple compile tests
lt_simple_compile_test_code="class foo {}\n"
# Code to be used in simple link tests
lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
# If no C compiler flags were specified, use CFLAGS.
LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
# Allow CC to be a program name with arguments.
src/judy-1.0.5/autom4te.cache/traces.0 view on Meta::CPAN
dnl not a library. It's possible we should let each
dnl tag define a new lt_????_link_test_code variable,
dnl but it's only used here...
ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
int a;
void foo (void) { a = 0; }
EOF
],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
class Foo
{
public:
Foo (void) { a = 0; }
private:
int a;
};
EOF
],[$1],[F77],[cat > conftest.$ac_ext <<EOF
subroutine foo
implicit none
integer*4 a
a=0
return
end
EOF
],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
public class foo {
private int a;
public void bar (void) {
a = 0;
}
};
EOF
])
dnl Parse the compiler output and extract the necessary
dnl objects, libraries and library flags.
if AC_TRY_EVAL(ac_compile); then
# Parse the compiler output and extract the necessary
# objects, libraries and library flags.
src/judy-1.0.5/autom4te.cache/traces.0 view on Meta::CPAN
ac_ext=java
# Object file extension for compiled Java test sources.
objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
lt_simple_compile_test_code="class foo {}\n"
# Code to be used in simple link tests
lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_AC_SYS_COMPILER
# save warnings/boilerplate of simple test code
_LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
lt_save_CC="$CC"
src/judy-1.0.5/configure view on Meta::CPAN
echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
test "$ld_shlibs_CXX" = no && can_build_shared=no
GCC_CXX="$GXX"
LD_CXX="$LD"
cat > conftest.$ac_ext <<EOF
class Foo
{
public:
Foo (void) { a = 0; }
private:
int a;
};
EOF
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
src/judy-1.0.5/configure view on Meta::CPAN
ac_ext=java
# Object file extension for compiled Java test sources.
objext=o
objext_GCJ=$objext
# Code to be used in simple compile tests
lt_simple_compile_test_code="class foo {}\n"
# Code to be used in simple link tests
lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
# If no C compiler flags were specified, use CFLAGS.
LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
# Allow CC to be a program name with arguments.
src/judy-1.0.5/install-sh view on Meta::CPAN
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
src/judy-1.0.5/test/malloc-pre2.8a.c view on Meta::CPAN
only those chunks bordering topmost memory from being placed in
fastbins.
*/
#ifndef TRIM_FASTBINS
#define TRIM_FASTBINS 0
#endif
/*
USE_DL_PREFIX will prefix all public routines with the string 'dl'.
This is necessary when you only want to use this malloc in one part
of a program, using your regular system malloc elsewhere.
*/
/* #define USE_DL_PREFIX */
/*
USE_MALLOC_LOCK causes wrapper functions to surround each
callable routine with pthread mutex lock/unlock.
USE_MALLOC_LOCK forces USE_PUBLIC_MALLOC_WRAPPERS to be defined
*/
/* #define USE_MALLOC_LOCK */
/*
If USE_PUBLIC_MALLOC_WRAPPERS is defined, every public routine is
actually a wrapper function that first calls MALLOC_PREACTION, then
calls the internal routine, and follows it with
MALLOC_POSTACTION. This is needed for locking, but you can also use
this, without USE_MALLOC_LOCK, for purposes of interception,
instrumentation, etc. It is a sad fact that using wrappers often
noticeably degrades performance of malloc-intensive programs.
*/
#ifdef USE_MALLOC_LOCK
#define USE_PUBLIC_MALLOC_WRAPPERS
#else
/* #define USE_PUBLIC_MALLOC_WRAPPERS */
#endif
/*
Two-phase name translation.
All of the actual routines are given mangled names.
When wrappers are used, they become the public callable versions.
When DL_PREFIX is used, the callable names are prefixed.
*/
#ifndef USE_PUBLIC_MALLOC_WRAPPERS
#define cALLOc public_cALLOc
#define fREe public_fREe
#define cFREe public_cFREe
#define mALLOc public_mALLOc
#define mEMALIGn public_mEMALIGn
#define rEALLOc public_rEALLOc
#define vALLOc public_vALLOc
#define pVALLOc public_pVALLOc
#define mALLINFo public_mALLINFo
#define mALLOPt public_mALLOPt
#define mTRIm public_mTRIm
#define mSTATs public_mSTATs
#define mUSABLe public_mUSABLe
#define iCALLOc public_iCALLOc
#define iCOMALLOc public_iCOMALLOc
#endif
#ifdef USE_DL_PREFIX
#define public_cALLOc dlcalloc
#define public_fREe dlfree
#define public_cFREe dlcfree
#define public_mALLOc dlmalloc
#define public_mEMALIGn dlmemalign
#define public_rEALLOc dlrealloc
#define public_vALLOc dlvalloc
#define public_pVALLOc dlpvalloc
#define public_mALLINFo dlmallinfo
#define public_mALLOPt dlmallopt
#define public_mTRIm dlmalloc_trim
#define public_mSTATs dlmalloc_stats
#define public_mUSABLe dlmalloc_usable_size
#define public_iCALLOc dlindependent_calloc
#define public_iCOMALLOc dlindependent_comalloc
#else /* USE_DL_PREFIX */
#define public_cALLOc calloc
#define public_fREe free
#define public_cFREe cfree
#define public_mALLOc malloc
#define public_mEMALIGn memalign
#define public_rEALLOc realloc
#define public_vALLOc valloc
#define public_pVALLOc pvalloc
#define public_mALLINFo mallinfo
#define public_mALLOPt mallopt
#define public_mTRIm malloc_trim
#define public_mSTATs malloc_stats
#define public_mUSABLe malloc_usable_size
#define public_iCALLOc independent_calloc
#define public_iCOMALLOc independent_comalloc
#endif /* USE_DL_PREFIX */
/*
HAVE_MEMCPY should be defined if you are not otherwise using
ANSI STD C, but still have memcpy and memset in your C library
and want to use them in calloc and realloc. Otherwise simple
macro versions are defined below.
USE_MEMCPY should be defined as 1 if you actually want to
src/judy-1.0.5/test/malloc-pre2.8a.c view on Meta::CPAN
/*
SVID/XPG defines four standard parameter numbers for mallopt,
normally defined in malloc.h. Only one of these (M_MXFAST) is used
in this malloc. The others (M_NLBLKS, M_GRAIN, M_KEEP) don't apply,
so setting them has no effect. But this malloc also supports other
options in mallopt described below.
*/
#endif
/* ---------- description of public routines ------------ */
/*
malloc(size_t n)
Returns a pointer to a newly allocated chunk of at least n bytes, or null
if no space is available. Additionally, on failure, errno is
set to ENOMEM on ANSI C systems.
If n is zero, malloc returns a minumum-sized chunk. (The minimum
size is 16 bytes on most 32bit systems, and 24 or 32 bytes on 64bit
systems.) On most systems, size_t is an unsigned type, so calls
with negative arguments are interpreted as requests for huge amounts
of space, which will often fail. The maximum supported value of n
differs across systems, but is in all cases less than the maximum
representable value of a size_t.
*/
Void_t* public_mALLOc(size_t);
/*
free(Void_t* p)
Releases the chunk of memory pointed to by p, that had been previously
allocated using malloc or a related routine such as realloc.
It has no effect if p is null. It can have arbitrary (i.e., bad!)
effects if p has already been freed.
Unless disabled (using mallopt), freeing very large spaces will
when possible, automatically trigger operations that give
back unused memory to the system, thus reducing program footprint.
*/
void public_fREe(Void_t*);
/*
calloc(size_t n_elements, size_t element_size);
Returns a pointer to n_elements * element_size bytes, with all locations
set to zero.
*/
Void_t* public_cALLOc(size_t, size_t);
/*
realloc(Void_t* p, size_t n)
Returns a pointer to a chunk of size n that contains the same data
as does chunk p up to the minimum of (n, p's size) bytes, or null
if no space is available.
The returned pointer may or may not be the same as p. The algorithm
prefers extending p when possible, otherwise it employs the
equivalent of a malloc-copy-free sequence.
src/judy-1.0.5/test/malloc-pre2.8a.c view on Meta::CPAN
zero (re)allocates a minimum-sized chunk.
Large chunks that were internally obtained via mmap will always
be reallocated using malloc-copy-free sequences unless
the system supports MREMAP (currently only linux).
The old unix realloc convention of allowing the last-free'd chunk
to be used as an argument to realloc is not supported.
*/
Void_t* public_rEALLOc(Void_t*, size_t);
/*
memalign(size_t alignment, size_t n);
Returns a pointer to a newly allocated chunk of n bytes, aligned
in accord with the alignment argument.
The alignment argument should be a power of two. If the argument is
not a power of two, the nearest greater power is used.
8-byte alignment is guaranteed by normal malloc calls, so don't
bother calling memalign with an argument of 8 or less.
Overreliance on memalign is a sure way to fragment space.
*/
Void_t* public_mEMALIGn(size_t, size_t);
/*
valloc(size_t n);
Equivalent to memalign(pagesize, n), where pagesize is the page
size of the system. If the pagesize is unknown, 4096 is used.
*/
Void_t* public_vALLOc(size_t);
/*
mallopt(int parameter_number, int parameter_value)
Sets tunable parameters The format is to provide a
(parameter-number, parameter-value) pair. mallopt then sets the
corresponding parameter to the argument value if it can (i.e., so
long as the value is meaningful), and returns 1 if successful else
0. SVID/XPG/ANSI defines four standard param numbers for mallopt,
normally defined in malloc.h. Only one of these (M_MXFAST) is used
src/judy-1.0.5/test/malloc-pre2.8a.c view on Meta::CPAN
parameters are as follows (listed defaults are for "typical"
configurations).
Symbol param # default allowed param values
M_MXFAST 1 64 0-64 (0 disables fastbins)
M_TRIM_THRESHOLD -1 256*1024 any (-1U disables trimming)
M_TOP_PAD -2 0 any
M_MMAP_THRESHOLD -3 256*1024 any (or 0 if no MMAP support)
M_MMAP_MAX -4 65536 any (0 disables use of mmap)
*/
int public_mALLOPt(int, int);
/*
mallinfo()
Returns (by copy) a struct containing various summary statistics:
arena: current total non-mmapped bytes allocated from system
ordblks: the number of free chunks
smblks: the number of fastbin blocks (i.e., small chunks that
have been freed but not use resused or consolidated)
src/judy-1.0.5/test/malloc-pre2.8a.c view on Meta::CPAN
uordblks: current total allocated space (normal or mmapped)
fordblks: total free space
keepcost: the maximum number of bytes that could ideally be released
back to system via malloc_trim. ("ideally" means that
it ignores page restrictions etc.)
Because these fields are ints, but internal bookkeeping may
be kept as longs, the reported values may wrap around zero and
thus be inaccurate.
*/
struct mallinfo public_mALLINFo(void);
/*
independent_calloc(size_t n_elements, size_t element_size, Void_t* chunks[]);
independent_calloc is similar to calloc, but instead of returning a
single cleared space, it returns an array of pointers to n_elements
independent elements that can hold contents of size elem_size, each
of which starts out cleared, and can be independently freed,
realloc'ed etc. The elements are guaranteed to be adjacently
allocated (this is not guaranteed to occur with multiple callocs or
src/judy-1.0.5/test/malloc-pre2.8a.c view on Meta::CPAN
pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0);
if (pool == 0) die();
// organize into a linked list...
struct Node* first = pool[0];
for (i = 0; i < n-1; ++i)
pool[i]->next = pool[i+1];
free(pool); // Can now free the array (or not, if it is needed later)
return first;
}
*/
Void_t** public_iCALLOc(size_t, size_t, Void_t**);
/*
independent_comalloc(size_t n_elements, size_t sizes[], Void_t* chunks[]);
independent_comalloc allocates, all at once, a set of n_elements
chunks with sizes indicated in the "sizes" array. It returns
an array of pointers to these elements, each of which can be
independently freed, realloc'ed etc. The elements are guaranteed to
be adjacently allocated (this is not guaranteed to occur with
multiple callocs or mallocs), which may also improve cache locality
src/judy-1.0.5/test/malloc-pre2.8a.c view on Meta::CPAN
}
In general though, independent_comalloc is worth using only for
larger values of n_elements. For small values, you probably won't
detect enough difference from series of malloc calls to bother.
Overuse of independent_comalloc can increase overall memory usage,
since it cannot reuse existing noncontiguous small chunks that
might be available for some of the elements.
*/
Void_t** public_iCOMALLOc(size_t, size_t*, Void_t**);
/*
pvalloc(size_t n);
Equivalent to valloc(minimum-page-that-holds(n)), that is,
round up n to nearest pagesize.
*/
Void_t* public_pVALLOc(size_t);
/*
cfree(Void_t* p);
Equivalent to free(p).
cfree is needed/defined on some systems that pair it with calloc,
for odd historical reasons (such as: cfree is used in example
code in the first edition of K&R).
*/
void public_cFREe(Void_t*);
/*
malloc_trim(size_t pad);
If possible, gives memory back to the system (via negative
arguments to sbrk) if there is unused memory at the `high' end of
the malloc pool. You can call this after freeing large blocks of
memory to potentially reduce the system-level memory requirements
of a program. However, it cannot guarantee to reduce memory. Under
some allocation patterns, some large free blocks of memory will be
src/judy-1.0.5/test/malloc-pre2.8a.c view on Meta::CPAN
only the minimum amount of memory to maintain internal data
structures will be left (one page or less). Non-zero arguments
can be supplied to maintain enough trailing space to service
future expected allocations without having to re-obtain memory
from the system.
Malloc_trim returns 1 if it actually released any memory, else 0.
On systems that do not support "negative sbrks", it will always
rreturn 0.
*/
int public_mTRIm(size_t);
/*
malloc_usable_size(Void_t* p);
Returns the number of bytes you can actually use in
an allocated chunk, which may be more than you requested (although
often not) due to alignment and minimum size constraints.
You can use this many bytes without worrying about
overwriting other allocated objects. This is not a particularly great
programming practice. malloc_usable_size can be more useful in
debugging and assertions, for example:
p = malloc(n);
assert(malloc_usable_size(p) >= 256);
*/
size_t public_mUSABLe(Void_t*);
/*
malloc_stats();
Prints on stderr the amount of space obtained from the system (both
via sbrk and mmap), the maximum amount (which may be more than
current if malloc_trim and/or munmap got called), and the current
number of bytes allocated via malloc (or realloc, etc) but not yet
freed. Note that this is the number of bytes allocated, not the
number requested. It will be larger than the number requested
because of alignment and bookkeeping overhead. Because it includes
src/judy-1.0.5/test/malloc-pre2.8a.c view on Meta::CPAN
zero even when no user-level chunks are allocated.
The reported current and maximum system memory can be inaccurate if
a program makes other calls to system memory allocation functions
(normally sbrk) outside of malloc.
malloc_stats prints only the most commonly interesting statistics.
More information can be obtained by calling mallinfo.
*/
void public_mSTATs();
/* mallopt tuning options */
/*
M_MXFAST is the maximum request size used for "fastbins", special bins
that hold returned chunks without consolidating their spaces. This
enables future requests for chunks of the same size to be handled
very quickly, but can increase fragmentation, and thus increase the
overall memory footprint of a program.
src/judy-1.0.5/test/malloc-pre2.8a.c view on Meta::CPAN
/*
========================================================================
To make a fully customizable malloc.h header file, cut everything
above this line, put into file malloc.h, edit to suit, and #include it
on the next line, as well as in programs that use this malloc.
========================================================================
*/
/* #include "malloc.h" */
/* --------------------- public wrappers ---------------------- */
#ifdef USE_PUBLIC_MALLOC_WRAPPERS
/* Declare all routines as internal */
static Void_t* mALLOc(size_t);
static void fREe(Void_t*);
static Void_t* rEALLOc(Void_t*, size_t);
static Void_t* mEMALIGn(size_t, size_t);
static Void_t* vALLOc(size_t);
static Void_t* pVALLOc(size_t);
src/judy-1.0.5/test/malloc-pre2.8a.c view on Meta::CPAN
#else
/* Substitute anything you like for these */
#define MALLOC_PREACTION (0)
#define MALLOC_POSTACTION (0)
#endif
Void_t* public_mALLOc(size_t bytes) {
Void_t* m;
if (MALLOC_PREACTION != 0) {
return 0;
}
m = mALLOc(bytes);
if (MALLOC_POSTACTION != 0) {
}
return m;
}
void public_fREe(Void_t* m) {
if (MALLOC_PREACTION != 0) {
return;
}
fREe(m);
if (MALLOC_POSTACTION != 0) {
}
}
Void_t* public_rEALLOc(Void_t* m, size_t bytes) {
if (MALLOC_PREACTION != 0) {
return 0;
}
m = rEALLOc(m, bytes);
if (MALLOC_POSTACTION != 0) {
}
return m;
}
Void_t* public_mEMALIGn(size_t alignment, size_t bytes) {
Void_t* m;
if (MALLOC_PREACTION != 0) {
return 0;
}
m = mEMALIGn(alignment, bytes);
if (MALLOC_POSTACTION != 0) {
}
return m;
}
Void_t* public_vALLOc(size_t bytes) {
Void_t* m;
if (MALLOC_PREACTION != 0) {
return 0;
}
m = vALLOc(bytes);
if (MALLOC_POSTACTION != 0) {
}
return m;
}
Void_t* public_pVALLOc(size_t bytes) {
Void_t* m;
if (MALLOC_PREACTION != 0) {
return 0;
}
m = pVALLOc(bytes);
if (MALLOC_POSTACTION != 0) {
}
return m;
}
Void_t* public_cALLOc(size_t n, size_t elem_size) {
Void_t* m;
if (MALLOC_PREACTION != 0) {
return 0;
}
m = cALLOc(n, elem_size);
if (MALLOC_POSTACTION != 0) {
}
return m;
}
Void_t** public_iCALLOc(size_t n, size_t elem_size, Void_t** chunks) {
Void_t** m;
if (MALLOC_PREACTION != 0) {
return 0;
}
m = iCALLOc(n, elem_size, chunks);
if (MALLOC_POSTACTION != 0) {
}
return m;
}
Void_t** public_iCOMALLOc(size_t n, size_t sizes[], Void_t** chunks) {
Void_t** m;
if (MALLOC_PREACTION != 0) {
return 0;
}
m = iCOMALLOc(n, sizes, chunks);
if (MALLOC_POSTACTION != 0) {
}
return m;
}
void public_cFREe(Void_t* m) {
if (MALLOC_PREACTION != 0) {
return;
}
cFREe(m);
if (MALLOC_POSTACTION != 0) {
}
}
int public_mTRIm(size_t s) {
int result;
if (MALLOC_PREACTION != 0) {
return 0;
}
result = mTRIm(s);
if (MALLOC_POSTACTION != 0) {
}
return result;
}
size_t public_mUSABLe(Void_t* m) {
size_t result;
if (MALLOC_PREACTION != 0) {
return 0;
}
result = mUSABLe(m);
if (MALLOC_POSTACTION != 0) {
}
return result;
}
void public_mSTATs() {
if (MALLOC_PREACTION != 0) {
return;
}
mSTATs();
if (MALLOC_POSTACTION != 0) {
}
}
struct mallinfo public_mALLINFo() {
struct mallinfo m;
if (MALLOC_PREACTION != 0) {
struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
return nm;
}
m = mALLINFo();
if (MALLOC_POSTACTION != 0) {
}
return m;
}
int public_mALLOPt(int p, int v) {
int result;
if (MALLOC_PREACTION != 0) {
return 0;
}
result = mALLOPt(p, v);
if (MALLOC_POSTACTION != 0) {
}
return result;
}
src/judy-1.0.5/test/malloc-pre2.8a.c view on Meta::CPAN
malloc_state, you MUST explicitly zero-fill it before using. This
malloc relies on the property that malloc_state is initialized to
all zeroes (as is true of C statics).
*/
static struct malloc_state av_; /* never directly referenced */
/*
All uses of av_ are via get_malloc_state().
At most one "call" to get_malloc_state is made per invocation of
the public versions of malloc and free, but other routines
that in turn invoke malloc and/or free may call more then once.
Also, it is called in check* routines if DEBUG is set.
*/
#define get_malloc_state() (&(av_))
/*
Initialize a malloc_state struct. This is called only
in sysmalloc, to avoid it being inlined everywhere else,
which causes useless code bloat.
src/judy-1.0.5/test/malloc-pre2.8a.c view on Meta::CPAN
MALLOC_FAILURE_ACTION;
return 0;
}
/*
systrim is an inverse of sorts to sysmalloc. It gives memory back
to the system (via negative arguments to sbrk) if there is unused
memory at the `high' end of the malloc pool. It is called
automatically by free() when top space exceeds the trim
threshold. It is also called by the public malloc_trim routine. It
returns 1 if it actually released any memory, else 0.
*/
static int systrim(mstate av, size_t pad) {
long top_size; /* Amount of top-most memory */
long extra; /* Amount to release */
long released; /* Amount actually released */
char* current_brk; /* address returned by pre-check sbrk call */
char* new_brk; /* address returned by post-check sbrk call */
size_t pagesz;