If we're on a 64-bit machine, the SV headers are always more than 12 bytes, so using 12 as my divisor is safe?(Do they becomes 16 or 24 bytes on 64-bit systems?)
SVs (and their friends AVs, HVs, etc) are defined in sv.h. They look like:
(AVs, HVs, etc, look the same, except they have a differently typed pointer as the first member of the struct). So their size is 8 bytes (assuming 8 bit bytes), plus the size of a pointer. On a system with 64 bits of addressable memory, pointers will be 8 bytes, giving a struct size of 16 bytes.struct STRUCT_SV { /* struct sv { */ void* sv_any; /* pointer to something */ U32 sv_refcnt; /* how many references to us */ U32 sv_flags; /* what we are */ };
As for your other memory related questions, I think you have to dive into malloc.c in the Perl source to get your answer. I looked in the file, and it looks like it's written by someone not familiar with the rest of the perl source code: it actually has large comment sections.
In reply to Re^3: Circular reference testing.
by Anonymous Monk
in thread Circular reference testing.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |