In src/os/windows/vm/os_windows.cpp, the code for os::allocate_thread_local_storage() is
int os::allocate_thread_local_storage() {
return TlsAlloc();
}
It would be better to assert if Windows runs out of TLS slots, vis.
int os::allocate_thread_local_storage() {
int key = TlsAlloc();
assert(key != TLS_OUT_OF_INDEXES, "cannot allocate thread local storage");
return key;
}
int os::allocate_thread_local_storage() {
return TlsAlloc();
}
It would be better to assert if Windows runs out of TLS slots, vis.
int os::allocate_thread_local_storage() {
int key = TlsAlloc();
assert(key != TLS_OUT_OF_INDEXES, "cannot allocate thread local storage");
return key;
}