On 10/25/06, Xiao-Feng Li <[EMAIL PROTECTED]> wrote:
Hi, Mikhail, how about this: In GC thread init: gc_tls_data_ptr = malloc_gc_tls_data(sizeof(GC_Thread_Info) ); gc_tls_key = thread_create_tls_key(); thread_set_tls_data( gc_tls_key, gc_tls_data_ptr); To fast alloc: gc_tls_data_ptr = thread_get_tls_data( gc_tls_key); free = *(gc_tls_data_ptr + offset_of_free_in_gc_tls); Can't this work? Sounds like I missed something?
Xiao-Feng, Yes we talking about the same functionality. The problem with your example is that TM has no such an API :) The only method we have is 'hythread_tls_alloc (hythread_tls_key_t* handle);' and it allocates sizeof(void*) bytes in TLS struct. And the method we need is: 'hythread_tls_alloc (hythread_tls_key_t* handle, size_t bytes);' or 'hythread_tls_alloc (hythread_tls_key_t* handle, size_t numSlots);' where numSlots for GC is ~ sizeof(GC_Thread_Info)/sizeof (void*) -- Mikhail Fursov