jsonparse: Add basic JSON parser
Some TODO's left and this needs benchmarking.
This commit is contained in:
parent
aebe5a93dc
commit
7cdc02e399
8 changed files with 508 additions and 21 deletions
|
|
@ -7,9 +7,9 @@ typedef struct {
|
|||
size_t maxlen;
|
||||
} fustr;
|
||||
|
||||
static void fustr_init_(pTHX_ fustr *s, size_t prealloc, size_t maxlen) {
|
||||
if (prealloc > maxlen) prealloc = maxlen;
|
||||
s->sv = sv_2mortal(newSV(prealloc));
|
||||
/* sv must be a new SV with a preallocated buffer */
|
||||
static void fustr_init_(pTHX_ fustr *s, SV *sv, size_t maxlen) {
|
||||
s->sv = sv;
|
||||
SvPOK_only(s->sv);
|
||||
s->cur = SvPVX(s->sv);
|
||||
s->end = SvEND(s->sv);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue