Mercurial > projects > ddmd
diff dmd/Lexer.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/Lexer.d Sat Oct 24 17:25:59 2009 +0400 +++ b/dmd/Lexer.d Sun Oct 25 03:20:59 2009 +0300 @@ -17,6 +17,8 @@ import std.stdio : writeln; +import dmd.Memory; + import core.stdc.ctype; import core.stdc.stdlib; import core.stdc.string; @@ -713,7 +715,7 @@ } while (*p == '\\'); t.len = stringbuffer.offset; stringbuffer.writeByte(0); - char* cc = cast(char*)malloc(stringbuffer.offset); + char* cc = cast(char*)GC.malloc(stringbuffer.offset); memcpy(cc, stringbuffer.data, stringbuffer.offset); t.ustring = cc; t.postfix = 0; @@ -1622,7 +1624,7 @@ case '"': t.len = stringbuffer.offset; stringbuffer.writeByte(0); - char* tmp = cast(char*)malloc(stringbuffer.offset); + char* tmp = cast(char*)GC.malloc(stringbuffer.offset); memcpy(tmp, stringbuffer.data, stringbuffer.offset); t.ustring = tmp; stringPostfix(t); @@ -2408,7 +2410,7 @@ size_t len1 = strlen(cast(char*)c1); size_t len2 = strlen(cast(char*)c2); - c = cast(ubyte*)malloc(len1 + 1 + len2 + 1); + c = cast(ubyte*)GC.malloc(len1 + 1 + len2 + 1); memcpy(c, c1, len1); if (len1 && c1[len1 - 1] != '\n') {