Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^5: Could we save the memory occupied by "undef" in an array?

by ikegami (Patriarch)
on Nov 23, 2008 at 16:32 UTC ( #725444=note: print w/replies, xml ) Need Help??


in reply to Re^4: Could we save the memory occupied by "undef" in an array?
in thread Could we save the memory occupied by "undef" in an array?

Could you please explain the Dumper output if you have some free time?

By "I think" and "if I read what follows correctly", I meant to communicate that I'm not clear on the details relevant to this conversation. I've already described the relevant details beyond my understanding.

The only other relevant details might be FILL = 3 (4 elements are visible) and MAX = 3 (4 elements have been allocated). Perl sometimes allocate a larger array than it needs to speed up future push statements. It also has the option to speed up pop statements by not resizing the allocated block.

>perl -MDevel::Peek -le"@a=qw(a b c); Dump(\@a, 1); pop @a; Dump(\@a, +1)" SV = RV(0x183c550) at 0x2260b4 REFCNT = 1 FLAGS = (TEMP,ROK) RV = 0x226dbc SV = PVAV(0x22bfcc) at 0x226dbc REFCNT = 2 FLAGS = () IV = 0 NV = 0 ARRAY = 0x1833fc4 FILL = 2 # 0..2 in use MAX = 3 # 0..3 allocated ARYLEN = 0x0 FLAGS = (REAL) SV = RV(0x183c550) at 0x2260a8 REFCNT = 1 FLAGS = (TEMP,ROK) RV = 0x226dbc SV = PVAV(0x22bfcc) at 0x226dbc REFCNT = 2 FLAGS = () IV = 0 NV = 0 ARRAY = 0x1833fc4 FILL = 1 # 0..1 in use MAX = 3 # 0..3 allocated ARYLEN = 0x0 FLAGS = (REAL)

Would you mind if I request you to explain that?

Did you ask the same question twice, or is this a different "that"?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://725444]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2022-01-20 19:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (57 votes). Check out past polls.

    Notices?