Closed manodeep closed 8 years ago
To completely avoid memory leaks would require the entire struct results
to be on the stack => a compile-time max limit on nbins
would have to be imposed. I could probably enforce something like MAX_NBINS = 2048
; I can't imagine requiring more than 2048 bins. Closing for now - might revisit before v2.0
.
All of the APIs return a heap-allocated
struct result
. This has potential for a memory-leak, in case the user does not free the memory afterwards. I am probably doing that from the python interfaces. An easy fix would be to replace those with stack-allocated structs, this would require replacing allresults->
withresults.