Skip to content

Conversation

@adam-mcdaniel
Copy link
Owner

This PR adds memory leak checks at the end of execution. All this really does is iterate over the allocated bitmask to check if any data has not been freed. If there is still alloc'd data, then the program panics with the error code 4, and dumps the virtual machines' memory.

Here is some example output.

stack: [ ]
heap:  [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ]
alloc: [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 ]
STACK SIZE    0
TOTAL ALLOC'D 8
panic: leaked heap memory

@adam-mcdaniel adam-mcdaniel added error handling Related to Oak's error handling system memory Related to Oak's memory management labels Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

error handling Related to Oak's error handling system memory Related to Oak's memory management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants