From 8eb2c4f7c0aed11810280c6dfa63f75fd961e3cd Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 2 Feb 2019 07:35:06 +0000 Subject: hlmod: make into a singleton It turns out there's no point in having multiple instances of this or having to worry about destruction or destruction ordering. This will make it easier to reuse the one instance we have across different modules. --- t/hl_mod.t | 15 --------------- 1 file changed, 15 deletions(-) (limited to 't') diff --git a/t/hl_mod.t b/t/hl_mod.t index 238f8ec5..f2eb5f91 100644 --- a/t/hl_mod.t +++ b/t/hl_mod.t @@ -40,19 +40,4 @@ my $orig = $str; } } -my $nr = $ENV{TEST_MEMLEAK}; -if ($nr && -r "/proc/$$/status") { - my $fh; - open $fh, '<', "/proc/$$/status"; - diag "starting at memtest at ".join('', grep(/VmRSS:/, <$fh>)); - PublicInbox::HlMod->new->do_hl(\$orig) for (1..$nr); - open $fh, '<', "/proc/$$/status"; - diag "creating $nr instances: ".join('', grep(/VmRSS:/, <$fh>)); - my $hls = PublicInbox::HlMod->new; - $hls->do_hl(\$orig) for (1..$nr); - $hls = undef; - open $fh, '<', "/proc/$$/status"; - diag "reused instance $nr times: ".join('', grep(/VmRSS:/, <$fh>)); -} - done_testing; -- cgit v1.2.3-24-ge0c7