Ivorforce / NumDot

Tensor math and scientific computation for the Godot game engine.
https://numdot.readthedocs.io
MIT License
19 stars 7 forks source link

Switch base class to RefCounted #26

Closed Ivorforce closed 2 months ago

Ivorforce commented 2 months ago

NDArrays are currently plain Objects. These need to be freed. This means a simple operation like an add over two newly allocated objects already leaks. Whoops!

The solution is RefCounted. It's a bit heavier than Object, but it's definitely needed because nobody can be asked to keep references to all their temporary tensors for a simple maths operation.

This is for both NDRange and NDArray.