[Issue 3637] Array append patch to prevent stomping and to enhance thread-local append performance

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 22 15:55:16 PST 2009


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


Leandro Lucarella <llucax at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |llucax at gmail.com


--- Comment #2 from Leandro Lucarella <llucax at gmail.com> 2009-12-22 15:55:14 PST ---
It is really necessary change the GC API to fix this? I think it's a really bad
idea to modify the GC API (add a function) just because dynamic arrays have
problems (I don't want to start over the discussion about dynamic arrays being
broken :).

If you absolutely need this new function: BlkInfo gc_malloc_bi(size_t sz, uint
ba = 0); then maybe it's better to change the existing regular gc_malloc() to:
void*  gc_malloc(size_t sz, uint ba = 0, BlkInfo bi = null);

The advantage is that it's API-backward compatible and doesn't introduce a new
function to the GC API and the downside is it's not binary-backward compatible,
but I don't think people care much about this in D.

The inability to pre-allocate can be a little bad too, but it was awkward
anyway, so providing a better way to do so can be a good thing after all.

-- 
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