Remove more use of ptrstack C library with C++ data structures