| 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; |
nothing calls this directly
no outgoing calls
no test coverage detected