Speed up method lookup. Replaced tagging/detagging macros with
[panda.git] / docs / object-memory.txt
blob824854893d5cffde746e26479bc0b3d60c5083aa
1 Object Memory Layout
2 ----------------------
4 Legend
5 -------
6 mark: isLargeContext (1 bit), instanceSize (8 bits), format (8 bits), tag (2 bits)
7 class oop: reference to instance class
9 Normal Object
11 [ mark             ]
12 [ class            ]
13 [ instance vars    ] 0...N
15 Array Object
17 [ mark               ]
18 [ class              ]
19 [ size               ]
20 [ elements           ] 0...N
22 ByteArray Object
24 [ mark                ]
25 [ class               ]
26 [ size                ]
27 [ bytes               ] 0...N (padded to a multiple of oop size)
29 FloatArray Object
31 [ mark                ]
32 [ class               ]
33 [ size                ]
34 [ C `double'          ] 0...N
36 WordArray Object
38 [ mark                ]
39 [ class               ]
40 [ size                ]
41 [ unsigned int        ] 0...N (padded to a multiple of oop size)
43 LargeInteger Object
45 [ mark                ]
46 [ class               ]
47 [ size                ]
48 [ `mp_int' struct     ]