[Issue 11139] malloc/emplace resulting in memory corruption

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 4 01:09:10 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=11139



--- Comment #11 from Iain Buclaw <ibuclaw at ubuntu.com> 2013-11-04 01:09:06 PST ---
(In reply to comment #9)
> Ignore the above comment, if I add GC.addRange(tmp, size) after line 24 it
> stops segfaulting.

No need to debug this, it's quite obvious what's going on (see my first
comment).  Don't think there's any real *fix* here other than using GC.malloc
to allocate the memory instead of cstdlib.malloc.

The GC does not track memory allocated outside of the GC, and it is unwise to
think that GC'd memory is safe from collection if it's only being referenced by
raw malloc'd memory.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list