Opened 4 years ago

Closed 4 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:


This should eliminate a whole class of hard-to-trace bugs. We can force all new objects to be weak (debug) within (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 4 years ago by mornfall

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).

comment:2 Changed 4 years ago by mornfall

Milestone: future4.3

comment:3 Changed 4 years ago by mornfall

Resolution: fixed
Status: newclosed

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.

Note: See TracTickets for help on using tickets.