benreid24 / BLIB

Small organized collection of common code I have accumulated over the years that has amassed into a proper 2d game engine
1 stars 0 forks source link

Refactor script:Value #69

Closed benreid24 closed 2 years ago

benreid24 commented 3 years ago

References can be implemented as regular pointers. Each value:

  1. Maintains a list of values pointing to it
  2. On destruction invalidates those referring values

Reference values:

  1. Register themselves with the value they reference to
  2. Unregister themselves on destruction or type change

This removes dynamic value allocation and allows a more compact memory model.

Also in this change: