Continue reading "C++ Smart Pointers with Aligned Malloc/Free"
C++ Smart Pointers with Aligned Malloc/Free
Recall in the aligned_malloc article that we noted the need to pair aligned_malloc with aligned_free. Using the wrong free call can cause serious problems, as we have modified the pointer that malloc originally returned to us. This problem of pairing allocators and deleters also applies in other situations: new must be paired with delete, while …
