MDLCACHE CRITICAL SECTION(): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (displaytitle)
No edit summary
 
Line 1: Line 1:
{{confirm|All subsequent [[model]]s loaded in the current scope will be "cache locked": they won't be flushed if Source starts running out of memory.}}
The '''<code>MDLCACHE_CRITICAL_SECTION()</code>''' macro causes everything loaded into the model cache from its invocation to the end of the current [[W:Scope (computer science)|scope]] to be "cache locked". This prevents the data from being deleted if the engine starts running out of memory.


{{tip|Call <code>mdlcache->EndLock()</code> to end the lock manually.}}
{{todo|When ''wouldn't'' you use this?}}
 
{{tip|Call <code>mdlcache->EndLock()</code> to end the lock early.}}


== See also ==
== See also ==

Latest revision as of 08:04, 16 September 2011

The MDLCACHE_CRITICAL_SECTION() macro causes everything loaded into the model cache from its invocation to the end of the current scope to be "cache locked". This prevents the data from being deleted if the engine starts running out of memory.

Todo: When wouldn't you use this?
Tip.pngTip:Call mdlcache->EndLock() to end the lock early.

See also