actually there could be interior pointers once string cache is out of scope

This commit is contained in:
Dmitry Olshansky 2013-03-05 23:43:26 +04:00
parent 431dd3c3d2
commit 510b7ca47e
1 changed files with 2 additions and 2 deletions

View File

@ -3082,11 +3082,11 @@ private:
if(size> chunkSize/4) if(size> chunkSize/4)
{ {
ubyte* p = cast(ubyte*)GC.malloc(size, ubyte* p = cast(ubyte*)GC.malloc(size,
GC.BlkAttr.NO_SCAN | GC.BlkAttr.NO_INTERIOR); GC.BlkAttr.NO_SCAN);
return p[0..size]; return p[0..size];
} }
chunkS ~= cast(ubyte*)GC.malloc(chunkSize, chunkS ~= cast(ubyte*)GC.malloc(chunkSize,
GC.BlkAttr.NO_SCAN | GC.BlkAttr.NO_INTERIOR); GC.BlkAttr.NO_SCAN);
next = 0; next = 0;
} }
auto slice = chunkS[$-1][next..next+size]; auto slice = chunkS[$-1][next..next+size];