@@ -10,18 +10,18 @@ ParsedJson::~ParsedJson() {
1010}
1111
1212ParsedJson::ParsedJson (ParsedJson && p)
13- : bytecapacity(std::move(p.bytecapacity)),
14- depthcapacity(std::move(p.depthcapacity)),
15- tapecapacity(std::move(p.tapecapacity)),
13+ : bytecapacity(std::move(p.bytecapacity)),
14+ depthcapacity(std::move(p.depthcapacity)),
15+ tapecapacity(std::move(p.tapecapacity)),
1616 stringcapacity(std::move(p.stringcapacity)),
17- current_loc(std::move(p.current_loc)),
17+ current_loc(std::move(p.current_loc)),
1818 n_structural_indexes(std::move(p.n_structural_indexes)),
19- structural_indexes(std::move(p.structural_indexes)),
20- tape(std::move(p.tape)),
19+ structural_indexes(std::move(p.structural_indexes)),
20+ tape(std::move(p.tape)),
2121 containing_scope_offset(std::move(p.containing_scope_offset)),
22- ret_address(std::move(p.ret_address)),
23- string_buf(std::move(p.string_buf)),
24- current_string_buf_loc(std::move(p.current_string_buf_loc)),
22+ ret_address(std::move(p.ret_address)),
23+ string_buf(std::move(p.string_buf)),
24+ current_string_buf_loc(std::move(p.current_string_buf_loc)),
2525 isvalid(std::move(p.isvalid)) {
2626 p.structural_indexes =NULL ;
2727 p.tape =NULL ;
@@ -50,7 +50,7 @@ bool ParsedJson::allocateCapacity(size_t len, size_t maxdepth) {
5050 uint32_t max_structures = ROUNDUP_N (len, 64 ) + 2 + 7 ;
5151 structural_indexes = new uint32_t [max_structures];
5252 size_t localtapecapacity = ROUNDUP_N (len, 64 );
53- size_t localstringcapacity = ROUNDUP_N (len, 64 );
53+ size_t localstringcapacity = ROUNDUP_N (len + 32 , 64 );
5454 string_buf = new uint8_t [localstringcapacity];
5555 tape = new uint64_t [localtapecapacity];
5656 containing_scope_offset = new uint32_t [maxdepth];
@@ -114,7 +114,7 @@ bool ParsedJson::printjson(std::ostream &os) {
114114 return false ;
115115 }
116116 if (howmany > tapecapacity) {
117- fprintf (stderr,
117+ fprintf (stderr,
118118 " We may be exceeding the tape capacity. Is this a valid document?\n " );
119119 return false ;
120120 }
0 commit comments