PARANOID_POINTER_CHECK is now only defined if DEBUG is defined, too, by default.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10435 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-12-13 22:44:17 +00:00
parent 97dda329ed
commit 64e7394c50
1 changed files with 14 additions and 9 deletions

View File

@ -1,10 +1,11 @@
/* /*
** Copyright 2002-2004, The Haiku Team. All rights reserved. * Copyright 2002-2004, Axel Dörfler, axeld@pinc-software.de.
** Distributed under the terms of the Haiku License. * Distributed under the terms of the MIT License.
** *
** Copyright 2001, Travis Geiselbrecht. All rights reserved. * Copyright 2001, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License. * Distributed under the terms of the NewOS License.
*/ */
#include <KernelExport.h> #include <KernelExport.h>
#include <kernel.h> #include <kernel.h>
@ -19,15 +20,19 @@
#include <string.h> #include <string.h>
#define TRACE_HEAP 0 //#define TRACE_HEAP
#if TRACE_HEAP #ifdef TRACE_HEAP
# define TRACE(x) dprintf x # define TRACE(x) dprintf x
#else #else
# define TRACE(x) ; # define TRACE(x) ;
#endif #endif
/* prevent freeing pointers that were not allocated by kmalloc or are already freeed */ /* prevent freeing pointers that were not allocated by kmalloc or are already freeed */
#define PARANOID_POINTER_CHECK 1 #ifdef DEBUG
# define PARANOID_POINTER_CHECK 1
#else
# define PARANOID_POINTER_CHECK 0
#endif
/* initialize newly allocated memory with something non zero */ /* initialize newly allocated memory with something non zero */
#define PARANOID_KMALLOC 1 #define PARANOID_KMALLOC 1
/* check if freed pointers are already freed, and fill freed memory with 0xdeadbeef */ /* check if freed pointers are already freed, and fill freed memory with 0xdeadbeef */