Mercurial > projects > ddmd
comparison 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 |
comparison
equal
deleted
inserted
replaced
1:5a2059196104 | 2:7427ded8caf7 |
---|---|
39 | 39 |
40 import std.stdio : writef, writefln; | 40 import std.stdio : writef, writefln; |
41 import std.string : toStringz; | 41 import std.string : toStringz; |
42 import std.algorithm : min; | 42 import std.algorithm : min; |
43 | 43 |
44 import core.stdc.stdlib : realloc; | 44 import dmd.Memory;import core.stdc.stdio : printf; |
45 import core.stdc.stdio : printf; | |
46 import core.stdc.string : strlen; | 45 import core.stdc.string : strlen; |
47 import core.stdc.limits; | 46 import core.stdc.limits; |
48 | 47 |
49 import std.bitmanip; | 48 import std.bitmanip; |
50 | 49 |
1869 ubyte* q; | 1868 ubyte* q; |
1870 | 1869 |
1871 if (usBytes+usSize > usMaxbytes) | 1870 if (usBytes+usSize > usMaxbytes) |
1872 { | 1871 { |
1873 usMaxbytes = usBytes + usSize + 10; | 1872 usMaxbytes = usBytes + usSize + 10; |
1874 c.IEV1.as.bytes = cast(char*)realloc(c.IEV1.as.bytes,usMaxbytes); | 1873 c.IEV1.as.bytes = cast(char*)GC.realloc(c.IEV1.as.bytes,usMaxbytes); |
1875 } | 1874 } |
1876 switch (tok_value) | 1875 switch (tok_value) |
1877 { | 1876 { |
1878 case TOK.TOKint32v: | 1877 case TOK.TOKint32v: |
1879 dt.ul = asmtok.int32value; | 1878 dt.ul = asmtok.int32value; |
1929 q = cast(ubyte*)asmtok.ustring; | 1928 q = cast(ubyte*)asmtok.ustring; |
1930 L3: | 1929 L3: |
1931 if (len) | 1930 if (len) |
1932 { | 1931 { |
1933 usMaxbytes += len * usSize; | 1932 usMaxbytes += len * usSize; |
1934 c.IEV1.as.bytes = cast(char*)realloc(c.IEV1.as.bytes,usMaxbytes); | 1933 c.IEV1.as.bytes = cast(char*)GC.realloc(c.IEV1.as.bytes,usMaxbytes); |
1935 memcpy(c.IEV1.as.bytes + usBytes,asmtok.ustring,len); | 1934 memcpy(c.IEV1.as.bytes + usBytes,asmtok.ustring,len); |
1936 | 1935 |
1937 char* p = c.IEV1.as.bytes + usBytes; | 1936 char* p = c.IEV1.as.bytes + usBytes; |
1938 for (size_t i = 0; i < len; i++) | 1937 for (size_t i = 0; i < len; i++) |
1939 { | 1938 { |