71static inline AllocatorCapability
94ssize_t __cheri_compartment(
"allocator")
95 heap_claim(AllocatorCapability heapCapability,
void *pointer);
117 const
void *ptr2 __if_cxx(=
nullptr));
119__attribute__((deprecated(
"heap_claim_fast was a bad name. This function has "
120 "been renamed heap_claim_ephemeral")))
121__always_inline static
int
122heap_claim_fast(TimeoutArgument timeout,
124 const
void *ptr2 __if_cxx(=
nullptr))
136ssize_t __cheri_compartment(
"allocator")
146int __cheri_compartment(
"allocator")
154ssize_t __cheri_compartment(
"allocator")
182__attribute__((overloadable))
int __cheri_compartment(
"allocator")
int heap_quarantine_flush(TimeoutArgument timeout)
Try to empty the quarantine and defragment the heap.
static int heap_quarantine_empty()
Run heap_quarantine_flush with unlimited timeout.
static AllocatorCapability allocator_permissions_and(AllocatorCapability heapCapability, int permissions)
Returns a copy of heapCapability with a subset of permissions.
size_t heap_available(void)
Returns the total available space in the heap.
ssize_t heap_free_all(AllocatorCapability heapCapability)
Free all allocations owned by this capability.
AllocatorPermission
Permission bits for allocator capabilities.
@ AllocatorPermitUnused
Unused permissions bit.
@ AllocatorPermitFreeAll
This allocator capability may be used to free all allocations made using its quota via heap_free_all.
@ AllocatorPermitAllocate
This allocator capability may be used to perform allocations and make claims using its quota.
@ AllocatorPermitFull
This allocator capability is fully permissioned.
@ AllocatorPermitNone
This allocator capability is fully de-permissioned.
int heap_render()
Dump a textual rendering of the heap's structure to the debug console.
static int allocator_permissions(AllocatorCapability heapCapability)
Returns the permissions held by this allocator capability.
ssize_t heap_quota_remaining(AllocatorCapability heapCapability)
Returns the space available in the given quota.
ssize_t heap_claim(AllocatorCapability heapCapability, void *pointer)
Add a claim to an allocation.
int __cheri_libcall heap_claim_ephemeral(TimeoutArgument timeout, const void *ptr, const void *ptr2)
Interface to the ephemeral claims mechanism.
int heap_can_free(AllocatorCapability heapCapability, void *ptr)
Returns 0 if the allocation can be freed with the given capability, -EPERM if heapCapability is not v...
The public view of state represented by a capability that is used to authorise heap allocations.
This file contains the types used for timeouts across scheduler APIs.
static const AbsoluteMonotonicTimeout TimeoutWaitForever
Timeout value for unlimited blocking.
APIs for dealing with type-safe opaque handles (sealed objects).
static int token_permissions_get(CHERI_SEALED(void *) object)
Returns the user permissions bitmap for the sealed object.
token_permissions_and(CHERI_SEALED(T *) object, int permissions)
Mask the user permissions of a sealed object.