| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|/ / |
|
| |
| |
| |
| | |
though it is up to the callers to avoid doing so in more complex cases.
|
| |
| |
| |
| |
| |
| | |
json_object_object_add(), and been changed to return int at the same time the latter was. Do that now.
Also correct a couple of calls to _to_json_string to check the return value.
|
| |
| |
| |
| |
| |
| |
| |
| | |
always return NULL. (Issue #259)
Also undo NULL check in json_tokener_set_flags(): it's not at all valid toi
try to set flags on a NULL pointer, and doing so should not be silently
ignored.
|
|\ \
| | |
| | | |
Minor changes in C source code
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This new method allows to also
get the length of the generated string.
Fix #165
Change-Id: Iea91404027f143ca3d29a4c58d7c07ae53556110
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
| |
| |
| |
| |
| | |
To better distinguish between entry->k and entry->v being const within linkhash, but non-const outside, add lh_entry_v() and lh_entry_k() accessors.
Make lh_entry->k const.
|
| |
| |
| |
| |
| | |
Also, json_object_set_serializer is changed to respect the userdata
and user_delete parameters when to_string_func is NULL.
|
| |
| |
| |
| |
| |
| |
| |
| | |
The user might want to use the userdata for something different, so the
serializer should ignore it by default.
Explicitly setting the serializer to json_object_double_to_json_string will
still make it interpret the userdata as a format string.
|
| |
| |
| |
| | |
updating the range checks to use a calculated SIZE_T_MAX.
|
|\ \
| | |
| | |
| | | |
into doctaweeks-fixes-for-upstream
|
| |/ |
|
| | |
|
|\ \
| | |
| | |
| | | |
Protovision-master
|
| | | |
|
|\ \ \
| | | |
| | | | |
Fix various potential null ptr deref and int32 overflows
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This fix errors that can happen when ingesting very large JSON files
when hitting the maximum heap size of the process.
|
|\ \ \ \
| | | | |
| | | | | |
Add utility function for comparing json_objects
|
| |/ / / |
|
|/ / /
| | |
| | |
| | | |
Tests added.
|
| | | |
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* Return value of json_object_object_add() changed from void to int.
Return value now indicates success or failure.
* Check whether allocations are successful.
* Do not exit program from within the library.
|
| |_|/
|/| |
| | |
| | | |
escaping of forward slashes.
|
| | | |
|
|\ \ \
| | | |
| | | | |
Performance improvements
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
smalls strings inside json_objects had a high overhead because dynamic
memory allocation was needed for each of them. This also meant that the
pointer needed to be updated. This is now changed so that small strings
can directly be stored inside the json_object. Note that on the regular
64 bit machines a pointer takes 8 bytes. So even without increasing
memory, we could store string up to 7 bytes directly inside the object.
The max size is configurable. I have selected up to 31 bytes (which
means a buffer of 32 including the NUL byte). This brings a 24-bytes
memory overhead, but I consider that still useful because the memory
allocator usually also has quite some overhead (16 bytes) for
dyn alloced memory blocks. In any case, the max buffer size can be
tweaked via #define.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
These items were used for statistics tracking, but no code at all
exists to consume them. By removing them we save
a) space
because they counters required space, and did so in each and every
json object
b) performance
because calloc() needs to write less data and the counters are
no longer maintained; cache performance can be better, load
on OS main memory is lighter
We could conditionally enable/disable these counters, but I have not
done this they were really nowhere used and it looked more like a
left-over from the import of hashtable code.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This provides more control over some detail aspects, many
of which are performance related.
|
| | | |
| | | |
| | | |
| | | | |
This can be a very considerable performance saver.
|
|\ \ \ \
| | | | |
| | | | | |
Adding JSON_C_TO_STRING_PRETTY_TAB flag
|
| | |_|/
| |/| |
| | | |
| | | | |
- Tabs are easier to read for tired eyes and editor adjustable
|
|/ / / |
|
| | | |
|
|/ /
| |
| |
| |
| |
| | |
Arrays can already be sorted with json_object_array_sort() which uses
qsort() of the standard C library. This adds a counterpart using the
bsearch() from C.
|
| |
| |
| |
| |
| |
| | |
in a few of those cases.
Thanks to Susant Sahani for pointing out some of these.
|
| | |
|
| |
| |
| |
| | |
macros on MSCV where _isnan and _finite exist instead.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
sscanf is always a potential problem when converting numeric
values as it does not correctly handle over- and underflow
(or at least gives no indication that it has done so).
This change converts json_object_get_double() to use strtod()
according to CERT guidelines.
|
| |
| |
| |
| | |
more than 6 digits show up in the output.
|
| | |
|
| |
| |
| |
| |
| |
| | |
string representation of a double to be specified when creating the object and use it in json_tokener_parse_ex() so a re-serialized object more exactly matches the input.
Add json_object_free_userdata() and json_object_userdata_to_json_string() too.
|
|\ \
| | |
| | | |
Remove redefinition of strndup() which is no longer used in the codebase
|
| | | |
|
|/ / |
|
|\ \
| | |
| | | |
Support NaN and Infinity
|
| | |
| | |
| | |
| | |
| | |
| | | |
Although JSON RFC does not support NaN or Infinity
as numeric values ECMA 262 section 9.8.1 defines
how to handle these cases as strings
|
|/ / |
|
|\ \
| | |
| | |
| | |
| | | |
Conflicts:
json_util.c
|