RE: class gc (fwd)

Date view Thread view Subject view Author view

From: Parmelan, Edouard (EP510777@exchange.FRANCE.NCR.com)
Date: Thu Dec 17 1998 - 12:24:50 EST


Godmar,

> We save and restore the stack pointer when we switch threads.
This is normal :)

> Besides, the interpreter loop uses alloca and it works.
Realy ? with witch implementation of alloca() ?

If I'm not wrong, GNU alloca() use the stack pointer
and keep a global link list of all allocated block.
If sp < sp-when-allocated, it frees the block.
(change 'less than' by 'greater than' with the other
stack direction)

The problem is:
all the stack of Thread-A < all the stack of Thread-B

So if alloca() is called in Thread-B, next alloca() called
in Thread-A free all block allocated by Thread-B because
sp < sp-when-allocated.

[When I write sp, it's the stack frame aka ebp for i386]

>
> - Godmar


Date view Thread view Subject view Author view

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