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

Method SetUp

include/sonic/dom/schema_handler.h:89–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87 ~SchemaHandler() { TearDown(); }
88
89 sonic_force_inline bool SetUp(StringView json) {
90 size_t len = json.size();
91 size_t cap = len / 2 + 2;
92 if (cap < 16) cap = 16;
93 if (!st_ || cap_ < cap) {
94 st_ = static_cast<NodeType *>(
95 std::realloc((void *)(st_), sizeof(NodeType) * cap));
96 if (!st_) return false;
97 cap_ = cap;
98 }
99 return true;
100 }
101
102 sonic_force_inline void TearDown() {
103 if (st_ == nullptr) return;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected