Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hal::set_exception_allocator(Callable&) #7

Closed
kammce opened this issue Feb 17, 2024 · 2 comments
Closed

Add hal::set_exception_allocator(Callable&) #7

kammce opened this issue Feb 17, 2024 · 2 comments
Labels
⚡️ enhancement New feature or request

Comments

@kammce
Copy link
Member

kammce commented Feb 17, 2024

Such a callable may have a signature such as this:

void* memory_handler(size_t p_object_size, bool p_allocate);

Bool parameters are not advised but this sells the point. If allocating, the void* is returned out from __cxa_allocate_exception. If deallocating, then the return value is ignored. Allocating exception memory should set the data to all zeros before returning it. Memory CAN be memset to zero for deallocating the memory, but isn't required. This is the base idea. This can change as implementation begins.

@kammce kammce added the ⚡️ enhancement New feature or request label Feb 17, 2024
@kammce
Copy link
Member Author

kammce commented Mar 22, 2024

I don't remember the rationale or motivation for this. I think using PMR is the right choice even though its a bit annoying to deal with the fact that PMR provides you the size as well.

@kammce
Copy link
Member Author

kammce commented Mar 22, 2024

Replaced by #20

@kammce kammce closed this as completed Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚡️ enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant