diff dmd/backend/iasm.d @ 2:7427ded8caf7

Removed unreferenced modules First step at fixing GC issues - now calling GC.malloc instead of malloc (ditto calloc and realloc), get rid of free
author korDen
date Sun, 25 Oct 2009 03:20:59 +0300
parents 10317f0c89a5
children d706d958e4e8
line wrap: on
line diff
--- a/dmd/backend/iasm.d	Sat Oct 24 17:25:59 2009 +0400
+++ b/dmd/backend/iasm.d	Sun Oct 25 03:20:59 2009 +0300
@@ -41,8 +41,7 @@
 import std.string : toStringz;
 import std.algorithm : min;
 
-import core.stdc.stdlib : realloc;
-import core.stdc.stdio : printf;
+import dmd.Memory;import core.stdc.stdio : printf;
 import core.stdc.string : strlen;
 import core.stdc.limits;
 
@@ -1871,7 +1870,7 @@
 		if (usBytes+usSize > usMaxbytes)
 		{   
 			usMaxbytes = usBytes + usSize + 10;
-			c.IEV1.as.bytes = cast(char*)realloc(c.IEV1.as.bytes,usMaxbytes);
+			c.IEV1.as.bytes = cast(char*)GC.realloc(c.IEV1.as.bytes,usMaxbytes);
 		}
 		switch (tok_value)
 		{
@@ -1931,7 +1930,7 @@
 				if (len)
 				{
 					usMaxbytes += len * usSize;
-					c.IEV1.as.bytes =  cast(char*)realloc(c.IEV1.as.bytes,usMaxbytes);
+					c.IEV1.as.bytes =  cast(char*)GC.realloc(c.IEV1.as.bytes,usMaxbytes);
 					memcpy(c.IEV1.as.bytes + usBytes,asmtok.ustring,len);
 
 					char* p = c.IEV1.as.bytes + usBytes;