home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / NFSRC305.ZIP / C / IDLE.C < prev    next >
Encoding:
Text File  |  1995-05-01  |  1.8 KB  |  66 lines

  1. /*
  2.  * File......: IDLE.C
  3.  * Author....: Ted Means (with much gratitude to Robert DiFalco)
  4.  * CIS ID....: 73067,3332
  5.  *
  6.  * This function is an original work by Ted Means and is placed in the
  7.  * public domain.
  8.  *
  9.  * Modification history:
  10.  * ---------------------
  11.  *
  12.  *    Rev 1.0   01 Jan 1995 03:01:00   TED
  13.  * Initial release
  14.  *
  15.  */
  16.  
  17.  
  18. /*  $DOC$
  19.  *  $FUNCNAME$
  20.  *     FT_Idle()
  21.  *  $CATEGORY$
  22.  *     Event
  23.  *  $ONELINER$
  24.  *     Generate an idle event to allow incremental garbage collection.
  25.  *  $SYNTAX$
  26.  *     FT_Idle()
  27.  *  $ARGUMENTS$
  28.  *     None
  29.  *  $RETURNS$
  30.  *     NIL
  31.  *  $DESCRIPTION$
  32.  *     During memory-intensive operations that do not generate much in
  33.  *     the way of idle states, the Clipper runtime may not get a chance to
  34.  *     perform garbage collection of discarded memory.  This can eventually
  35.  *     lead to any of a variety of memory-related internal errors.
  36.  *
  37.  *     This function attempts to alleviate the problem by providing a
  38.  *     mechanism by which an idle event can be artifically generated at
  39.  *     will.  The idle event will cause the CA-Clipper runtime to perform
  40.  *     an incremental memory scavenge.
  41.  *
  42.  *     This function makes use of an undocumented interal routine.  If this
  43.  *     this fact makes you uncomfortable then don't use this function, you
  44.  *     miserable jello-spined lump of human debris.
  45.  *  $EXAMPLES$
  46.  *
  47.  *     while Whatever         // Some batch process
  48.  *
  49.  *       Something()          // Create 'n' discard a bunch of stuff
  50.  *
  51.  *       FT_Idle()            // Take out the garbage
  52.  *
  53.  *     end
  54.  *  $SEEALSO$
  55.  *     FT_OnIdle()
  56.  *  $END$
  57.  */
  58.  
  59. void _evSendId( unsigned int, unsigned int );
  60.  
  61. void pascal FT_Idle( void )
  62. {
  63.    _evSendId( 0x5108, 0xFFFF );
  64.  
  65.    return;
  66. }