summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Jerram <neil@ossau.uklinux.net>2008-02-06 22:22:14 +0000
committerNeil Jerram <neil@ossau.uklinux.net>2008-02-06 22:22:14 +0000
commit4a19ed04528750e7764837494dea39556aca09f8 (patch)
tree14cc88191da44f31d2ff099d4567ea72363d1f49
parent189171c5bb05de698d7704d86c57208773a0de4a (diff)
downloadguile-4a19ed04528750e7764837494dea39556aca09f8.tar.gz
(scm_gc_malloc): Return NULL if requested size is 0.
(scm_gc_free): Don't call `free' if mem is NULL.
-rw-r--r--NEWS2
-rw-r--r--THANKS1
-rw-r--r--libguile/ChangeLog5
-rw-r--r--libguile/gc-malloc.c5
4 files changed, 11 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index bc14cb76e..89360bde2 100644
--- a/NEWS
+++ b/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"
system and library calls.
** 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)
diff --git a/THANKS b/THANKS
index be5a51d21..465471ca4 100644
--- a/THANKS
+++ b/THANKS
@@ -80,6 +80,7 @@ For fixes or providing information which led to a fix:
Alex Shinn
Daniel Skarda
Cesar Strauss
+ Rainer Tammer
Richard Todd
Issac Trotts
Greg Troxel
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index 7bcb196fa..69a95e772 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -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>
* numbers.c (scm_i_mkbig, scm_i_long2big, scm_i_ulong2big,
diff --git a/libguile/gc-malloc.c b/libguile/gc-malloc.c
index 4c71be6b7..165ddf46e 100644
--- a/libguile/gc-malloc.c
+++ b/libguile/gc-malloc.c
@@ -319,7 +319,7 @@ scm_gc_malloc (size_t size, const char *what)
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);
return ptr;
}
@@ -365,7 +365,8 @@ void
scm_gc_free (void *mem, size_t size, const char *what)
{
scm_gc_unregister_collectable_memory (mem, size, what);
- free (mem);
+ if (mem)
+ free (mem);
}
char *