These are the things it has to do:
- Find the last used entry in the Heap Manager table or the 0th if this is the first write.
- Read the value in that entry, which consists of an offset and a size.
Size: size of value stored (1-4). Bits number 26-24.
- Add the offset to the size to get the location for the next write. (This is 0-base stuff, so I think the math works.)
- Save that value to a new entry in Heap Manager.
- Save the size of value stored on the heap to the new entry just created.
- Save the actual value in the heap, starting at the value saved in Heap Manager.
It either isn't finding the first entry or it isn't reacting right when it does.
Or the first entry isn't being made in the right place in memory.
No code today - it's starting to look a little spaghetti-ish, so I'll work through it again, see what I'm missing.
No comments:
Post a Comment