chore: align lifetimes for shortcuts

main
Sean McBride 5 years ago
parent fa5f254af1
commit 0e6c77d923

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