mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-04 00:25:29 +00:00
Disable memory debugging features in non-developer build
The two memory debugging features: ISC_MEM_DEFAULTFILL (ISC_MEMFLAG_FILL) and ISC_MEM_TRACKLINES were always enabled in all builds and the former was only disabled in `named`. This commits disables those two features in non-developer build to make the memory allocator significantly faster.
This commit is contained in:
@@ -1524,15 +1524,6 @@ main(int argc, char *argv[]) {
|
|||||||
pk11_result_register();
|
pk11_result_register();
|
||||||
#endif /* if USE_PKCS11 */
|
#endif /* if USE_PKCS11 */
|
||||||
|
|
||||||
#if !ISC_MEM_DEFAULTFILL
|
|
||||||
/*
|
|
||||||
* Update the default flags to remove ISC_MEMFLAG_FILL
|
|
||||||
* before we parse the command line. If disabled here,
|
|
||||||
* it can be turned back on with -M fill.
|
|
||||||
*/
|
|
||||||
isc_mem_defaultflags &= ~ISC_MEMFLAG_FILL;
|
|
||||||
#endif /* if !ISC_MEM_DEFAULTFILL */
|
|
||||||
|
|
||||||
parse_command_line(argc, argv);
|
parse_command_line(argc, argv);
|
||||||
|
|
||||||
#ifdef ENABLE_AFL
|
#ifdef ENABLE_AFL
|
||||||
|
@@ -158,7 +158,7 @@ AC_ARG_ENABLE([developer],
|
|||||||
|
|
||||||
AS_IF([test "$enable_developer" = "yes"],
|
AS_IF([test "$enable_developer" = "yes"],
|
||||||
[DEVELOPER_MODE=yes
|
[DEVELOPER_MODE=yes
|
||||||
STD_CPPFLAGS="$STD_CPPFLAGS -DISC_MEM_DEFAULTFILL=1 -DISC_LIST_CHECKINIT=1"
|
STD_CPPFLAGS="$STD_CPPFLAGS -DISC_MEM_DEFAULTFILL=1 -DISC_MEM_TRACKLINES=1 -DISC_LIST_CHECKINIT=1"
|
||||||
test "${enable_fixed_rrset+set}" = set || enable_fixed_rrset=yes
|
test "${enable_fixed_rrset+set}" = set || enable_fixed_rrset=yes
|
||||||
test "${enable_querytrace+set}" = set || enable_querytrace=yes
|
test "${enable_querytrace+set}" = set || enable_querytrace=yes
|
||||||
test "${with_cmocka+set}" = set || with_cmocka=yes
|
test "${with_cmocka+set}" = set || with_cmocka=yes
|
||||||
|
@@ -33,7 +33,7 @@ typedef void (*isc_mem_water_t)(void *, int);
|
|||||||
* allocation and freeing by file and line number.
|
* allocation and freeing by file and line number.
|
||||||
*/
|
*/
|
||||||
#ifndef ISC_MEM_TRACKLINES
|
#ifndef ISC_MEM_TRACKLINES
|
||||||
#define ISC_MEM_TRACKLINES 1
|
#define ISC_MEM_TRACKLINES 0
|
||||||
#endif /* ifndef ISC_MEM_TRACKLINES */
|
#endif /* ifndef ISC_MEM_TRACKLINES */
|
||||||
|
|
||||||
LIBISC_EXTERNAL_DATA extern unsigned int isc_mem_debugging;
|
LIBISC_EXTERNAL_DATA extern unsigned int isc_mem_debugging;
|
||||||
@@ -90,10 +90,14 @@ LIBISC_EXTERNAL_DATA extern unsigned int isc_mem_defaultflags;
|
|||||||
#define ISC_MEMFLAG_FILL \
|
#define ISC_MEMFLAG_FILL \
|
||||||
0x00000004 /* fill with pattern after alloc and frees */
|
0x00000004 /* fill with pattern after alloc and frees */
|
||||||
|
|
||||||
#if !ISC_MEM_USE_INTERNAL_MALLOC
|
/*%
|
||||||
#define ISC_MEMFLAG_DEFAULT 0
|
* Define ISC_MEM_DEFAULTFILL=1 to turn filling the memory with pattern
|
||||||
#else /* if !ISC_MEM_USE_INTERNAL_MALLOC */
|
* after alloc and free.
|
||||||
|
*/
|
||||||
|
#if ISC_MEM_DEFAULTFILL
|
||||||
#define ISC_MEMFLAG_DEFAULT ISC_MEMFLAG_FILL
|
#define ISC_MEMFLAG_DEFAULT ISC_MEMFLAG_FILL
|
||||||
|
#else /* if !ISC_MEM_USE_INTERNAL_MALLOC */
|
||||||
|
#define ISC_MEMFLAG_DEFAULT 0
|
||||||
#endif /* if !ISC_MEM_USE_INTERNAL_MALLOC */
|
#endif /* if !ISC_MEM_USE_INTERNAL_MALLOC */
|
||||||
|
|
||||||
/*%
|
/*%
|
||||||
|
Reference in New Issue
Block a user