micropython: Add MICROPY_NLR_RAISE_HOOK.

- This can be set from a custom mpconfigport.h file to call
fb_alloc_free or any other needed cleanup before an exception.
- The omvdummy stuff is no longer needed since a default empty
hook is defined.
This commit is contained in:
iabdalkader 2023-10-24 20:35:42 +02:00
parent ec40364ed4
commit c4511338a2
2 changed files with 3 additions and 3 deletions

@ -1 +1 @@
Subproject commit 1f7bd319255924f2d17c40912c61b069503115e2
Subproject commit 7f615a4a0f11e640dac20b8bc748385b4f5f67f3

View File

@ -56,8 +56,8 @@ void fb_alloc_mark() {
// Check if allocation overwrites the framebuffer pixels
if (new_pointer < framebuffer_get_buffers_end()) {
nlr_raise_for_fb_alloc_mark(mp_obj_new_exception_msg(&mp_type_MemoryError,
MP_ERROR_TEXT("Out of fast frame buffer stack memory")));
nlr_jump(MP_OBJ_TO_PTR(mp_obj_new_exception_msg(&mp_type_MemoryError,
MP_ERROR_TEXT("Out of fast frame buffer stack memory"))));
}
// fb_alloc does not allow regions which are a size of 0 to be alloced,