harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Fursov" <mike.fur...@gmail.com>
Subject Re: [drlvm][gc] TLS access from GC: a proposal to refactor the code
Date Wed, 25 Oct 2006 08:00:27 GMT
On 10/25/06, Xiao-Feng Li <xiaofeng.li@gmail.com> 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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message