newNode returns a fastJsonNode with its attr set to attr, and all other meta set to their default value.
(attr uint16)
| 301 | // newNode returns a fastJsonNode with its attr set to attr, |
| 302 | // and all other meta set to their default value. |
| 303 | func (enc *encoder) newNode(attr uint16) fastJsonNode { |
| 304 | b := enc.alloc.AllocateAligned(nodeSize) |
| 305 | n := (*node)(unsafe.Pointer(&b[0])) |
| 306 | enc.setAttr(n, attr) |
| 307 | return n |
| 308 | } |
| 309 | |
| 310 | func (enc *encoder) setAttr(fj fastJsonNode, attr uint16) { |
| 311 | // There can be some cases where we change name of attr for fastJsoNode and |