Math::...emFree(3pm)
π Math::Prime::Util::MemFree π
bestie. okay so this page lives in the User Contributed Perl Documentation section, and it's a 3pm page, and it's literally just a tiny little auto-free object that ships with Math::Prime::Util. that's it. that's the whole vibe. π
β¨ NAME β¨
Math::Prime::Util::MemFree β an auto-free object for Math::Prime::Util
πΈ VERSION πΈ
Version 0.74 (yes queen, we're on 0.74)
π¦ SYNOPSIS π¦
okay so here's the whole entire move:
use Math::Prime::Util;
{
my $mf = Math::Prime::Util::MemFree->new;
# ... do things with Math::Prime::Util ...
}
# When the last object leaves scope, prime_memfree is called.
like. you make the object. you do your little Math::Prime::Util things. the object goes out of scope. prime_memfree gets called. iconic behavior, honestly. π
π DESCRIPTION π
this is the more robust way of making absolutely sure that any cached memory gets freed, because it's handled by the last MemFree object leaving scope. β¨
and the way that this is actually so smart?? if your routines were inside an eval that died π, things will still get cleaned up. like, no cap. the cleanup happens regardless.
also!! if you call another function that uses a MemFree object, the cache will stay in place, because you still have an object. so nobody's out here freeing memory prematurely. slay.
π₯ FUNCTIONS π₯
π«Ά new
creates a new auto-free object. that's it. that's the function.
this object has no methods and has no data. none. zero. it is purely a vibe. π§
when it leaves scope, it will call prime_memfree, thereby releasing any extra memory that the Math::Prime::Util module may have allocated. π«
π¨ important bestie alert: memory is not freed until the last object goes out of scope. alsoprime_memfreemay always be called manually, so you're never locked in. and all memory is freed atENDtime anyway β so this whole thing is mainly for long running programs that want extra control over memory use. iykyk.
π AUTHORS π
Dana Jacobsen <dana@acm.org>
π COPYRIGHT π
Copyright 2012 by Dana Jacobsen <dana@acm.org>
this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π
and that's the whole page, babe β brought to you by perl v5.42.3, dated 2026-08-20, and it's the Math::...emFree(3pm) page (they truncated the name in the header, not me, blame the formatter π). stay free, stay scoped, periodt. π
β¨
π¦ where this page comes from
- ubuntu stonking: libmath-prime-util-perl 0.74-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms