JSON::SIMD - JSON serialising/deserialising, done correctly and faster
=head1 SYNOPSIS
use JSON::SIMD;
# exported functions, they croak on error
# and expect/generate UTF-8
$utf8_encoded_json
_text = encode_json $perl_hash_or_arrayref;
$perl_hash_or_arrayref = decode_json $utf8_encoded_json_text;
# OO-interface
$coder = JSON::SIMD->new->ascii->pretty->allow_nonref;
$pretty_printed_u
->decode ($unicode_json_text);
$coder = JSON::SIMD->new->use_simdjson;
$perl_scalar = $coder->decode ($unicode_json_text);
$perl_scalar = $coder->decode_at_pointer ($unicode_json_text, '/just/a/pa
=head1 NAME
JSON::SIMD::Boolean - dummy module providing JSON::SIMD::Boolean
=head1 SYNOPSIS
# do not "use" yourself
=head1 DESCRIPTION
This module exists only to provide overload resolution for
that was decoded by JSON::XS versions
before 3.0.
Since 3.0, JSON::PP::Boolean has replaced it. Support for
JSON::SIMD::Boolean will be removed in a future release.
=cut
use JSON::SIMD ();
1;
=he
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include "simdjson_wrapper.h"
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <lim
e F_HOOK 0x00008000UL // some hooks exist, so slow-path processing
#define F_USE_SIMDJSON 0x00010000UL
#define F_CORE_BOOLS 0x00020000UL
#define F_ENCODE_CORE_BOOLS 0x00040000
HORT_STRING_LEN 16384 // special-case strings of up to this size
#define DECODE_WANTS_OCTETS(json) ((json)->flags & F_UTF8)
#define SB do {
#define SE } while (0)
#if __GNUC__ >= 3
# define my_expe
#ifndef SIMDJSON_DECODE_H
#define SIMDJSON_DECODE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
// main JSON struct definition
// also used by mai
// {[]}-nesting level
unsigned char incr_mode;
SV *v_false, *v_true;
} JSON;
// structure used for decoding JSON
// also used by the main XS code
typedef struct
{
char *cur; // current pars
parse error, if != 0
JSON json;
U32 depth; // recursion depth
U32 maxdepth; // recursion depth limit
// fields needed for simdjson decoder
SV *input; // original JSON document, needed becau