in reply to Re^14: Techniques On Saving Memory
in thread Techniques On Saving Memory
Now I recall what I was looking for: Array::RefElem. Here is the same operation which uses an array's internal pointer array to good use vs using a string as a perl-artificial pointer array.
av_store( @foo, 1, $bar ); $baz = \ $foo[ 1 ]; $baz == \ $bar; VS 4 == length( pack( 'N', 0 ) ); substr( $foo, 4 * 1, 4, pack( 'N', 0 + \ $bar ); # Increment the refcount of $bar somehow. $baz = \ Devel::Pointer::unsmash_sv( unpack( 'N', substr( $foo, 4 * 1, + 4 ) ) ); $baz == \ $bar;
UpdateD: Previously, I mispelled Array::RefElem as Array::RefElement and the search.cpan.org link wouldn't work.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^16: Techniques On Saving Memory
by BrowserUk (Patriarch) on Mar 21, 2005 at 01:23 UTC |