chiark / gitweb /
Qualify name given to @bres_byname@.
[mLib] / alloc.h
diff --git a/alloc.h b/alloc.h
index edf555af7a3265afe630caf4629c21102eaedbfe..feed0bfe3621dba82087a4ff0d36bd95ae987996 100644 (file)
--- a/alloc.h
+++ b/alloc.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: alloc.h,v 1.5 2000/06/17 10:35:51 mdw Exp $
+ * $Id: alloc.h,v 1.6 2000/07/16 12:29:16 mdw Exp $
  *
  * Memory allocation functions
  *
@@ -30,6 +30,9 @@
 /*----- Revision history --------------------------------------------------*
  *
  * $Log: alloc.h,v $
+ * Revision 1.6  2000/07/16 12:29:16  mdw
+ * Change to arena `realloc' interface, to fix a design bug.
+ *
  * Revision 1.5  2000/06/17 10:35:51  mdw
  * Major overhaul for arena support.
  *
@@ -96,6 +99,7 @@ extern char *x_strdup(arena */*a*/, const char */*s*/);
  * Arguments:  @arena *a@ = pointer to underlying arena
  *             @void *p@ = pointer to a block of memory
  *             @size_t sz@ = new size desired for the block
+ *             @size_t osz@ = size of the old block
  *
  * Returns:    Pointer to the resized memory block (which is almost
  *             certainly not in the same place any more).
@@ -104,7 +108,8 @@ extern char *x_strdup(arena */*a*/, const char */*s*/);
  *             exception @EXC_NOMEM@ is thrown.
  */
 
-extern void *x_realloc(arena */*a*/, void */*p*/, size_t /*sz*/);
+extern void *x_realloc(arena */*a*/, void */*p*/,
+                      size_t /*sz*/, size_t /*osz*/);
 
 /* --- @x_free@ --- *
  *
@@ -152,6 +157,7 @@ extern char *xstrdup(const char */*s*/);
  *
  * Arguments:  @void *p@ = pointer to a block of memory
  *             @size_t sz@ = new size desired for the block
+ *             @size_t osz@ = size of the old block
  *
  * Returns:    Pointer to the resized memory block (which is almost
  *             certainly not in the same place any more).
@@ -160,8 +166,8 @@ extern char *xstrdup(const char */*s*/);
  *             exception @EXC_NOMEM@ is thrown.
  */
 
-extern void *xrealloc(void */*p*/, size_t /*sz*/);
-#define xrealloc(p, sz) x_realloc(arena_global, (p), (sz))
+extern void *xrealloc(void */*p*/, size_t /*sz*/, size_t /*osz*/);
+#define xrealloc(p, sz, osz) x_realloc(arena_global, (p), (sz), (osz))
 
 /* --- @xfree@ --- *
  *