Description
So I've been thinkng about this, and I think it would be possible to have some type of scratch allocator which could be used inside interrupt handlers.
The actual scratch buffer would be allocated outside of the interrupt and somehow associated with the handler.
When the handler runs it would put the registered handler on top of a list of allocators. When a memory allocation is required, it would either use the scratch allocator, or if none were present, use the heap allocator. The scrath allocator would basically just increment a pointer by the number of bytes being allocated, as long as that number of bytes still exists in the scratch buffer,
Each time the interrupt fires, it would reset the scratch buffer.
I just thought I'd throw this out as an idea.