artpelling / state-space-renderer

Real-time renderer for state-space systems leveraging BLAS
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

matrix storage conversion utils generate leak #16

Open metersquared opened 4 days ago

metersquared commented 4 days ago

Converting matrix storage i.e. general_to_band_storage to one form or another generate leak.

Discovered as I generate tests and benchmark for #11. This is not an issue as the conversion is mostly used to just change system to specific structure and not in production.

metersquared commented 3 days ago

Okay, so in #15 I can free memory from tests, but benchmark leads to problem with "double free errors". I tried to use unique_ptr, vector, and shared_ptr, but no success.

I guess the only option is to generate all the state space stuff in numpy, but I don't think it's doable for MixedHessenberg, since I designed the memory assignment in such a way that it's aligned one after another.

One other option is to convert matrix directly in constructors, so we don't actually have to deal with this pointer issue.