diff options
| author | Paul Eggert | 2016-01-30 14:20:57 -0800 |
|---|---|---|
| committer | Paul Eggert | 2016-01-30 15:26:07 -0800 |
| commit | e1a9f2099c2e683dffc4b898ce85ce935c4cb254 (patch) | |
| tree | 14f8b080fb8515b81111dc269e37aa01f73b16fc /src/sheap.h | |
| parent | 874c59a81b7ee12a739149c5229e6d3bbd463324 (diff) | |
| download | emacs-e1a9f2099c2e683dffc4b898ce85ce935c4cb254.tar.gz emacs-e1a9f2099c2e683dffc4b898ce85ce935c4cb254.zip | |
Pacify --enable-gcc-warnings when HYBRID_MALLOC
* src/buffer.c (init_buffer):
* src/emacs.c (main):
* src/xsmfns.c (smc_save_yourself_CB, x_session_initialize):
Use emacs_get_current_dir_name, not get_current_dir_name.
* src/conf_post.h (aligned_alloc) [HYBRID_MALLOC && emacs]: New macro.
(HYBRID_GET_CURRENT_DIR_NAME, get_current_dir_name): Remove.
* src/emacs.c: Include "sheap.h".
(report_sheap_usage): Remove decl.
(Fdump_emacs) [HYBRID_MALLOC]: Report usage directly.
Don't assume ptrdiff_t can be printed as int.
* src/gmalloc.c [HYBRID_MALLOC]:
Include "sheap.h" rather than declaring its contents by hand.
(get_current_dir_name, gget_current_dir_name)
(hybrid_get_current_dir_name): Remove.
(emacs_abort): Remove duplicate decl.
(aligned_alloc): Undef, like malloc etc.
(ALLOCATED_BEFORE_DUMPING): Now a static function, not a macro.
Make it a bit more efficient.
(malloc_find_object_address): Remove unused decl.
(enum mcheck_status, mcheck, mprobe, mtrace, muntrace, struct mstats)
(mstats, memory_warnings): Declare only if GC_MCHECK.
* src/lisp.h (emacs_get_current_dir_name):
New decl, replacing get_current_dir_name.
* src/sheap.c: Include sheap.h first.
(STATIC_HEAP_SIZE): Remove; now in sheap.h.
(debug_sheap): Now static.
(bss_sbrk_buffer_end): Remove; no longer used.
(bss_sbrk_ptr): Now static and private.
(bss_sbrk_did_unexec): Now bool.
(BLOCKSIZE): Remove, to avoid GCC warning about its not being used.
(bss_sbrk): Don't treat request_size 0 as special, since the code
works without this being a special case.
Avoid overflow if request size exceeds INT_MAX.
(report_sheap_usage): Remove; now done in emacs.c.
* src/sheap.h: New file.
* src/sysdep.c (get_current_dir_name): Remove macro.
Include "sheap.h".
(emacs_get_current_dir_name): Rename function from
get_current_dir_name. Handle HYBRID_MALLOC here;
this is simpler.
(Bug#22086)
Diffstat (limited to 'src/sheap.h')
| -rw-r--r-- | src/sheap.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/sheap.h b/src/sheap.h new file mode 100644 index 00000000000..4af3cf482b1 --- /dev/null +++ b/src/sheap.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* Static heap allocation for GNU Emacs. | ||
| 2 | |||
| 3 | Copyright 2016 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | This file is part of GNU Emacs. | ||
| 6 | |||
| 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 | ||
| 9 | the Free Software Foundation, either version 3 of the License, or | ||
| 10 | (at your option) any later version. | ||
| 11 | |||
| 12 | GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | GNU General Public License for more details. | ||
| 16 | |||
| 17 | You should have received a copy of the GNU General Public License | ||
| 18 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | ||
| 19 | |||
| 20 | #include <stddef.h> | ||
| 21 | |||
| 22 | #ifdef ENABLE_CHECKING | ||
| 23 | # define STATIC_HEAP_SIZE (28 * 1024 * 1024) | ||
| 24 | #else | ||
| 25 | # define STATIC_HEAP_SIZE (19 * 1024 * 1024) | ||
| 26 | #endif | ||
| 27 | |||
| 28 | extern char bss_sbrk_buffer[STATIC_HEAP_SIZE]; | ||
| 29 | extern char *max_bss_sbrk_ptr; | ||
| 30 | extern bool bss_sbrk_did_unexec; | ||
| 31 | extern void *bss_sbrk (ptrdiff_t); | ||