pointerless backing buffers for string ports
authorAndy Wingo <wingo@pobox.com>
Thu, 24 Feb 2011 12:12:58 +0000 (13:12 +0100)
committerAndy Wingo <wingo@pobox.com>
Thu, 24 Feb 2011 12:12:58 +0000 (13:12 +0100)
* libguile/strports.c (scm_mkstrport): String port string buffer
  allocated atomically.

libguile/strports.c

index 625b753..64987fa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1998,1999,2000,2001,2002, 2003, 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1998,1999,2000,2001,2002, 2003, 2005, 2006, 2009, 2010, 2011 Free Software Foundation, Inc.
  * 
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -314,7 +314,7 @@ scm_mkstrport (SCM pos, SCM str, long modes, const char *caller)
   /* Create a copy of STR in the encoding of Z.  */
   buf = scm_to_stringn (str, &str_len, pt->encoding,
                        SCM_FAILED_CONVERSION_ERROR);
-  c_str = scm_gc_malloc (str_len, "strport");
+  c_str = scm_gc_malloc_pointerless (str_len, "strport");
   memcpy (c_str, buf, str_len);
   free (buf);