[Issue 4400] D2 GC doesn't allocate with 16 bytes alignment

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 28 05:53:04 PDT 2010


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


Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |schveiguy at yahoo.com
         AssignedTo|sean at invisibleduck.org      |schveiguy at yahoo.com


--- Comment #1 from Steven Schveighoffer <schveiguy at yahoo.com> 2010-06-28 05:52:58 PDT ---
If that is the case, I can change it.  Where does the spec state the GC must
align to 16 bytes?  If that isn't stated, should it be?  I.e. is there a reason
you need 16 byte alignment vs. 8 byte?

BTW, the size it must be above is supposed to be PAGESIZE/2, i.e. 2048 bytes. 
Actually the true size is 2047 because of how I store the length of the block
for appending.

The reason for doing so has to do with the ability of the GC to append
consecutive empty pages to an array pages.  I normally store the length of the
array at the end of the block, but if I did that, the "end of the block" may
change if such an append occurs, which raises the possibility of reading
arbitrary data as the length, so I store the length at the beginning of the
block.  For all blocks <= 2046 bytes, an append that expands the size will do a
copy of the data to a new block, so the block length remains correct.

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