[Gc] GC hooks.

Fergus Henderson fjh@cs.mu.oz.au
Thu, 29 May 2003 02:35:29 +1000


On 28-May-2003, Miguel de Icaza <miguel@ximian.com> wrote:
> Index: include/gc.h
...
> +typedef struct
> +{
> +	void (* initialize) (void);
> +
> +	void (* stop_world) (void);
> +	void (* push_all_stacks) (void);
> +	void (* start_world) (void);
> +} GCThreadFunctions;
> +
> +extern GCThreadFunctions *gc_thread_vtable;

There should be some comments there explaining who is allowed to
modify the gc_thread_vtable structure, and what the meaning of
each of the fields is -- what each function does.

Those prototypes should probably use the GC_PROTO() macro.

> +++ linux_threads.c	16 May 2003 23:49:08 -0000
...
> +static void linux_stop_world()
>
> +static void linux_start_world()
...
> +static void linux_push_all_stacks()

There should be prototypes for those functions.
The collector's sources are not very good in this respect,
but in modern-day C, there should be a function prototype for every function.

> +GCThreadFunctions linux_thread_vtable = {

That variable should be declared "static".

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.