diff options
| author | Paul Eggert | 2019-08-21 22:19:03 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-08-21 22:30:18 -0700 |
| commit | 2b552f34892ee3c73f4b5fb5380218dc6ebbf4bb (patch) | |
| tree | a5c875fa6082cb43b403a9bfa0b3ef2b90d93ebc | |
| parent | ceebf3efbea7faffc01558d88c91250539c737e0 (diff) | |
| download | emacs-2b552f34892ee3c73f4b5fb5380218dc6ebbf4bb.tar.gz emacs-2b552f34892ee3c73f4b5fb5380218dc6ebbf4bb.zip | |
Don’t debug fset by default
This GC bug seems to have been fixed, so the check is no longer
needed in production code. From a suggestion by Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2019-08/msg00316.html
* src/alloc.c (SUSPICIOUS_OBJECT_CHECKING) [!ENABLE_CHECKING]:
Do not define.
(find_suspicious_object_in_range, detect_suspicious_free):
Expand to proper dummy expressions if !SUSPICIOUS_OBJECT_CHECKING.
* src/data.c (Ffset): Convert test to an eassert.
| -rw-r--r-- | src/alloc.c | 12 | ||||
| -rw-r--r-- | src/data.c | 5 |
2 files changed, 5 insertions, 12 deletions
diff --git a/src/alloc.c b/src/alloc.c index 53af7325f47..39964c4b293 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -302,15 +302,11 @@ static intptr_t garbage_collection_inhibited; | |||
| 302 | 302 | ||
| 303 | const char *pending_malloc_warning; | 303 | const char *pending_malloc_warning; |
| 304 | 304 | ||
| 305 | #if 0 /* Normally, pointer sanity only on request... */ | 305 | /* Pointer sanity only on request. FIXME: Code depending on |
| 306 | SUSPICIOUS_OBJECT_CHECKING is obsolete; remove it entirely. */ | ||
| 306 | #ifdef ENABLE_CHECKING | 307 | #ifdef ENABLE_CHECKING |
| 307 | #define SUSPICIOUS_OBJECT_CHECKING 1 | 308 | #define SUSPICIOUS_OBJECT_CHECKING 1 |
| 308 | #endif | 309 | #endif |
| 309 | #endif | ||
| 310 | |||
| 311 | /* ... but unconditionally use SUSPICIOUS_OBJECT_CHECKING while the GC | ||
| 312 | bug is unresolved. */ | ||
| 313 | #define SUSPICIOUS_OBJECT_CHECKING 1 | ||
| 314 | 310 | ||
| 315 | #ifdef SUSPICIOUS_OBJECT_CHECKING | 311 | #ifdef SUSPICIOUS_OBJECT_CHECKING |
| 316 | struct suspicious_free_record | 312 | struct suspicious_free_record |
| @@ -327,8 +323,8 @@ static int suspicious_free_history_index; | |||
| 327 | static void *find_suspicious_object_in_range (void *begin, void *end); | 323 | static void *find_suspicious_object_in_range (void *begin, void *end); |
| 328 | static void detect_suspicious_free (void *ptr); | 324 | static void detect_suspicious_free (void *ptr); |
| 329 | #else | 325 | #else |
| 330 | # define find_suspicious_object_in_range(begin, end) NULL | 326 | # define find_suspicious_object_in_range(begin, end) ((void *) NULL) |
| 331 | # define detect_suspicious_free(ptr) (void) | 327 | # define detect_suspicious_free(ptr) ((void) 0) |
| 332 | #endif | 328 | #endif |
| 333 | 329 | ||
| 334 | /* Maximum amount of C stack to save when a GC happens. */ | 330 | /* Maximum amount of C stack to save when a GC happens. */ |
diff --git a/src/data.c b/src/data.c index 8344bfdd3d5..2797adfcdc8 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -771,10 +771,7 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0, | |||
| 771 | if (AUTOLOADP (function)) | 771 | if (AUTOLOADP (function)) |
| 772 | Fput (symbol, Qautoload, XCDR (function)); | 772 | Fput (symbol, Qautoload, XCDR (function)); |
| 773 | 773 | ||
| 774 | /* Convert to eassert or remove after GC bug is found. In the | 774 | eassert (valid_lisp_object_p (definition)); |
| 775 | meantime, check unconditionally, at a slight perf hit. */ | ||
| 776 | if (! valid_lisp_object_p (definition)) | ||
| 777 | emacs_abort (); | ||
| 778 | 775 | ||
| 779 | set_symbol_function (symbol, definition); | 776 | set_symbol_function (symbol, definition); |
| 780 | 777 | ||