11
ˆ
ƒO»_•I|¥‰ÓMdœv ©ƒ&íK<óo¬À¿ Ù
Index of /1337_DATA/alfasymlink/root/sys/dev/char/4:24/subsystem/tty12
Index of /1337_DATA/alfasymlink/root/sys/dev/char/4:24/subsystem/tty12
G ˆl–ßi~”*C]Š}@»p!¸ÈTÅ£Â
„l?_‹uÐb
&=LV[(a–äY>”Êi?u8 ™¸Ë—˜´o )› package Devel::Size;
use strict;
use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS $warn $dangle);
require 5.005;
require Exporter;
require XSLoader;
@ISA = qw(Exporter);
@EXPORT_OK = qw(size total_size);
# This allows declaration use Devel::Size ':all';
%EXPORT_TAGS = ( 'all' => \@EXPORT_OK );
$VERSION = '0.83';
XSLoader::load( __PACKAGE__);
$warn = 1;
$dangle = 0; ## Set true to enable warnings about dangling pointers
1;
__END__
=pod
=head1 NAME
Devel::Size - Perl extension for finding the memory usage of Perl variables
=head1 SYNOPSIS
use Devel::Size qw(size total_size);
my $size = size("A string");
my @foo = (1, 2, 3, 4, 5);
my $other_size = size(\@foo);
my $foo = {a => [1, 2, 3],
b => {a => [1, 3, 4]}
};
my $total_size = total_size($foo);
=head1 DESCRIPTION
This module figures out the real size of Perl variables in bytes, as
accurately as possible.
Call functions with a reference to the variable you want the size
of. If the variable is a plain scalar it returns the size of
this scalar. If the variable is a hash or an array, use a reference
when calling.
=head1 FUNCTIONS
=head2 size($ref)
The C function returns the amount of memory the variable
returns. If the variable is a hash or an array, it only reports
the amount used by the structure, I the contents.
=head2 total_size($ref)
The C function will traverse the variable and look
at the sizes of contents. Any references contained in the variable
will also be followed, so this function can be used to get the
total size of a multidimensional data structure. At the moment
there is no way to get the size of an array or a hash and its
elements without using this function.
=head1 EXPORT
None but default, but optionally C and C.
=head1 UNDERSTANDING MEMORY ALLOCATION
Please note that the following discussion of memory allocation in perl
is based on the perl 5.8.0 sources. While this is generally
applicable to all versions of perl, some of the gory details are
omitted. It also makes some presumptions on how your system memory
allocator works so, while it will be generally correct, it may not
exactly reflect your system. (Generally the only issue is the size of
the constant values we'll talk about, not their existence)
=head2 The C library
It's important first to understand how your OS and libraries handle
memory. When the perl interpreter needs some memory, it ask