Repository navigation
Add the Memory Manager's heap zone, checked against Mac OS 9.2.2 - #48
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
GraphiteMemorytarget with a heap zone that manages handles and pointers in guest memory, and a Retro68 probe whose Mac OS 9.2.2 capture the tests check it against.What Mac OS 9.2.2 showed
ReferenceTests/Retro68/MemoryManager-macos-9.2.2-ppc.txt, summarized in the Retro68 README:NewHandle(-1)andNewPtr(-1)give memSCErr (-116);SetHandleSizeandSetPtrSizetake a negative size as 0, without an error.HGetState,HLock,HUnlock,HPurge,GetHandleSizeandSetHandleSizegive nilHandleErr (-109), andHGetStatereturns 0x93.ReallocateHandlegives a block with no bits set.EmptyHandleandReallocateHandleof a locked handle give memPurErr (-112). A locked block that can't grow in place gives memFullErr and keeps its size; an unlocked one moves.DisposeHandle,EmptyHandleandDisposePtraccept nil;GetPtrSize(nil)gives memAZErr (-113).NewHandlehands out.Changes
GuestMemory: checked read, write and move of guest bytes, the interface BlueBox provides;ByteGuestMemorybacks it with a byte array for tests.HeapZone: master pointers in guest memory, so guest code can dereference handles; generation-checkedHandleIDs; compaction of unlocked blocks, then purging, when space runs out;purgeProcandresourceDisposedhooks for the Resource Manager; MemError, FreeMem, MaxBlock, CompactMem and PurgeMem.MacError: memAdrErr, memWZErr, memPurErr, memAZErr, memSCErr and memLockedErr.Two cases the capture couldn't settle, because they would crash the probe: a disposed handle gives memWZErr (-111), and an address that was never a handle gives memAdrErr (-110).
Testing
swift testpasses: all 15 test runs, including 11HeapZoneTests.