comparison dmd/Lexer.d @ 175:94b6033c07f3

get rid of globals malloc -> GC.malloc
author korDen
date Sun, 10 Oct 2010 03:48:06 +0400
parents af724d3510d7
children e3afd1303184
comparison
equal deleted inserted replaced
174:af724d3510d7 175:94b6033c07f3
1990 error("odd number (%d) of hex characters in hex string", n); 1990 error("odd number (%d) of hex characters in hex string", n);
1991 stringbuffer.writeByte(v); 1991 stringbuffer.writeByte(v);
1992 } 1992 }
1993 t.len = stringbuffer.offset; 1993 t.len = stringbuffer.offset;
1994 stringbuffer.writeByte(0); 1994 stringbuffer.writeByte(0);
1995 void* mem = malloc(stringbuffer.offset); 1995 void* mem = GC.malloc(stringbuffer.offset);
1996 memcpy(mem, stringbuffer.data, stringbuffer.offset); 1996 memcpy(mem, stringbuffer.data, stringbuffer.offset);
1997 t.ustring = cast(const(char)*)mem; 1997 t.ustring = cast(const(char)*)mem;
1998 stringPostfix(t); 1998 stringPostfix(t);
1999 return TOKstring; 1999 return TOKstring;
2000 2000
2180 p++; 2180 p++;
2181 else 2181 else
2182 error("delimited string must end in %c\"", delimright); 2182 error("delimited string must end in %c\"", delimright);
2183 t.len = stringbuffer.offset; 2183 t.len = stringbuffer.offset;
2184 stringbuffer.writeByte(0); 2184 stringbuffer.writeByte(0);
2185 void* mem = malloc(stringbuffer.offset); 2185 void* mem = GC.malloc(stringbuffer.offset);
2186 memcpy(mem, stringbuffer.data, stringbuffer.offset); 2186 memcpy(mem, stringbuffer.data, stringbuffer.offset);
2187 t.ustring = cast(const(char)*)mem; 2187 t.ustring = cast(const(char)*)mem;
2188 stringPostfix(t); 2188 stringPostfix(t);
2189 return TOKstring; 2189 return TOKstring;
2190 2190