diff options
| author | Tom Tromey | 2018-08-09 17:56:53 -0600 |
|---|---|---|
| committer | Tom Tromey | 2018-08-09 17:56:53 -0600 |
| commit | accb7b7ecc19f85c2750ded1046a464bc73c6a52 (patch) | |
| tree | 1aa94af022d6700a93a8ff2b73f5b210046ac010 /src/json.c | |
| parent | f822a2516d88eeb2118fbbc8554f155e86dfd74e (diff) | |
| parent | 53483df0de0085dbc9ef0b15a0f629ab808b0147 (diff) | |
| download | emacs-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.c | 11 |
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. | |||
| 7 | GNU Emacs is free software: you can redistribute it and/or modify | 7 | GNU Emacs is free software: you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
| 9 | the Free Software Foundation, either version 3 of the License, or (at | 9 | the Free Software Foundation, either version 3 of the License, or (at |
| 10 | nyour option) any later version. | 10 | your option) any later version. |
| 11 | 11 | ||
| 12 | GNU Emacs is distributed in the hope that it will be useful, | 12 | GNU Emacs is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but 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 | ||
| 164 | static void * | 169 | static void * |
| 165 | json_malloc (size_t size) | 170 | json_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 | } |