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

Method EndObject

include/sonic/dom/handler.h:149–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147 }
148
149 sonic_force_inline bool EndObject(uint32_t pairs) {
150 NodeType &obj = st_[parent_];
151 size_t old = obj.o.next.ofs;
152 obj.setLength(pairs, kObject);
153 if (pairs) {
154 void *mem = obj.template containerMalloc<MemberType>(pairs, *alloc_);
155 obj.setChildren(mem);
156 internal::Xmemcpy<sizeof(MemberType)>(
157 (void *)obj.getObjChildrenFirstUnsafe(), (void *)(&obj + 1), pairs);
158 } else {
159 obj.setChildren(nullptr);
160 }
161 np_ = parent_ + 1;
162 parent_ = old;
163 return true;
164 }
165
166 sonic_force_inline bool EndArray(uint32_t count) {
167 NodeType &arr = st_[parent_];

Callers 3

parseImplMethod · 0.45
SONIC_IF_CONSTEXPRMethod · 0.45

Calls 2

setChildrenMethod · 0.80

Tested by

no test coverage detected