diff dmd/Util.d @ 174:af724d3510d7

lot os toCBuffer methods implemented moved shared Type.* stuff into Global
author korDen
date Sun, 10 Oct 2010 03:47:23 +0400
parents 09c858522d55
children 94b6033c07f3
line wrap: on
line diff
--- a/dmd/Util.d	Sun Oct 10 01:55:35 2010 +0400
+++ b/dmd/Util.d	Sun Oct 10 03:47:23 2010 +0400
@@ -1139,3 +1139,42 @@
 }
 }
 }
+
+extern(C++) void util_assert(char* file,int line)
+{
+    fflush(stdout);
+    printf("Internal error: %s %d\n",file,line);
+    throw new Exception("Internal error");
+}
+
+extern (C++) {
+	void* mem_malloc(uint size)
+	{
+		return GC.malloc(size);
+	}
+	
+	void* mem_calloc(uint size)
+	{
+		return GC.calloc(size);
+	}
+	
+	void* mem_realloc(void* ptr, uint size)
+	{
+		return GC.realloc(ptr, size);
+	}
+	
+	void mem_free(void* ptr)
+	{
+		GC.free(ptr);
+	}
+	
+	void* mem_fmalloc(uint size)
+	{
+		return mem_malloc(size);
+	}
+	
+	void* mem_fcalloc(uint size)
+	{
+		return mem_calloc(size);
+	}
+}
\ No newline at end of file