chore: align lifetimes for shortcuts

main
Sean McBride 5 years ago
parent fa5f254af1
commit 0e6c77d923

@ -20,14 +20,18 @@ current_sandbox_get(void)
void
current_sandbox_set(struct sandbox *sandbox)
{
// FIXME: critical-section.
worker_thread_current_sandbox = sandbox;
if (sandbox == NULL) return;
// Thread Local State about the Current Sandbox
sandbox_lmbase = sandbox->linear_memory_start;
sandbox_lmbound = sandbox->linear_memory_size;
module_indirect_table = sandbox->module->indirect_table;
// Unpack hierarchy to avoid pointer chasing
if (sandbox == NULL) {
worker_thread_current_sandbox = NULL;
sandbox_lmbase = NULL;
sandbox_lmbound = 0;
module_indirect_table = NULL;
} else {
worker_thread_current_sandbox = sandbox;
sandbox_lmbase = sandbox->linear_memory_start;
sandbox_lmbound = sandbox->linear_memory_size;
module_indirect_table = sandbox->module->indirect_table;
}
}
/**

Loading…
Cancel
Save