Chia-Network / bladebit

A high-performance k32-only, Chia (XCH) plotter supporting in-RAM and disk-based plotting
Apache License 2.0
339 stars 109 forks source link

reference counted `MemoryPlot` #348

Open arvidn opened 1 year ago

arvidn commented 1 year ago

Currently we copy the MemoryPlot objects, containing a pointer to allocated memory, and then free that memory in the destructor, unconditionally. This leads to double frees.

This is where we copy initialized MemoryPlot objects: https://github.com/Chia-Network/bladebit/blob/cuda-compression/src/tools/PlotValidator.cpp#L279