7 DWORD current_vm_tls_key
;
10 if ((current_vm_tls_key
= TlsAlloc()) == TLS_OUT_OF_INDEXES
)
11 fatal_error("TlsAlloc() failed", 0);
14 void register_vm_with_thread(factor_vm
* vm
) {
15 if (!TlsSetValue(current_vm_tls_key
, vm
))
16 fatal_error("TlsSetValue() failed", 0);
19 factor_vm
* current_vm_p() {
20 return (factor_vm
*)TlsGetValue(current_vm_tls_key
);