Opened 6 years ago
Closed 6 years ago
#36 closed task (fixed)
Assign 'types' (weak, marked) to objects, not to pointers.
Reported by: | mornfall | Owned by: | mornfall |
---|---|---|---|
Priority: | major | Milestone: | 4.3 |
Component: | VM | Keywords: | |
Cc: |
Description
This should eliminate a whole class of hard-to-trace bugs. We can force all new objects to be weak (debug) within dbg.call (debug mode) and disallow access to weak objects from outside of debug mode. This might finally make it impossible to write programs that behave differently during CE generation and lead to the infamous 'incomplete trace' problem. This also means that vm_obj_make needs to get a parameter to create marked objects. The _VM_T_DebugPersist craziness can be banished, too (weak objects can be preserved automatically).
Change History (3)
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
Milestone: | future → 4.3 |
---|
comment:3 Changed 6 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
I have kept the _VM_T_DebugPersist call (at least for now), mainly for efficiency and ease of implementation. Other than that, the transition to object types (as opposed to pointer types) should be now complete, including a dedicated 'alloca' pointer/object type and enforcement that free() is not called on such objects. There may be room for future improvements building on this change.
This would also make it viable to have an 'alloca' object type, which free() can then refuse to deallocate. Finally, it should also allow us to partition pointer types using objid ranges, like we already do for global/code/heap (we don't need quite as big an address space for weak objects as we do for normal objects, for instance).