logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Math::Prime::Util::MemFree - An auto-free object for Math::Prime::Util

Authors

       Dana Jacobsen <dana@acm.org>

Description

       This is a more robust way of making sure any cached memory is freed, as it will be handled by the last
       "MemFree" object leaving scope.  This means if your routines were inside an eval that died, things will
       still get cleaned up.  If you call another function that uses a MemFree object, the cache will stay in
       place because you still have an object.

Functions

new
       Creates a new auto-free object.  This object has no methods and has no data.  When it leaves scope it
       will call "prime_memfree", thereby releasing any extra memory that the Math::Prime::Util module may have
       allocated.

       Memory is not freed until the last object goes out of scope.  "prime_memfree" may always be called
       manually.  All memory is freed at "END" time, so this is mainly for long running programs that want extra
       control over memory use.

Name

       Math::Prime::Util::MemFree - An auto-free object for Math::Prime::Util

Synopsis

         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.

Version

       Version 0.73

See Also