diff options
| author | Paul Eggert | 2011-07-07 09:58:24 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-07-07 09:58:24 -0700 |
| commit | 903fe15d9deb28a72075c39dfd6003a2ff1af134 (patch) | |
| tree | 1fbf75b817447631ab392e9adba208680a3cde4d /src/buffer.c | |
| parent | ac82cc6ad7793d477015227629070cf87c6225b0 (diff) | |
| download | emacs-903fe15d9deb28a72075c39dfd6003a2ff1af134.tar.gz emacs-903fe15d9deb28a72075c39dfd6003a2ff1af134.zip | |
* alloc.c: Integer signedness and overflow fixes.
Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
(__malloc_size_t): Default to size_t, not to int.
(pure_size, pure_bytes_used_before_overflow, stack_copy_size)
(Fgarbage_collect, mark_object_loop_halt, mark_object):
Prefer ptrdiff_t to size_t when either would do, as we prefer
signed integers.
(XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
(xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
Now const. Initialize with values that are in range even if char
is signed.
(XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
(xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
These functions do the right thing with sizes > 2**32.
(check_depth): Now ptrdiff_t, not int.
(overrun_check_malloc, overrun_check_realloc, overrun_check_free):
Adjust to new way of storing sizes. Check for size overflow bugs
in rest of code.
(STRING_BYTES_MAX): Adjust to new overheads. The old code was
slightly wrong anyway, as it missed one instance of
XMALLOC_OVERRUN_CHECK_OVERHEAD.
(refill_memory_reserve): Omit needless cast to size_t.
(mark_object_loop_halt): Mark as externally visible.
Diffstat (limited to 'src/buffer.c')
0 files changed, 0 insertions, 0 deletions