//**************************************************************************************************
//
// AUTOMATIC FREE FOR TASK MEMORY — PREPROCESSOR:
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// RuntimeForStatic base library | C+- (SysRoutine) | Author: Sergei Y.Kitáev
#pragma once
#include "include_restrictions.h"

//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//
// TASK MEMORY AUTO-FREE CREATION DEFS:
//
//==================================================================================================
// SINGLE POINTER (TASK MEMORY AUTO-FREE):

#define $TASKMEM_AUTO( pointer ) \
   RuntimeForStatic::$TaskMemAuto $IDENT_AUTO($taskmem_auto_)($, ($PPVoid)&(pointer) )

#define $TASKMEM_AUTO_VAR( variable, pointer ) \
   RuntimeForStatic::$TaskMemAuto variable($, ($PPVoid)&(pointer) )

//--------------------------------------------------------------------------------------------------
// ARRAY OF POINTERS (TASK MEMORY AUTO-FREE):

#define $TASKMEM_AUTO_2( p1, p2 ) \
   RuntimeForStatic::$TaskMemAutoArray $IDENT_AUTO($taskmem_auto_array_)($, \
      { ($PPVoid)&(p1), ($PPVoid)&(p2) } )
#define $TASKMEM_AUTO_3( p1, p2, p3 ) \
   RuntimeForStatic::$TaskMemAutoArray $IDENT_AUTO($taskmem_auto_array_)($, \
      { ($PPVoid)&(p1), ($PPVoid)&(p2), ($PPVoid)&(p3) } )
#define $TASKMEM_AUTO_4( p1, p2, p3, p4 ) \
   RuntimeForStatic::$TaskMemAutoArray $IDENT_AUTO($taskmem_auto_array_)($, \
      { ($PPVoid)&(p1), ($PPVoid)&(p2), ($PPVoid)&(p3), ($PPVoid)&(p4) } )
#define $TASKMEM_AUTO_5( p1, p2, p3, p4, p5 ) \
   RuntimeForStatic::$TaskMemAutoArray $IDENT_AUTO($taskmem_auto_array_)($, \
      { ($PPVoid)&(p1), ($PPVoid)&(p2), ($PPVoid)&(p3), ($PPVoid)&(p4), ($PPVoid)&(p5) } )
#define $TASKMEM_AUTO_6( p1, p2, p3, p4, p5, p6 ) \
   RuntimeForStatic::$TaskMemAutoArray $IDENT_AUTO($taskmem_auto_array_)($, \
      { ($PPVoid)&(p1), ($PPVoid)&(p2), ($PPVoid)&(p3), ($PPVoid)&(p4), ($PPVoid)&(p5), \
        ($PPVoid)&(p6) } )
#define $TASKMEM_AUTO_7( p1, p2, p3, p4, p5, p6, p7 ) \
   RuntimeForStatic::$TaskMemAutoArray $IDENT_AUTO($taskmem_auto_array_)($, \
      { ($PPVoid)&(p1), ($PPVoid)&(p2), ($PPVoid)&(p3), ($PPVoid)&(p4), ($PPVoid)&(p5), \
        ($PPVoid)&(p6), ($PPVoid)&(p7) } )
#define $TASKMEM_AUTO_8( p1, p2, p3, p4, p5, p6, p7, p8 ) \
   RuntimeForStatic::$TaskMemAutoArray $IDENT_AUTO($taskmem_auto_array_)($, \
      { ($PPVoid)&(p1), ($PPVoid)&(p2), ($PPVoid)&(p3), ($PPVoid)&(p4), ($PPVoid)&(p5), \
        ($PPVoid)&(p6), ($PPVoid)&(p7), ($PPVoid)&(p8) } )
#define $TASKMEM_AUTO_9( p1, p2, p3, p4, p5, p6, p7, p8, p9 ) \
   RuntimeForStatic::$TaskMemAutoArray $IDENT_AUTO($taskmem_auto_array_)($, \
      { ($PPVoid)&(p1), ($PPVoid)&(p2), ($PPVoid)&(p3), ($PPVoid)&(p4), ($PPVoid)&(p5), \
        ($PPVoid)&(p6), ($PPVoid)&(p7), ($PPVoid)&(p8), ($PPVoid)&(p9) } )
#define $TASKMEM_AUTO_10( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 ) \
   RuntimeForStatic::$TaskMemAutoArray $IDENT_AUTO($taskmem_auto_array_)($, \
      { ($PPVoid)&(p1), ($PPVoid)&(p2), ($PPVoid)&(p3), ($PPVoid)&(p4), ($PPVoid)&(p5), \
        ($PPVoid)&(p6), ($PPVoid)&(p7), ($PPVoid)&(p8), ($PPVoid)&(p9), ($PPVoid)&(p10) } )

//==================================================================================================
