[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon May 10 12:49:18 1999 
Subject:Re: Garbage collection 
From:Robin Popplestone 
Volume-ID:990510.03 

Robert Goldsmith says:
> It has been suggested that there is a way of informing the
> GC routines of a list of items you wish to be collected (to
> save it having to search for them itself). Can anyone say
> how this is done?

You can use sys_lock_heap to do the opposite, that is to say
to treat all objects currently in Poplog as being in use.
This saves garbage collection time if the heap happens to be
full of things that won't go away,  since the garbage-collector
will stop tracing when it comes to them. Typically one does
this after compiling a big program, since the heap will then
be filled with code-blocks that won't go away.

Explicitly -freeing- an object is dangerous, because the user
may have got it wrong (which is why C-programs can be very buggy).
Garbage collection is a great help in getting programs right,
and shouldn't be tinkered with, praeter necessitatem. [The main
problem is that it is bad for real-time correctness].



RJP