MCPcopy Create free account
hub / github.com/bytedance/sonic-cpp / InvalidAllocator

Class InvalidAllocator

tests/node_test.cpp:767–774  ·  view source on GitHub ↗

invalid allocator which only allocate nullptr

Source from the content-addressed store, hash-verified

765
766// invalid allocator which only allocate nullptr
767class InvalidAllocator {
768 public:
769 static void* Malloc(size_t) { return nullptr; }
770 static void* Realloc(void*, size_t, size_t) { return nullptr; }
771
772 static void Free(void*) { return; }
773 static constexpr bool kNeedFree = true;
774};
775
776TEST(DNodeTest, AllocatorReturnNull) {
777 using NodeType = DNode<InvalidAllocator>;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected