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


Alex R�nne Petersen <a...@lycus.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |a...@lycus.org


--- Comment #1 from Alex R�nne Petersen <a...@lycus.org> 2012-05-24 12:46:56 
CEST ---
The idea in and of itself is not bad. In fact, it would make debugging
wonderfully easy. My only concern is this: Object size. We already store two
words of memory in *every single object header*. This means 8 bytes on 32-bit
and 16 bytes on 64-bit.

Now suppose we added an extra bool field to Object. Not only would the compiler
have to be changed to align fields correctly, but it would also result in
objects eating 12 bytes on 32-bit and 24 bytes on 64-bit (simply because the GC
only power of two allocations or something along those lines).

Now, the memory concern is not a problem for a class like this:

class A
{
    bool b;
    short s;
}

Obviously we don't need word alignment here, and we could probably optimize
given that. But consider:

class B
{
    A a;
}

Suddenly that bool field has to suck an entire machine word's worth of space
for 'a' to be aligned correctly.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to