aboutsummaryrefslogtreecommitdiffstats
path: root/src/json.c
diff options
context:
space:
mode:
authorTom Tromey2018-08-09 17:56:53 -0600
committerTom Tromey2018-08-09 17:56:53 -0600
commitaccb7b7ecc19f85c2750ded1046a464bc73c6a52 (patch)
tree1aa94af022d6700a93a8ff2b73f5b210046ac010 /src/json.c
parentf822a2516d88eeb2118fbbc8554f155e86dfd74e (diff)
parent53483df0de0085dbc9ef0b15a0f629ab808b0147 (diff)
downloademacs-accb7b7ecc19f85c2750ded1046a464bc73c6a52.tar.gz
emacs-accb7b7ecc19f85c2750ded1046a464bc73c6a52.zip
Merge remote-tracking branch 'origin/master' into feature/bignum
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/json.c b/src/json.c
index 17edb4140e0..4e413a2bd51 100644
--- a/src/json.c
+++ b/src/json.c
@@ -7,7 +7,7 @@ This file is part of GNU Emacs.
7GNU Emacs is free software: you can redistribute it and/or modify 7GNU Emacs is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by 8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 3 of the License, or (at 9the Free Software Foundation, either version 3 of the License, or (at
10nyour option) any later version. 10your option) any later version.
11 11
12GNU Emacs is distributed in the hope that it will be useful, 12GNU Emacs is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of 13but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -159,7 +159,12 @@ init_json_functions (void)
159 than PTRDIFF_MAX. Such objects wouldn't play well with the rest of 159 than PTRDIFF_MAX. Such objects wouldn't play well with the rest of
160 Emacs's codebase, which generally uses ptrdiff_t for sizes and 160 Emacs's codebase, which generally uses ptrdiff_t for sizes and
161 indices. The other functions in this file also generally assume 161 indices. The other functions in this file also generally assume
162 that size_t values never exceed PTRDIFF_MAX. */ 162 that size_t values never exceed PTRDIFF_MAX.
163
164 In addition, we need to use a custom allocator because on
165 MS-Windows we replace malloc/free with our own functions, see
166 w32heap.c, so we must force the library to use our allocator, or
167 else we won't be able to free storage allocated by the library. */
163 168
164static void * 169static void *
165json_malloc (size_t size) 170json_malloc (size_t size)
@@ -605,7 +610,7 @@ usage: (json-serialize OBJECT &rest ARGS) */)
605 char *string = json_dumps (json, JSON_COMPACT); 610 char *string = json_dumps (json, JSON_COMPACT);
606 if (string == NULL) 611 if (string == NULL)
607 json_out_of_memory (); 612 json_out_of_memory ();
608 record_unwind_protect_ptr (free, string); 613 record_unwind_protect_ptr (json_free, string);
609 614
610 return unbind_to (count, json_build_string (string)); 615 return unbind_to (count, json_build_string (string));
611} 616}