March 19, 2004 Object's memory layout | ||||
---|---|---|---|---|
| ||||
Hallo Walter, could you please tell us how a vtbl of an D object looks like? Object's vtbl has 6 elements I would assume: this() void print() char[] toString() uint toHash() int opCmp(Object o) int opEquals(Object o) If that's correct why do you have a special pointer to the destructor? What does the init value, inside ClassInfo, do? Stephan |
March 19, 2004 Re: Object's memory layout | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stephan Wienczny | "Stephan Wienczny" <wienczny@web.de> wrote in message news:c3dh25$2gk9$1@digitaldaemon.com... > Hallo Walter, > > could you please tell us how a vtbl of an D object looks like? > Object's vtbl has 6 elements > I would assume: > this() > void print() > char[] toString() > uint toHash() > int opCmp(Object o) > int opEquals(Object o) obj2asm yields pretty good info on this <g>. But the vtbl[] is pretty simple - the first entry is the address of the classinfo, and the rest are the virtual functions, in order. > If that's correct why do you have a special pointer to the destructor? It doesn't. > What does the init value, inside ClassInfo, do? Provides the .init property value for the class object, which is the default initialization for each of the members. |
Copyright © 1999-2021 by the D Language Foundation