cvsuser 02/01/08 11:50:17
Modified: . memory.c
Log:
Need a realloc
Revision Changes Path
1.16 +13 -1 parrot/memory.c
Index: memory.c
===================================================================
RCS file: /home/perlcvs/parrot/memory.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -r1.15 -r1.16
--- memory.c 1 Jan 2002 17:22:54 -0000 1.15
+++ memory.c 8 Jan 2002 19:50:17 -0000 1.16
@@ -1,7 +1,7 @@
/* memory.c
* Copyright: (When this is determined...it will go here)
* CVS Info
- * $Id: memory.c,v 1.15 2002/01/01 17:22:54 dan Exp $
+ * $Id: memory.c,v 1.16 2002/01/08 19:50:17 dan Exp $
* Overview:
* The memory (mem) API handles memory allocation
* Data Structure and Algorithms:
@@ -77,6 +77,18 @@
*/
void
mem_setup_allocator(struct Parrot_Interp *interpreter) {
+}
+
+void *
+mem_realloc(void *from, UINTVAL fromsize, UINTVAL tosize) {
+ INTVAL copysize = (fromsize > tosize ? tosize : fromsize);
+ void *mem;
+ mem = mem_sys_allocate(copysize);
+ if (!mem) {
+ return NULL;
+ }
+ memcpy(mem, from, copysize);
+ return mem;
}
/*