shingarov / MachineArithmetic

A mathematical foundation for Smalltalk-25
MIT License
17 stars 6 forks source link

Improve Z3 objects lifecycle support #295

Closed janvrany closed 3 months ago

janvrany commented 3 months ago

This commit tries to improve Z3 object livecycle support, in particular adds systematic support for disposing of an object once no longer used.

With these changes, users are supposed to call #release on any kind of Z3 object (except on ASTs) once the object is no longer needed. For "contexted" objects, that is, for objects whose life is bound to their context, it is user responsiblity to call #release first on dependent object and then on the context.

For reference-counted objects (solvers, models, ...) uses should not call incRef and decRef manually, reference counts are automatically increased when object is instantiated in Smalltalk and decremented when #released.