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. also prime_memfree may always be called manually, so you're never locked in. and all memory is freed at END time 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 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