[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 20:19:10 PST 2009


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



--- Comment #3 from Steven Schveighoffer <schveiguy at yahoo.com> 2009-12-22 20:19:09 PST ---
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.

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

Preallocation needs to be a runtime function that is yet to be written which
allocates a large block but sets the "allocated" size to 0.  It can also avoid
pre-initializing the block if the block has no pointers (something that the old
trick didn't do).

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