diff options
| author | Kenichi Handa | 2012-07-17 07:09:08 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2012-07-17 07:09:08 +0900 |
| commit | 8c536f15bf95916d56bb50495d22b7da7e09fff9 (patch) | |
| tree | ac6f8bf5103bdbd1d6a75f05def9bc7aa9e96547 /src/ralloc.c | |
| parent | 21a8caaa4af24f258e6c7f80c1fc913b00aee044 (diff) | |
| parent | c05cf3902ae658cc8bf413124245c9e1cdcca2d7 (diff) | |
| download | emacs-8c536f15bf95916d56bb50495d22b7da7e09fff9.tar.gz emacs-8c536f15bf95916d56bb50495d22b7da7e09fff9.zip | |
merge trunk
Diffstat (limited to 'src/ralloc.c')
| -rw-r--r-- | src/ralloc.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/ralloc.c b/src/ralloc.c index 4bb2f240438..19d15664eec 100644 --- a/src/ralloc.c +++ b/src/ralloc.c | |||
| @@ -31,9 +31,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 31 | 31 | ||
| 32 | #include <unistd.h> | 32 | #include <unistd.h> |
| 33 | 33 | ||
| 34 | typedef POINTER_TYPE *POINTER; | ||
| 35 | typedef size_t SIZE; | ||
| 36 | |||
| 37 | #ifdef DOUG_LEA_MALLOC | 34 | #ifdef DOUG_LEA_MALLOC |
| 38 | #define M_TOP_PAD -2 | 35 | #define M_TOP_PAD -2 |
| 39 | extern int mallopt (int, int); | 36 | extern int mallopt (int, int); |
| @@ -47,9 +44,6 @@ extern size_t __malloc_extra_blocks; | |||
| 47 | 44 | ||
| 48 | #include <stddef.h> | 45 | #include <stddef.h> |
| 49 | 46 | ||
| 50 | typedef size_t SIZE; | ||
| 51 | typedef void *POINTER; | ||
| 52 | |||
| 53 | #include <unistd.h> | 47 | #include <unistd.h> |
| 54 | #include <malloc.h> | 48 | #include <malloc.h> |
| 55 | 49 | ||
| @@ -58,6 +52,8 @@ typedef void *POINTER; | |||
| 58 | 52 | ||
| 59 | #include "getpagesize.h" | 53 | #include "getpagesize.h" |
| 60 | 54 | ||
| 55 | typedef size_t SIZE; | ||
| 56 | typedef void *POINTER; | ||
| 61 | #define NIL ((POINTER) 0) | 57 | #define NIL ((POINTER) 0) |
| 62 | 58 | ||
| 63 | /* A flag to indicate whether we have initialized ralloc yet. For | 59 | /* A flag to indicate whether we have initialized ralloc yet. For |
| @@ -1143,6 +1139,17 @@ r_alloc_reset_variable (POINTER *old, POINTER *new) | |||
| 1143 | bloc->variable = new; | 1139 | bloc->variable = new; |
| 1144 | } | 1140 | } |
| 1145 | 1141 | ||
| 1142 | void | ||
| 1143 | r_alloc_inhibit_buffer_relocation (int inhibit) | ||
| 1144 | { | ||
| 1145 | if (use_relocatable_buffers < 0) | ||
| 1146 | use_relocatable_buffers = 0; | ||
| 1147 | if (inhibit) | ||
| 1148 | use_relocatable_buffers++; | ||
| 1149 | else if (use_relocatable_buffers > 0) | ||
| 1150 | use_relocatable_buffers--; | ||
| 1151 | } | ||
| 1152 | |||
| 1146 | 1153 | ||
| 1147 | /*********************************************************************** | 1154 | /*********************************************************************** |
| 1148 | Initialization | 1155 | Initialization |