Original question at the forum
Saving/restoring the state requires saving/restoring two things: heap and mp_state_ctx_t mp_state_ctx;.
Unfortunately it's not as simple as writing/reading those two items to/from persistent storage.
When you restore, the new heap that you create might not be in same memory location as the old heap which means that ``mp_state_ctx_t mp_state_ctx;` must be modified because it contains pointers to location of heap.
Furthermore, the heap could even be of a different size and even a smaller heap is ok in theory (not sure about this).