|< 1 2 >| | 15 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use p; # mein package
my $p=p->new ();
$p->x(); # die funktion, sonst nichts
$p=undef;
for (;;) # damit ich mir noch den speicher anschaun kann
{ sleep (1);print "."; }
--------p.pm--------------------------------------
package p;
my $class = shift;
my $self = {};
bless $self, $class;
return $self;
}
sub x()
{
my $x;
my $str = "asfsdafssssssaaaaaadfsaf";
for (my $z=0;$z <1000000; $z++)
{ $x.= $str; }
#tut nichts ausser speicher fressen
}
char var[512];
char *var = new char[512]
delete var
1
2
3
# In FreeBSD 4 and 5 the system malloc is performance-wise
# VERY bad for Perl-- we are talking of differences of not
# one, but TWO magnitudes.
1
2
3
# The system malloc() is about as fast and as frugal as perl's.
# Since the system malloc() has been the default since at least
# 5.001, we might as well leave it that way.
|< 1 2 >| | 15 Einträge, 2 Seiten |