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

Method EndObject

include/sonic/dom/handler.h:251–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249 }
250
251 sonic_force_inline bool EndObject(size_t pairs) {
252 NodeType &obj = *stack_.template Begin<NodeType>();
253 obj.setLength(pairs, kObject);
254 if (pairs) {
255 void *mem = obj.template containerMalloc<MemberType>(pairs, *alloc_);
256 obj.setChildren(mem);
257 internal::Xmemcpy<sizeof(MemberType)>(
258 (void *)obj.getObjChildrenFirstUnsafe(), (void *)(&obj + 1), pairs);
259 stack_.Pop<MemberType>(pairs);
260 } else {
261 obj.setChildren(nullptr);
262 }
263 return true;
264 }
265
266 sonic_force_inline bool Key(const char *data, size_t len, size_t allocated) {
267 new (stack_.PushSize<NodeType>(1)) NodeType();

Callers

nothing calls this directly

Calls 2

setChildrenMethod · 0.80

Tested by

no test coverage detected