diff options
| author | Paul Eggert | 2011-03-15 15:31:22 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-03-15 15:31:22 -0700 |
| commit | 7bc26fdb5c3b50b29bff966a55394e730fbfadd8 (patch) | |
| tree | 296eefce750c250f8352a0d291e4f09868104293 /src | |
| parent | dff45157417d1620c4fb7b6c117cc89142009b69 (diff) | |
| download | emacs-7bc26fdb5c3b50b29bff966a55394e730fbfadd8.tar.gz emacs-7bc26fdb5c3b50b29bff966a55394e730fbfadd8.zip | |
* alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
needed otherwise.
(CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
(GC_STRING_CHARS): Remove; not used.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/alloc.c | 15 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 34fdc1473be..9f8c2166364 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -5,6 +5,11 @@ | |||
| 5 | Rename locals to avoid shadowing. | 5 | Rename locals to avoid shadowing. |
| 6 | (mark_stack): Move local variables into the #ifdef region where | 6 | (mark_stack): Move local variables into the #ifdef region where |
| 7 | they're used. | 7 | they're used. |
| 8 | (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if | ||
| 9 | ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not | ||
| 10 | needed otherwise. | ||
| 11 | (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS. | ||
| 12 | (GC_STRING_CHARS): Remove; not used. | ||
| 8 | 13 | ||
| 9 | * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this | 14 | * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this |
| 10 | avoids undefined behavior in theory. | 15 | avoids undefined behavior in theory. |
diff --git a/src/alloc.c b/src/alloc.c index fd1334a6ef7..7fa2790cb1e 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -92,7 +92,8 @@ extern __malloc_size_t __malloc_extra_blocks; | |||
| 92 | 92 | ||
| 93 | #endif /* not DOUG_LEA_MALLOC */ | 93 | #endif /* not DOUG_LEA_MALLOC */ |
| 94 | 94 | ||
| 95 | #if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) | 95 | #if ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT |
| 96 | #ifdef HAVE_GTK_AND_PTHREAD | ||
| 96 | 97 | ||
| 97 | /* When GTK uses the file chooser dialog, different backends can be loaded | 98 | /* When GTK uses the file chooser dialog, different backends can be loaded |
| 98 | dynamically. One such a backend is the Gnome VFS backend that gets loaded | 99 | dynamically. One such a backend is the Gnome VFS backend that gets loaded |
| @@ -130,12 +131,13 @@ static pthread_mutex_t alloc_mutex; | |||
| 130 | } \ | 131 | } \ |
| 131 | while (0) | 132 | while (0) |
| 132 | 133 | ||
| 133 | #else /* SYSTEM_MALLOC || not HAVE_GTK_AND_PTHREAD */ | 134 | #else /* ! defined HAVE_GTK_AND_PTHREAD */ |
| 134 | 135 | ||
| 135 | #define BLOCK_INPUT_ALLOC BLOCK_INPUT | 136 | #define BLOCK_INPUT_ALLOC BLOCK_INPUT |
| 136 | #define UNBLOCK_INPUT_ALLOC UNBLOCK_INPUT | 137 | #define UNBLOCK_INPUT_ALLOC UNBLOCK_INPUT |
| 137 | 138 | ||
| 138 | #endif /* SYSTEM_MALLOC || not HAVE_GTK_AND_PTHREAD */ | 139 | #endif /* ! defined HAVE_GTK_AND_PTHREAD */ |
| 140 | #endif /* ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT */ | ||
| 139 | 141 | ||
| 140 | /* Value of _bytes_used, when spare_memory was freed. */ | 142 | /* Value of _bytes_used, when spare_memory was freed. */ |
| 141 | 143 | ||
| @@ -152,13 +154,11 @@ static __malloc_size_t bytes_used_when_full; | |||
| 152 | #define VECTOR_UNMARK(V) ((V)->size &= ~ARRAY_MARK_FLAG) | 154 | #define VECTOR_UNMARK(V) ((V)->size &= ~ARRAY_MARK_FLAG) |
| 153 | #define VECTOR_MARKED_P(V) (((V)->size & ARRAY_MARK_FLAG) != 0) | 155 | #define VECTOR_MARKED_P(V) (((V)->size & ARRAY_MARK_FLAG) != 0) |
| 154 | 156 | ||
| 155 | /* Value is the number of bytes/chars of S, a pointer to a struct | 157 | /* Value is the number of bytes of S, a pointer to a struct Lisp_String. |
| 156 | Lisp_String. This must be used instead of STRING_BYTES (S) or | 158 | Be careful during GC, because S->size contains the mark bit for |
| 157 | S->size during GC, because S->size contains the mark bit for | ||
| 158 | strings. */ | 159 | strings. */ |
| 159 | 160 | ||
| 160 | #define GC_STRING_BYTES(S) (STRING_BYTES (S)) | 161 | #define GC_STRING_BYTES(S) (STRING_BYTES (S)) |
| 161 | #define GC_STRING_CHARS(S) ((S)->size & ~ARRAY_MARK_FLAG) | ||
| 162 | 162 | ||
| 163 | /* Global variables. */ | 163 | /* Global variables. */ |
| 164 | struct emacs_globals globals; | 164 | struct emacs_globals globals; |
| @@ -5306,7 +5306,6 @@ mark_object (Lisp_Object arg) | |||
| 5306 | 5306 | ||
| 5307 | #else /* not GC_CHECK_MARKED_OBJECTS */ | 5307 | #else /* not GC_CHECK_MARKED_OBJECTS */ |
| 5308 | 5308 | ||
| 5309 | #define CHECK_ALLOCATED() (void) 0 | ||
| 5310 | #define CHECK_LIVE(LIVEP) (void) 0 | 5309 | #define CHECK_LIVE(LIVEP) (void) 0 |
| 5311 | #define CHECK_ALLOCATED_AND_LIVE(LIVEP) (void) 0 | 5310 | #define CHECK_ALLOCATED_AND_LIVE(LIVEP) (void) 0 |
| 5312 | 5311 | ||