diff options
author | Neal H. Walfield <neal@gnu.org> | 2008-12-11 13:53:08 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@gnu.org> | 2008-12-11 13:53:08 +0100 |
commit | d87f467a0a7a84cc4b5acab3a8d40627d01001bb (patch) | |
tree | 7af46b207dfe6d3744e21083b3a5c717b4520a4e | |
parent | e5890115e4a1b826e15fcd7b3fc835d5ee8079f0 (diff) |
Improve consistency check to avoid false positives.
2008-12-11 Neal H. Walfield <neal@gnu.org>
* zalloc.c (zalloc_internal): Only assert that ZALLOC_MEMORY is
zero if the requested allocation is for PAGESIZE bytes of memory.
-rw-r--r-- | viengoos/ChangeLog | 5 | ||||
-rw-r--r-- | viengoos/zalloc.c | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/viengoos/ChangeLog b/viengoos/ChangeLog index 74774f7..965d26a 100644 --- a/viengoos/ChangeLog +++ b/viengoos/ChangeLog @@ -1,3 +1,8 @@ +2008-12-11 Neal H. Walfield <neal@gnu.org> + + * zalloc.c (zalloc_internal): Only assert that ZALLOC_MEMORY is + zero if the requested allocation is for PAGESIZE bytes of memory. + 2008-11-18 Neal H. Walfield <neal@gnu.org> * rm.h (RM_fault): Define. diff --git a/viengoos/zalloc.c b/viengoos/zalloc.c index 2ead0f8..fd4aa55 100644 --- a/viengoos/zalloc.c +++ b/viengoos/zalloc.c @@ -242,7 +242,8 @@ zalloc_internal (uintptr_t size) if (zone_nr == ZONES) { debug (4, "Cannot allocate a block of %d bytes!", size); - assert (zalloc_memory == 0); + if (size == PAGESIZE) + assert (zalloc_memory == 0); return 0; } @@ -285,7 +286,8 @@ zalloc_dump_zones (const char *prefix) int count = 0; print_empty = 1; - printf ("%s: %d: { ", prefix, ZONE_SIZE (i) / PAGESIZE); + printf ("%s%s%d: { ", + prefix ?: "", prefix ? ": " : "", ZONE_SIZE (i) / PAGESIZE); for (block = zone[i]; block; block = block->next) { available += ZONE_SIZE (i) / PAGESIZE; @@ -295,7 +297,8 @@ zalloc_dump_zones (const char *prefix) printf ("} = %d pages\n", count * ZONE_SIZE (i) / PAGESIZE); } - printf ("%s: %llu (0x%llx) kbytes (%d pages) available\n", prefix, + printf ("%s%s%llu (0x%llx) kbytes (%d pages) available\n", + prefix ?: "", prefix ? ": " : "", (unsigned long long) 4 * available, (unsigned long long) 4 * available, available); |