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

Method SetUp

include/sonic/dom/handler.h:72–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 ~SAXHandler() { TearDown(); }
71
72 sonic_force_inline bool SetUp(StringView json) {
73 size_t len = json.size();
74 size_t cap = len / 2 + 2;
75 if (cap < 16) cap = 16;
76 if (!st_ || cap_ < cap) {
77 st_ = static_cast<NodeType *>(
78 std::realloc((void *)(st_), sizeof(NodeType) * cap));
79 if (!st_) return false;
80 cap_ = cap;
81 }
82 return true;
83 }
84
85 sonic_force_inline void TearDown() {
86 if (st_ == nullptr) return;

Callers 1

GenericDocumentClass · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected