CHERIoT-Platform/cheriot-rtos

Create sub-quotas for allocation capabilities

Open

#140 opened on Nov 29, 2023

View on GitHub
 (2 comments) (0 reactions) (0 assignees)C++ (66 forks)auto 404
good first issue

Repository metrics

Stars
 (163 stars)
PR merge metrics
 (PR metrics pending)

Description

The allocator currently deals with static heap quotas. Sometimes it's useful to allow another compartment to allocate memory on your behalf, but not to consume your entire quota. We should allow a mechanism for creating a new quota object that contains part of an existing quota. This should have the same ID as the original, so that objects can be freed in both.

The main complication in this is that, currently, quotas are checked without the allocator lock being held (I think). We need to make sure that the mechanism is robust in the presence of a quota being deallocated during an allocation or deallocation operation.

Contributor guide