Revert "lists: Add list literal doc example."
[factor.git] / vm / mvm-windows.cpp
blobe90538d11af5b53054aefc92e18b4791e315c373
1 #include "master.hpp"
3 namespace factor {
5 HANDLE boot_thread;
7 DWORD current_vm_tls_key;
9 void init_mvm() {
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);