Stack moved to a separate file and now keeps track of sizes of items in the stack.
MemLocation now requires an explicit size, to ensure we always think about it rather than blindly accessing memory.
Full implementation for arrays:
Layout in memory is [size(4 bytes), elems(elemSize)...]
Where elemSize is the MINIMUM required memory for a type (so 4 bytes for int, 1 byte for char and bool, 8 bytes for ptr (arrays and pairs), e.t.c.)
If the type is a Pair, we assume elemSize is 8 bytes because we might not be 100% sure what the type is (erased pairs).
Malloc built-in implementation.
PrintCharArray built-in for print char arrays.
- Stack moved to a separate file and now keeps track of sizes of items in the stack.
- `MemLocation` now requires an explicit size, to ensure we always think about it rather than blindly accessing memory.
- Full implementation for arrays:
- Layout in memory is `[size(4 bytes), elems(elemSize)...]`
- Where `elemSize` is the MINIMUM required memory for a type (so 4 bytes for int, 1 byte for char and bool, 8 bytes for ptr (arrays and pairs), e.t.c.)
- If the type is a Pair, we assume `elemSize` is 8 bytes because we might not be 100% sure what the type is (erased pairs).
- `Malloc` built-in implementation.
- `PrintCharArray` built-in for print char arrays.
changed title from fix: variable-sized {-items in stack and heap, fully functional-} heap-allocated arrays (and printCharArray) to fix: variable-sized {+values,+} heap-allocated arrays (and printCharArray)
changed title from **fix: variable-sized {-items in stack and heap, fully functional-} heap-allocated arrays (and printCharArray)** to **fix: variable-sized {+values,+} heap-allocated arrays (and printCharArray)**
added 3 commits
<ul><li>82a3d606 - fix: zero-out sub-32 bit expressions</li><li>e740641a - fix: reserve return pointer and RBP on stack for user func bodies</li><li>58ad849f - test: fix input handling for IOLoop example</li></ul>
[Compare with previous version](/lab2425_spring/WACC_37/-/merge_requests/28/diffs?diff_id=155219&start_sha=4ffe85be91b0a2b6d3338575ce1dac0475b607c3)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
MemLocationnow requires an explicit size, to ensure we always think about it rather than blindly accessing memory.[size(4 bytes), elems(elemSize)...]elemSizeis the MINIMUM required memory for a type (so 4 bytes for int, 1 byte for char and bool, 8 bytes for ptr (arrays and pairs), e.t.c.)elemSizeis 8 bytes because we might not be 100% sure what the type is (erased pairs).Mallocbuilt-in implementation.PrintCharArraybuilt-in for print char arrays.added 1 commit
Compare with previous version
changed title from fix: variable-sized {-items in stack and heap, fully functional-} heap-allocated arrays (and printCharArray) to fix: variable-sized {+values,+} heap-allocated arrays (and printCharArray)
changed the description
changed the description
added 3 commits
Compare with previous version
added 7 commits
bdee6ba7- 1 commit from branchasm-gen808a59f5- feat: almost implemented arrays58df1d7b- refactor: extract Stack, proper register naming and sizes887b9823- fix: variable-sized values, heap-allocated arrays (and printCharArray)507cb7dd- fix: zero-out sub-32 bit expressionsc472c7a6- fix: reserve return pointer and RBP on stack for user func bodiesCompare with previous version
added 1 commit
c0f2473d- test: fix input handling for IOLoop exampleCompare with previous version
mentioned in commit
ada53e518b