question re: memory allocation size

Sean Kelly sean at f4.ca
Tue Feb 28 13:04:53 PST 2006


Phobos currently allocates one byte more than requested for all but 
object types (ie. for all array allocations), but I haven't been able to 
determine the reason for this.  Is there one?  I had thought that 
perhaps this was to facilitate toStringz conversion except that function 
no longer checks for an existing null terminator--it simply allocates a 
new string and copies.  Assuming there's no specific reason for this, it 
would be nice if the extra byte were not allocated as it inhibits 
attempts to perform power-of-two sized allocation.


Sean



More information about the Digitalmars-d mailing list