Pointer stability with realloc() and virtual memory

Hi All,

I have bunch of related questions regarding how realloc() and memory in general works on the Playdate.

  1. Does the Playdate support virtual memory? I cannot seem to find whether the Cortex M7 does or not.

  2. If the answer to 1) is yes, does realloc() return committed memory, or does it just reserve address space like it does on standard desktop OSs? If the answer to 1) is no, I assume it just returns physical/comitted memory back, right?

  3. If you realloc() on existing memory, can all the pointers stemming off of the original allocation potentially be invalidated?

If it’s helpful: realloc works much the same way as in stdlib afaik.

It does not support virtual memory. Cortex-M7 lacks an MMU.

This perfectly answered my questions, thanks! So pointers can be invalidated like in stdlib when reallocing on existing memory. And also treat all memory returned as "committed" (since its just physical memory).

Yep. Can probably test this pretty easily too.