MCPcopy Create free account
hub / github.com/pybind/pybind11 / operator new

Method operator new

tests/test_factory_constructors.cpp:346–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344 public:
345 explicit NoPlacementNew(int i) : i(i) {}
346 static void *operator new(std::size_t s) {
347 auto *p = ::operator new(s);
348 py::print("operator new called, returning", reinterpret_cast<uintptr_t>(p));
349 return p;
350 }
351 static void operator delete(void *p) {
352 py::print("operator delete called on", reinterpret_cast<uintptr_t>(p));
353 ::operator delete(p);

Callers

nothing calls this directly

Calls 1

printFunction · 0.85

Tested by

no test coverage detected