comparison 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
comparison
equal deleted inserted replaced
173:d237b38b5858 174:af724d3510d7
1137 } else { 1137 } else {
1138 static assert(false); 1138 static assert(false);
1139 } 1139 }
1140 } 1140 }
1141 } 1141 }
1142
1143 extern(C++) void util_assert(char* file,int line)
1144 {
1145 fflush(stdout);
1146 printf("Internal error: %s %d\n",file,line);
1147 throw new Exception("Internal error");
1148 }
1149
1150 extern (C++) {
1151 void* mem_malloc(uint size)
1152 {
1153 return GC.malloc(size);
1154 }
1155
1156 void* mem_calloc(uint size)
1157 {
1158 return GC.calloc(size);
1159 }
1160
1161 void* mem_realloc(void* ptr, uint size)
1162 {
1163 return GC.realloc(ptr, size);
1164 }
1165
1166 void mem_free(void* ptr)
1167 {
1168 GC.free(ptr);
1169 }
1170
1171 void* mem_fmalloc(uint size)
1172 {
1173 return mem_malloc(size);
1174 }
1175
1176 void* mem_fcalloc(uint size)
1177 {
1178 return mem_calloc(size);
1179 }
1180 }