EXTRA_SANITY -> MALLOC_EXTRA_SANITY, consistently.

This commit is contained in:
thorpej 1999-07-05 21:08:38 +00:00
parent 8fc3744ddd
commit b2146da05a
1 changed files with 12 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: malloc.c,v 1.18 1999/07/04 03:12:47 thorpej Exp $ */
/* $NetBSD: malloc.c,v 1.19 1999/07/05 21:08:38 thorpej Exp $ */
/*
* ----------------------------------------------------------------------------
@ -13,7 +13,7 @@
*/
/*
* Defining EXTRA_SANITY will enable extra checks which are related
* Defining MALLOC_EXTRA_SANITY will enable extra checks which are related
* to internal conditions and consistency in malloc.c. This has a
* noticeable runtime performance hit, and generally will not do you
* any good unless you fiddle with the internals of malloc or want
@ -319,9 +319,9 @@ map_pages(int pages)
tail = result + (pages << malloc_pageshift);
if (brk(tail)) {
#ifdef EXTRA_SANITY
#ifdef MALLOC_EXTRA_SANITY
wrterror("(ES): map_pages fails\n");
#endif /* EXTRA_SANITY */
#endif /* MALLOC_EXTRA_SANITY */
return 0;
}
@ -399,9 +399,9 @@ malloc_init (void)
INIT_MMAP();
#ifdef EXTRA_SANITY
#ifdef MALLOC_EXTRA_SANITY
malloc_junk = 1;
#endif /* EXTRA_SANITY */
#endif /* MALLOC_EXTRA_SANITY */
for (i = 0; i < 3; i++) {
if (i == 0) {
@ -515,7 +515,7 @@ malloc_pages(size_t size)
/* Look for free pages before asking for more */
for(pf = free_list.next; pf; pf = pf->next) {
#ifdef EXTRA_SANITY
#ifdef MALLOC_EXTRA_SANITY
if (pf->size & malloc_pagemask)
wrterror("(ES): junk length entry on free_list\n");
if (!pf->size)
@ -530,7 +530,7 @@ malloc_pages(size_t size)
wrterror("(ES): non-free first page on free-list\n");
if (page_dir[ptr2index(pf->end)-1] != MALLOC_FREE)
wrterror("(ES): non-free last page on free-list\n");
#endif /* EXTRA_SANITY */
#endif /* MALLOC_EXTRA_SANITY */
if (pf->size < size)
continue;
@ -550,10 +550,10 @@ malloc_pages(size_t size)
break;
}
#ifdef EXTRA_SANITY
#ifdef MALLOC_EXTRA_SANITY
if (p && page_dir[ptr2index(p)] != MALLOC_FREE)
wrterror("(ES): allocated non-free page on free-list\n");
#endif /* EXTRA_SANITY */
#endif /* MALLOC_EXTRA_SANITY */
size >>= malloc_pageshift;
@ -1009,10 +1009,10 @@ free_bytes(void *ptr, int index, struct pginfo *info)
/* Find & remove this page in the queue */
while (*mp != info) {
mp = &((*mp)->next);
#ifdef EXTRA_SANITY
#ifdef MALLOC_EXTRA_SANITY
if (!*mp)
wrterror("(ES): Not on queue\n");
#endif /* EXTRA_SANITY */
#endif /* MALLOC_EXTRA_SANITY */
}
*mp = info->next;