mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
(scm_gc_malloc): Return NULL if requested size is 0.
(scm_gc_free): Don't call `free' if mem is NULL.
This commit is contained in:
parent
189171c5bb
commit
4a19ed0452
4 changed files with 11 additions and 2 deletions
2
NEWS
2
NEWS
|
@ -52,6 +52,8 @@ called with an associator proc that returns neither a pair nor #f.
|
||||||
** Avoid MacOS build problems caused by incorrect combination of "64"
|
** Avoid MacOS build problems caused by incorrect combination of "64"
|
||||||
system and library calls.
|
system and library calls.
|
||||||
** Fixed compilation of `numbers.c' with Sun Studio (Solaris 9)
|
** Fixed compilation of `numbers.c' with Sun Studio (Solaris 9)
|
||||||
|
** Fixed wrong-type-arg errors when creating zero length SRFI-4
|
||||||
|
uniform vectors on AIX.
|
||||||
|
|
||||||
* New modules (see the manual for details)
|
* New modules (see the manual for details)
|
||||||
|
|
||||||
|
|
1
THANKS
1
THANKS
|
@ -80,6 +80,7 @@ For fixes or providing information which led to a fix:
|
||||||
Alex Shinn
|
Alex Shinn
|
||||||
Daniel Skarda
|
Daniel Skarda
|
||||||
Cesar Strauss
|
Cesar Strauss
|
||||||
|
Rainer Tammer
|
||||||
Richard Todd
|
Richard Todd
|
||||||
Issac Trotts
|
Issac Trotts
|
||||||
Greg Troxel
|
Greg Troxel
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2008-02-06 Neil Jerram <neil@ossau.uklinux.net>
|
||||||
|
|
||||||
|
* gc-malloc.c (scm_gc_malloc): Return NULL if requested size is 0.
|
||||||
|
(scm_gc_free): Don't call `free' if mem is NULL.
|
||||||
|
|
||||||
2008-02-06 Ludovic Courtès <ludo@gnu.org>
|
2008-02-06 Ludovic Courtès <ludo@gnu.org>
|
||||||
|
|
||||||
* numbers.c (scm_i_mkbig, scm_i_long2big, scm_i_ulong2big,
|
* numbers.c (scm_i_mkbig, scm_i_long2big, scm_i_ulong2big,
|
||||||
|
|
|
@ -319,7 +319,7 @@ scm_gc_malloc (size_t size, const char *what)
|
||||||
to write it the program is killed with signal 11. --hwn
|
to write it the program is killed with signal 11. --hwn
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void *ptr = scm_malloc (size);
|
void *ptr = size ? scm_malloc (size) : NULL;
|
||||||
scm_gc_register_collectable_memory (ptr, size, what);
|
scm_gc_register_collectable_memory (ptr, size, what);
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
@ -365,7 +365,8 @@ void
|
||||||
scm_gc_free (void *mem, size_t size, const char *what)
|
scm_gc_free (void *mem, size_t size, const char *what)
|
||||||
{
|
{
|
||||||
scm_gc_unregister_collectable_memory (mem, size, what);
|
scm_gc_unregister_collectable_memory (mem, size, what);
|
||||||
free (mem);
|
if (mem)
|
||||||
|
free (mem);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue