Use Boehm-Demers-Weiser Garbage Collector. (#647)
* Use Boehm-Demers-Weiser Garbage Collector. From their own documentation: > The Boehm-Demers-Weiser conservative garbage collector can be used as a > garbage collecting replacement for C malloc or C++ new. It allows you to > allocate memory basically as you normally would, without explicitly > deallocating memory that is no longer useful. The collector automatically > recycles memory when it determines that it can no longer be otherwise > accessed. In pgcopydb C code base it's been hard to maintain proper malloc/free concerns while also implementing proper error-handling, which is a common problem when writing C code. In order to ease the maintenance of the code and reduce production hazards, the best way to proceed looks like automating the memory management altogether by using a Garbage Collector. * Revert removal of regree() calls. * Get rid of LinesBuffer.ownsBuffer. Now that libgc is handling the memory for us, we don't need to keep track of the ownership of the buffer anymore.
parent
69c1340f
Please register or sign in to comment