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

Method EndArray

include/sonic/dom/handler.h:237–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235 }
236
237 sonic_force_inline bool EndArray(size_t count) {
238 NodeType &arr = *stack_.template Begin<NodeType>();
239 arr.setLength(count, kArray);
240 if (count) {
241 arr.setChildren(arr.template containerMalloc<NodeType>(count, *alloc_));
242 internal::Xmemcpy<sizeof(NodeType)>(
243 (void *)arr.getArrChildrenFirstUnsafe(), (void *)(&arr + 1), count);
244 stack_.Pop<NodeType>(count);
245 } else {
246 arr.setChildren(nullptr);
247 }
248 return true;
249 }
250
251 sonic_force_inline bool EndObject(size_t pairs) {
252 NodeType &obj = *stack_.template Begin<NodeType>();

Callers

nothing calls this directly

Calls 2

setChildrenMethod · 0.80

Tested by

no test coverage detected