Every operation that requires new allocations,
We first to the allocations, and only then mutating the old state.
Example:
give this code:
const ob = createObjectBuffer({
a: 1
});
ob.a = "new string value";
When setting new value into the string value, we first save the string value,
And only then we reassign the pointer to point to the data, and update the needed ref counts.
Transactional values saves means that if we oom during save, stop the operation, free the memory allocated until that point, and as we didn't mutate anything else,
our object buffer is not stuck in any "broken" state
Every operation that requires new allocations,
We first to the allocations, and only then mutating the old state.
Example:
give this code:
When setting new value into the string value, we first save the string value,
And only then we reassign the pointer to point to the data, and update the needed ref counts.
Transactional values saves means that if we oom during save, stop the operation, free the memory allocated until that point, and as we didn't mutate anything else,
our object buffer is not stuck in any "broken" state