in reply to Re^6: Why is the size even bigger after pack?
in thread Why is the size even bigger after pack?
No, the SV body isn't created at all for SVt_IV scalars.
A SV usually has a head block and a body block (that's in addition to any string buffer, etc). SVt_IV scalars, rather exceptionally, don't have a body. Or rather they have a body, but it's location overlaps the head so that it never needs to be allocated.
5.12, 64 bit ints, 64 bit floats - - -+ <---+ : | : +04 | Usual SV head SVt_IV : | --> +-----------------+ --> +-----------------+ +08 | | Pointer to body ------+ | Pointer to body ------+ +04 | | | +04 | | +0C | | | | | +08 +-----------------+ | +08 +-----------------+ +10 | REFCNT | | | REFCNT | +0C +-----------+-----+ | +0C +-----------+-----+ +14 | FLAGS | SVt | | | FLAGS | SVt | +10 +-----------+-----+ | +10 +-----------+-----+ +18 | PV ---> +---------- | | IV/UV | +14 | | ... | +14 | | +1C | +---------- | | | +18 +-----------------+ | +18 +-----------------+ +20 | Usual SV body | +-----------------+ <---+ | NV | | | +04 | | +-----------------+ +08 | CUR | | | +0C | | +-----------------+ +10 | LEN | | | +14 | | +-----------------+ +18 | IV/UV | | | +1C | | +-----------------+ +20
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Why is the size even bigger after pack?
by PerlOnTheWay (Monk) on Nov 04, 2011 at 03:43 UTC | |
by ikegami (Patriarch) on Nov 04, 2011 at 07:27 UTC |