Information about the 'magic' field in object.Object class
realhet
real_het at hotmail.com
Thu Jan 16 14:30:04 UTC 2020
Hello,
I'm try to figure out the contents od the base class instance in
D, LDC Windows 64bit.
I'm sure that there is a 8 byte VMT pointer.
But unable to fund information about the remaining 8 byte. I
guess it must be a unique 8byte (void* ?) identifier that is
useful for Monitor. In a video someone mentioned this as 'magic'.
Is there a documentation about that 'magic' field? I'd love to
use some bits in it if I'm sure about the consequences.
I have a really small object, only 32 bytes. At this point if I
want to add a flag bit I have 3 choices:
- add a new field to the class -> effectively the instanceSize
will grow by 50% (16bytes with alignment)
- compress the current 16bytes of data. -> eats more cpu
- Hide it somewhere 'magically'.
Thank You in advance!
More information about the Digitalmars-d-learn
mailing list