Mercurial > projects > ddmd
comparison dmd/StringExp.d @ 180:0622fff7810a
Fixed a few memory allocation related issues
author | korDen |
---|---|
date | Sun, 17 Oct 2010 23:23:28 +0400 |
parents | e3afd1303184 |
children | b0d41ff5e0df |
comparison
equal
deleted
inserted
replaced
179:cd48cb899aee | 180:0622fff7810a |
---|---|
856 { | 856 { |
857 e = el_calloc(); | 857 e = el_calloc(); |
858 e.Eoper = OPER.OPstring; | 858 e.Eoper = OPER.OPstring; |
859 static if (true) { | 859 static if (true) { |
860 // Match MEM_PH_FREE for OPstring in ztc\el.c | 860 // Match MEM_PH_FREE for OPstring in ztc\el.c |
861 e.EV.ss.Vstring = cast(char*)GC.malloc((len + 1) * sz); /// ! | 861 e.EV.ss.Vstring = cast(char*)malloc((len + 1) * sz); |
862 memcpy(e.EV.ss.Vstring, string_, (len + 1) * sz); | 862 memcpy(e.EV.ss.Vstring, string_, (len + 1) * sz); |
863 } else { | 863 } else { |
864 e.EV.ss.Vstring = cast(char*)string_; | 864 e.EV.ss.Vstring = cast(char*)string_; |
865 } | 865 } |
866 e.EV.ss.Vstrlen = (len + 1) * sz; | 866 e.EV.ss.Vstrlen = (len + 1) * sz; |