forked from github/server
fixed compilation warnings caused by DLMALLOC
This commit is contained in:
parent
fde26f97ea
commit
db0d1f8948
3 changed files with 18 additions and 18 deletions
14
src/Jamrules
14
src/Jamrules
|
@ -4,11 +4,6 @@ LINK = gcc ;
|
||||||
|
|
||||||
MSPACES = 1 ;
|
MSPACES = 1 ;
|
||||||
|
|
||||||
if $(MSPACES) {
|
|
||||||
CCFLAGS += -DMSPACES ;
|
|
||||||
C++FLAGS += -DMSPACES ;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ! $(LUA_VERSION) {
|
if ! $(LUA_VERSION) {
|
||||||
LUA_VERSION = 5.0 ;
|
LUA_VERSION = 5.0 ;
|
||||||
}
|
}
|
||||||
|
@ -140,8 +135,8 @@ rule TargetDirectory
|
||||||
LOCATE_TARGET = $(ALL_LOCATE_TARGET) $(path) ;
|
LOCATE_TARGET = $(ALL_LOCATE_TARGET) $(path) ;
|
||||||
SOURCE_GRIST = $(path) ;
|
SOURCE_GRIST = $(path) ;
|
||||||
if $(DEBUG) = 1 {
|
if $(DEBUG) = 1 {
|
||||||
SubDirCcFlags -ggdb -DDEBUG=1 ;
|
SubDirCcFlags -ggdb ;
|
||||||
SubDirC++Flags -ggdb -DDEBUG=1 ;
|
SubDirC++Flags -ggdb ;
|
||||||
OPTIM = -O0 ;
|
OPTIM = -O0 ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -156,6 +151,11 @@ if ! $(DEBUG) {
|
||||||
DEBUG = 1 ;
|
DEBUG = 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $(MSPACES) {
|
||||||
|
CCFLAGS += -DMSPACES -DDL_DEBUG=$(DEBUG) ;
|
||||||
|
C++FLAGS += -DMSPACES -DDL_DEBUG=$(DEBUG) ;
|
||||||
|
}
|
||||||
|
|
||||||
if $(WITHOUT_LUA) {
|
if $(WITHOUT_LUA) {
|
||||||
ECHO Compiling without LUA ;
|
ECHO Compiling without LUA ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,7 +199,7 @@
|
||||||
USE_DL_PREFIX NOT defined
|
USE_DL_PREFIX NOT defined
|
||||||
USE_PUBLIC_MALLOC_WRAPPERS NOT defined
|
USE_PUBLIC_MALLOC_WRAPPERS NOT defined
|
||||||
USE_MALLOC_LOCK NOT defined
|
USE_MALLOC_LOCK NOT defined
|
||||||
DEBUG NOT defined
|
DL_DEBUG NOT defined
|
||||||
REALLOC_ZERO_BYTES_FREES NOT defined
|
REALLOC_ZERO_BYTES_FREES NOT defined
|
||||||
MALLOC_FAILURE_ACTION errno = ENOMEM, if __STD_C defined, else no-op
|
MALLOC_FAILURE_ACTION errno = ENOMEM, if __STD_C defined, else no-op
|
||||||
TRIM_FASTBINS 0
|
TRIM_FASTBINS 0
|
||||||
|
@ -338,27 +338,27 @@ extern "C" {
|
||||||
programs. This can be very effective (albeit in an annoying way)
|
programs. This can be very effective (albeit in an annoying way)
|
||||||
in helping track down dangling pointers.
|
in helping track down dangling pointers.
|
||||||
|
|
||||||
If you compile with -DDEBUG, a number of assertion checks are
|
If you compile with -DDL_DEBUG, a number of assertion checks are
|
||||||
enabled that will catch more memory errors. You probably won't be
|
enabled that will catch more memory errors. You probably won't be
|
||||||
able to make much sense of the actual assertion errors, but they
|
able to make much sense of the actual assertion errors, but they
|
||||||
should help you locate incorrectly overwritten memory. The
|
should help you locate incorrectly overwritten memory. The
|
||||||
checking is fairly extensive, and will slow down execution
|
checking is fairly extensive, and will slow down execution
|
||||||
noticeably. Calling malloc_stats or mallinfo with DEBUG set will
|
noticeably. Calling malloc_stats or mallinfo with DL_DEBUG set will
|
||||||
attempt to check every non-mmapped allocated and free chunk in the
|
attempt to check every non-mmapped allocated and free chunk in the
|
||||||
course of computing the summmaries. (By nature, mmapped regions
|
course of computing the summmaries. (By nature, mmapped regions
|
||||||
cannot be checked very much automatically.)
|
cannot be checked very much automatically.)
|
||||||
|
|
||||||
Setting DEBUG may also be helpful if you are trying to modify
|
Setting DL_DEBUG may also be helpful if you are trying to modify
|
||||||
this code. The assertions in the check routines spell out in more
|
this code. The assertions in the check routines spell out in more
|
||||||
detail the assumptions and invariants underlying the algorithms.
|
detail the assumptions and invariants underlying the algorithms.
|
||||||
|
|
||||||
Setting DEBUG does NOT provide an automated mechanism for checking
|
Setting DL_DEBUG does NOT provide an automated mechanism for checking
|
||||||
that all accesses to malloced memory stay within their
|
that all accesses to malloced memory stay within their
|
||||||
bounds. However, there are several add-ons and adaptations of this
|
bounds. However, there are several add-ons and adaptations of this
|
||||||
or other mallocs available that do this.
|
or other mallocs available that do this.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if DEBUG
|
#if DL_DEBUG
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#else
|
#else
|
||||||
#define assert(x) ((void)0)
|
#define assert(x) ((void)0)
|
||||||
|
@ -2452,7 +2452,7 @@ static struct malloc_state av_; /* never directly referenced */
|
||||||
At most one "call" to get_malloc_state is made per invocation of
|
At most one "call" to get_malloc_state is made per invocation of
|
||||||
the public versions of malloc and free, but other routines
|
the public versions of malloc and free, but other routines
|
||||||
that in turn invoke malloc and/or free may call more then once.
|
that in turn invoke malloc and/or free may call more then once.
|
||||||
Also, it is called in check* routines if DEBUG is set.
|
Also, it is called in check* routines if DL_DEBUG is set.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define get_malloc_state() (&(av_))
|
#define get_malloc_state() (&(av_))
|
||||||
|
@ -2526,7 +2526,7 @@ static Void_t** iALLOc();
|
||||||
in malloc. In which case, please report it!)
|
in malloc. In which case, please report it!)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if ! DEBUG
|
#if ! DL_DEBUG
|
||||||
|
|
||||||
#define check_chunk(P)
|
#define check_chunk(P)
|
||||||
#define check_free_chunk(P)
|
#define check_free_chunk(P)
|
||||||
|
@ -3847,7 +3847,7 @@ void fREe(mem) Void_t* mem;
|
||||||
If the chunk was allocated via mmap, release via munmap()
|
If the chunk was allocated via mmap, release via munmap()
|
||||||
Note that if HAVE_MMAP is false but chunk_is_mmapped is
|
Note that if HAVE_MMAP is false but chunk_is_mmapped is
|
||||||
true, then user must have overwritten memory. There's nothing
|
true, then user must have overwritten memory. There's nothing
|
||||||
we can do to catch this error unless DEBUG is set, in which case
|
we can do to catch this error unless DL_DEBUG is set, in which case
|
||||||
check_inuse_chunk (above) will have triggered error.
|
check_inuse_chunk (above) will have triggered error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -4533,7 +4533,7 @@ static Void_t** iALLOc(n_elements, sizes, opts, chunks) size_t n_elements; size_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DEBUG
|
#if DL_DEBUG
|
||||||
if (marray != chunks) {
|
if (marray != chunks) {
|
||||||
/* final element must have exactly exhausted chunk */
|
/* final element must have exactly exhausted chunk */
|
||||||
if (element_size != 0)
|
if (element_size != 0)
|
||||||
|
|
Loading…
Reference in a new issue