1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00
* malloc/malloc.c (rEALLOc): Only free memory for size 0 if oldmem
	is != NULL.

1999-04-28  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* malloc/malloc.c (REALLOC_ZERO_BYTES_FREES): Define it to follow
	ISO C9x and Unix98.

1999-04-28  Ulrich Drepper  <drepper@cygnus.com>
This commit is contained in:
Ulrich Drepper
1999-04-28 10:20:18 +00:00
parent 925ed47cfb
commit 7c2b945e1f
4 changed files with 29 additions and 13 deletions

View File

@@ -1,3 +1,13 @@
1999-04-28 Ulrich Drepper <drepper@cygnus.com>
* malloc/malloc.c (rEALLOc): Only free memory for size 0 if oldmem
is != NULL.
1999-04-28 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* malloc/malloc.c (REALLOC_ZERO_BYTES_FREES): Define it to follow
ISO C9x and Unix98.
1999-04-28 Ulrich Drepper <drepper@cygnus.com> 1999-04-28 Ulrich Drepper <drepper@cygnus.com>
* libio/iofopncook.c (_IO_cookie_seek): Correct return value. * libio/iofopncook.c (_IO_cookie_seek): Correct return value.

7
FAQ.in
View File

@@ -151,10 +151,9 @@ Binutils 2.9.1.0.16 or later is also required.
as much as 400MB). as much as 400MB).
* plenty of time. Compiling just the shared and static libraries for * plenty of time. Compiling just the shared and static libraries for
i?86-linux takes approximately 1h on an i586@133, or 2.5h on i?86-linux takes approximately 1h on an AMD-K6@225MHz w/ 96MB of RAM.
i486@66, or 4.5h on i486@33. Multiply this by 1.5 or 2.0 if you Multiply this by 1.5 or 2.0 if you build profiling and/or the highly
build profiling and/or the highly optimized version as well. For optimized version as well. For Hurd systems times are much higher.
Hurd systems times are much higher.
You should avoid compiling in a NFS mounted filesystem. This is You should avoid compiling in a NFS mounted filesystem. This is
very slow. very slow.

View File

@@ -1,3 +1,10 @@
1999-04-20 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
* charmaps/UTF8: Fix entries for <G'>, <g'>, <1!> and <RY>, and
correct some character names.
* repertoiremaps/mnemonic.ds: Correct name of <P2> entry.
1999-04-26 Ulrich Drepper <drepper@cygnus.com> 1999-04-26 Ulrich Drepper <drepper@cygnus.com>
* charmaps/SAMI-WS2: Add one more alias. * charmaps/SAMI-WS2: Add one more alias.

View File

@@ -1,5 +1,5 @@
/* Malloc implementation for multiple threads without lock contention. /* Malloc implementation for multiple threads without lock contention.
Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Wolfram Gloger <wmglo@dent.med.uni-muenchen.de> Contributed by Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>
and Doug Lea <dl@cs.oswego.edu>, 1996. and Doug Lea <dl@cs.oswego.edu>, 1996.
@@ -373,7 +373,7 @@ extern "C" {
*/ */
/* #define REALLOC_ZERO_BYTES_FREES */ #define REALLOC_ZERO_BYTES_FREES
/* /*
@@ -2000,9 +2000,9 @@ grow_heap(h, diff) heap_info *h; long diff;
new_size = (long)h->size + diff; new_size = (long)h->size + diff;
if(new_size < (long)sizeof(*h)) if(new_size < (long)sizeof(*h))
return -1; return -1;
/* Try to re-map the extra heap space freshly to save memory, and /* Try to re-map the extra heap space freshly to save memory, and
make it inaccessible. */ make it inaccessible. */
if((char *)MMAP((char *)h + new_size, -diff, PROT_NONE, if((char *)MMAP((char *)h + new_size, -diff, PROT_NONE,
MAP_PRIVATE|MAP_FIXED) == (char *) MAP_FAILED) MAP_PRIVATE|MAP_FIXED) == (char *) MAP_FAILED)
return -2; return -2;
} }
@@ -2159,9 +2159,9 @@ static void do_check_chunk(ar_ptr, p) arena *ar_ptr; mchunkptr p;
if(ar_ptr != &main_arena) { if(ar_ptr != &main_arena) {
heap_info *heap = heap_for_ptr(p); heap_info *heap = heap_for_ptr(p);
assert(heap->ar_ptr == ar_ptr); assert(heap->ar_ptr == ar_ptr);
if(p != top(ar_ptr)) if(p != top(ar_ptr))
assert((char *)p + sz <= (char *)heap + heap->size); assert((char *)p + sz <= (char *)heap + heap->size);
else else
assert((char *)p + sz == (char *)heap + heap->size); assert((char *)p + sz == (char *)heap + heap->size);
return; return;
} }
@@ -3111,7 +3111,7 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t bytes;
#endif #endif
#ifdef REALLOC_ZERO_BYTES_FREES #ifdef REALLOC_ZERO_BYTES_FREES
if (bytes == 0) { fREe(oldmem); return 0; } if (bytes == 0 && oldmem != NULL) { fREe(oldmem); return 0; }
#endif #endif
/* realloc of null is supposed to be same as malloc */ /* realloc of null is supposed to be same as malloc */