Re: class gc (fwd)

Date view Thread view Subject view Author view

From: Godmar Back (gback@cs.utah.edu)
Date: Thu Dec 17 1998 - 10:10:32 EST


>
> Godmar,
>
> > I tied all the loose ends together and implemented class garbage
> > collection.
> Good news.
>
> > A particular problem are
> > the 512 byte arrays in the callMethod methods. We might want
> > to consider alloca allocation here.
> Don't use alloca, it use the stack pointer to know
> if it can free a previous allocated block. Don't
> forget that Threads have different stacks: alloca()
> should be broken for this situation:
>
> Thread-A, Stack 0x1000 to 0x3FFF
> Thread-B, Stack 0x4000 to 0x7FFF
>
> Thread-A call alloca() with sp == 0x2000.
>
> jthread switch to Thead-B and call alloca() with
> sp == 0x4000, so memory allocated by Thread-A is
> freed.
>
> jthread switch back to Thread-A and use the freed
> alloca() memory...
>
> Not so good :(
>

 We save and restore the stack pointer when we switch threads.
Besides, the interpreter loop uses alloca and it works.

        - Godmar


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:20 EDT