-
- Downloads
There was an error fetching the commit references. Please try again later.
Remove async finalisation of objects
Finalising objects was handled in one of two ways: 1. When reclaiming blocks we would schedule blocks that needed finalisation. These blocks were processed in a separate thread. 2. When allocating into a block that needed finalisation, all objects in this block in need of finalisation would be finalised. The idea of this approach was to move the expensive finalising of objects out of the garbage collection phase, at the cost of delaying finalisation a bit. Unfortunately, this approach was anything but simple. This finalisation approach also required various data structures taking up memory. Finally, as part of the finalisation process we would have to scan over all objects; instead of just lines. In this commit we change the approach to a much simpler one. All async related code and data structures are removed. When allocating an Immix block, we zero out the block. When allocating a new object into a previously used slot that needs finalising, we finalise the object. This delays the finalising of objects until their memory is reused. In the usual program this should not pose a problem, as memory will be reused frequently. Indeed, this is something we have observed with Inko's own test suite and a few other test programs: memory usage actually goes down due to fewer data structures needed, instead of going on.
Showing
- vm/src/config.rs 0 additions, 5 deletionsvm/src/config.rs
- vm/src/gc/collector.rs 0 additions, 4 deletionsvm/src/gc/collector.rs
- vm/src/immix/block.rs 16 additions, 156 deletionsvm/src/immix/block.rs
- vm/src/immix/bucket.rs 6 additions, 23 deletionsvm/src/immix/bucket.rs
- vm/src/immix/copy_object.rs 0 additions, 11 deletionsvm/src/immix/copy_object.rs
- vm/src/immix/permanent_allocator.rs 8 additions, 21 deletionsvm/src/immix/permanent_allocator.rs
- vm/src/object.rs 7 additions, 6 deletionsvm/src/object.rs
- vm/src/object_pointer.rs 12 additions, 41 deletionsvm/src/object_pointer.rs
- vm/src/process.rs 3 additions, 15 deletionsvm/src/process.rs
- vm/src/vm/machine.rs 0 additions, 11 deletionsvm/src/vm/machine.rs
- vm/src/vm/object.rs 0 additions, 4 deletionsvm/src/vm/object.rs
- vm/src/vm/state.rs 0 additions, 13 deletionsvm/src/vm/state.rs
Please register or sign in to comment