[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
Wed Dec 23 09:33:21 PST 2009


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



--- Comment #4 from Leandro Lucarella <llucax at gmail.com> 2009-12-23 09:33:20 PST ---
(In reply to comment #3)
> It's not *necessary* to change the API to fix this, but it is hugely
> advantageous.  If you want to know the block size of the chunk you just
> allocated, the current API requires *another* lock of the GC, and a search
> through the pools.  All the info is there in malloc, it's just not returned.
> 
> BTW, just an additional size parameter would suffice (this is how gcx handles
> the allocation).  Having it return a BlkInfo struct is convenient because that
> is the data type I'm working with when setting allocated length.

Yes, that seems reasonable since BlkInfo is already part of the API.

> And introducing a new function is just as backwards compatible as adding a new
> optional parameter to a current function.

I know that, but it adds complexity to the API, and seems a little weird since
gc_malloc() and gc_malloc_bi() are basically the same.

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