Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 46ed276

Browse files
committed
Malloc debugging now flagged with USE_MALLOC_DEBUG
1 parent 6b9e560 commit 46ed276

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

Mac/Modules/macmodule.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
6767
#endif
6868

6969
/* Optional routines, for some compiler/runtime combinations */
70-
#if defined(__MWERKS__) && defined(__powerc)
71-
#define MALLOC_DEBUG
72-
#endif
7370
#if defined(USE_GUSI) || !defined(__MWERKS__)
7471
#define WEHAVE_FDOPEN
7572
#endif
@@ -581,7 +578,7 @@ mac_write(self, args)
581578
return newintobject((long)size);
582579
}
583580

584-
#ifdef MALLOC_DEBUG
581+
#ifdef USE_MALLOC_DEBUG
585582
static object *
586583
mac_mstats(self, args)
587584
object*self;
@@ -591,7 +588,7 @@ mac_mstats(self, args)
591588
INCREF(None);
592589
return None;
593590
}
594-
#endif MALLOC_DEBUG
591+
#endif USE_MALLOC_DEBUG
595592

596593
static struct methodlist mac_methods[] = {
597594
{"chdir", mac_chdir},
@@ -617,7 +614,7 @@ static struct methodlist mac_methods[] = {
617614
{"remove", mac_unlink},
618615
{"unlink", mac_unlink},
619616
{"write", mac_write},
620-
#ifdef MALLOC_DEBUG
617+
#ifdef USE_MALLOC_DEBUG
621618
{"mstats", mac_mstats},
622619
#endif
623620

Mac/mwerks/malloc/malloc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,14 @@ static char *rcsid = "$Id$";
5252
*
5353
*/
5454

55-
55+
#ifdef USE_MALLOC_DEBUG
56+
/* You may also selectively enable some of these (but some are interdependent) */
5657
#define DEBUG
5758
#define DEBUG2
5859
#define MSTATS
5960
#define RCHECK
6061
#define VCHECK
62+
#endif /* USE_MALLOC_DEBUG */
6163

6264
typedef unsigned char u_char;
6365
typedef unsigned long u_long;

0 commit comments

Comments
 (0)