Abstract
Static
borrowReturns a reference to an object of the requested type in the depot, but does not remove it there. If no object of the requested type was in the depot, one is created, stored and borrowed. For short term usage of objects in a local scope, when there will be no other call to Recycler.get, Recycler.reuse or Recycler.borrow!
Static
dumpEmptys the depot of a given type, leaving the objects for the garbage collector. May result in a short stall when many objects were in
Static
dumpStatic
getStatic
reuseFetches an object of the requested type from the depot and returns it. ⚠️DOES NOT call its recycle-method. Faster than Recycler.get, but should be used with caution.
Static
storeStatic
storeStores the provided objects using the Recycler.store method
Rest
..._instances: Object[]
Keeps a depot of objects that have been marked for reuse, sorted by type.
Using Recycler reduces load on the carbage collector and thus supports smooth performance.
Author
Jirka Dell'Oro-Friedl, HFU, 2021
Link
https://github.com/hs-furtwangen/FUDGE/wiki/Recycler