home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / sys / gc_lib / m68k-amigaos.c < prev    next >
C/C++ Source or Header  |  1999-06-05  |  655b  |  22 lines

  1. /* GC code for AmigaOS/68k by Rudi Chiarito <chiarito@cli.di.unipi.it>
  2.  * Contrary to what m68k.c implies, SP *decreases* as the stack grows!
  3.  * Tested with SAS/C 6, to be tested with GCC, DICE, Storm and others.
  4.  *
  5.  * NOTE: the current collection algorithm only works with a CONTIGUOUS
  6.  * stack. I.e. use garbage collection WITHOUT ENABLING AUTOMATIC STACK
  7.  * EXTENSION. Stack overflow checking can (SHOULD) be enabled, though.
  8.  */
  9.  
  10. void mark_stack_and_registers(void){
  11.   void**sp;
  12. #ifdef __SASC
  13.   #include <dos.h>
  14.   sp=(void**)getreg(REG_A7);
  15. #else
  16.   void*stack_top[2]={NULL,NULL};
  17.   sp=stack_top;
  18. #endif
  19.   for (;sp<=stack_bottom;sp++) gc_mark(*sp);
  20. }
  21.  
  22.