// Garbage Collector Definitions // // File: gc.h // Author: {your name} <{your e-mail address}> // Assignment: 9 // This is the ONLY .h file you modify. You make // additions to it in assignment 9. // This code is used only by modules that define new // types of LISP object. #ifndef GC_H #define GC_H #include "object.h" class garbage_collector { public: // This class has only static members and friends // and no instances. // Garbage collect, no matter what. // friend void gc(); // Gc's occur every gc_limit allocations. You can // get and set gc_limit with these functions. // friend unsigned long int set_gc_limit (unsigned long lim); friend unsigned long int gc_limit (); // Replace these two lines with your own friends // and static functions. private: static unsigned long limit; // gc_limit value. // Replace these two lines with any static // data you desire. }; // Inline implementations of above. See above for // documentation. inline unsigned long int set_gc_limit (unsigned long lim) { return garbage_collector::limit = lim; } inline unsigned long int gc_limit () { return garbage_collector::limit; } // Replace these two lines with any inline function // implementations you desire. #endif // GC_H