diff options
Diffstat (limited to 'malloc')
-rw-r--r-- | malloc/malloc.c | 2 | ||||
-rw-r--r-- | malloc/obstack.c | 4 | ||||
-rw-r--r-- | malloc/obstack.h | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c index 3e84354..8b99da9 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -3232,7 +3232,7 @@ heap_trim(heap, pad) heap_info *heap; size_t pad; assert(p->size == (0|PREV_INUSE)); /* must be fencepost */ p = prev_chunk(p); new_size = chunksize(p) + (MINSIZE-2*SIZE_SZ); - assert(new_size>0 && new_size<(long)2*MINSIZE); + assert(new_size>0 && new_size<(long int)(2*MINSIZE)); if(!prev_inuse(p)) new_size += p->prev_size; assert(new_size>0 && new_size<HEAP_MAX_SIZE); diff --git a/malloc/obstack.c b/malloc/obstack.c index cc41478..e059b5a 100644 --- a/malloc/obstack.c +++ b/malloc/obstack.c @@ -24,7 +24,7 @@ /* NOTE BEFORE MODIFYING THIS FILE: This version number must be incremented whenever callers compiled using an old obstack.h can no longer properly call the functions in this obstack.c. */ -#define OBSTACK_INTERFACE_VERSION 2 +#define OBSTACK_INTERFACE_VERSION 1 /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself, and the installed library @@ -171,6 +171,7 @@ _obstack_begin (h, size, alignment, chunkfun, freefun) chunk->prev = 0; /* The initial chunk now contains no empty object. */ h->maybe_empty_object = 0; + h->alloc_failed = 0; return 1; } @@ -220,6 +221,7 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg) chunk->prev = 0; /* The initial chunk now contains no empty object. */ h->maybe_empty_object = 0; + h->alloc_failed = 0; return 1; } diff --git a/malloc/obstack.h b/malloc/obstack.h index 152fbbc..2802888 100644 --- a/malloc/obstack.h +++ b/malloc/obstack.h @@ -183,6 +183,9 @@ struct obstack /* control current object in current chunk */ chunk contains a zero-length object. This prevents freeing the chunk if we allocate a bigger chunk to replace it. */ + unsigned alloc_failed:1; /* No longer used, as we now call the failed + handler on error, but retained for binary + compatibility. */ }; /* Declare the external functions we use; they are in obstack.c. */ |