diff options
author | Yuchen Pei <hi@ypei.me> | 2022-01-30 17:16:36 +1100 |
---|---|---|
committer | Yuchen Pei <hi@ypei.me> | 2022-01-30 17:16:36 +1100 |
commit | 3eb04547355c49b986e884e028652ac50762089b (patch) | |
tree | a94ea4b0f02d98a88ac4ad0f16863db20a027bbd /jackos | |
parent | 4ae42daaca0fb7c909f736997f227c51a48f6c7b (diff) |
minor editspublic
Diffstat (limited to 'jackos')
-rw-r--r-- | jackos/Memory.jack | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/jackos/Memory.jack b/jackos/Memory.jack index 54e04aa..82c10dd 100644 --- a/jackos/Memory.jack +++ b/jackos/Memory.jack @@ -53,7 +53,7 @@ class Memory { let heap[current + 1] = heap[current + 1] - size2;
let newLast = current + heap[current + 1] + 2;
let heap[newLast] = heap[current];
- let heap[current] = newLast;
+ let heap[current] = newLast; // This seems to be wrong - a free segment pointing to an allocated segment - will cause double allocation.
let heap[newLast + 1] = size;
return heap + newLast + 2;
}
|