allocator: heap_quarantine_empty int return
diff --git a/sdk/core/allocator/main.cc b/sdk/core/allocator/main.cc index 3b8e6cd..359134c 100644 --- a/sdk/core/allocator/main.cc +++ b/sdk/core/allocator/main.cc
@@ -852,7 +852,7 @@ return cap->quota; } -__cheriot_minimum_stack(0xc0) void heap_quarantine_empty() +__cheriot_minimum_stack(0xc0) int heap_quarantine_empty() { STACK_CHECK(0xc0); LockGuard g{lock}; @@ -866,6 +866,8 @@ yield(); g.lock(); } + + return 0; } __cheriot_minimum_stack(0x210) void *heap_allocate(Timeout *timeout,
diff --git a/sdk/include/stdlib.h b/sdk/include/stdlib.h index 2dca318..26e5180 100644 --- a/sdk/include/stdlib.h +++ b/sdk/include/stdlib.h
@@ -281,8 +281,12 @@ * This should be used only in testing, to place the system in a quiesced * state. It can block indefinitely if another thread is allocating and * freeing memory while this runs. + * + * Returns 0 on success, a compartment invocation failure indication + * (-ENOTENOUGHSTACK, -ENOTENOUGHTRUSTEDSTACK) if it cannot be invoked, or + * possibly -ECOMPARTMENTFAIL if the allocator compartment is damaged. */ -void __cheri_compartment("alloc") heap_quarantine_empty(void); +int __cheri_compartment("alloc") heap_quarantine_empty(void); /** * Returns true if `object` points to a valid heap address, false otherwise.