diff options
| author | Dmitry Antipov | 2012-07-20 17:14:58 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-07-20 17:14:58 +0400 |
| commit | dac616ff9f51b77e399a06863a79446958c4f840 (patch) | |
| tree | ed956a463f0efff837c7de4a9a61b31e2567d45a /src/alloc.c | |
| parent | bbf0e7d97893b9abfe6575a408f03e48543cb513 (diff) | |
| download | emacs-dac616ff9f51b77e399a06863a79446958c4f840.tar.gz emacs-dac616ff9f51b77e399a06863a79446958c4f840.zip | |
Make maybe_gc inline.
Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
* lisp.h (consing_since_gc, gc_relative_threshold)
(memory_full_cons_threshold): Revert declaration.
(maybe_gc): Remove prototype, define as inline.
* alloc.c: Remove old commented-out code.
(consing_since_gc, gc_relative_threshold)
(memory_full_cons_threshold): Revert to global.
(maybe_gc): Remove.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/alloc.c b/src/alloc.c index 36040f70b2d..e7d67e95dbe 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -166,16 +166,16 @@ struct emacs_globals globals; | |||
| 166 | 166 | ||
| 167 | /* Number of bytes of consing done since the last gc. */ | 167 | /* Number of bytes of consing done since the last gc. */ |
| 168 | 168 | ||
| 169 | static EMACS_INT consing_since_gc; | 169 | EMACS_INT consing_since_gc; |
| 170 | 170 | ||
| 171 | /* Similar minimum, computed from Vgc_cons_percentage. */ | 171 | /* Similar minimum, computed from Vgc_cons_percentage. */ |
| 172 | 172 | ||
| 173 | static EMACS_INT gc_relative_threshold; | 173 | EMACS_INT gc_relative_threshold; |
| 174 | 174 | ||
| 175 | /* Minimum number of bytes of consing since GC before next GC, | 175 | /* Minimum number of bytes of consing since GC before next GC, |
| 176 | when memory is full. */ | 176 | when memory is full. */ |
| 177 | 177 | ||
| 178 | static EMACS_INT memory_full_cons_threshold; | 178 | EMACS_INT memory_full_cons_threshold; |
| 179 | 179 | ||
| 180 | /* Nonzero during GC. */ | 180 | /* Nonzero during GC. */ |
| 181 | 181 | ||
| @@ -5374,18 +5374,6 @@ bounded_number (EMACS_INT number) | |||
| 5374 | return make_number (min (MOST_POSITIVE_FIXNUM, number)); | 5374 | return make_number (min (MOST_POSITIVE_FIXNUM, number)); |
| 5375 | } | 5375 | } |
| 5376 | 5376 | ||
| 5377 | /* Check whether it's time for GC, and run it if so. */ | ||
| 5378 | |||
| 5379 | void | ||
| 5380 | maybe_gc (void) | ||
| 5381 | { | ||
| 5382 | if ((consing_since_gc > gc_cons_threshold | ||
| 5383 | && consing_since_gc > gc_relative_threshold) | ||
| 5384 | || (!NILP (Vmemory_full) | ||
| 5385 | && consing_since_gc > memory_full_cons_threshold)) | ||
| 5386 | Fgarbage_collect (); | ||
| 5387 | } | ||
| 5388 | |||
| 5389 | DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "", | 5377 | DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "", |
| 5390 | doc: /* Reclaim storage for Lisp objects no longer needed. | 5378 | doc: /* Reclaim storage for Lisp objects no longer needed. |
| 5391 | Garbage collection happens automatically if you cons more than | 5379 | Garbage collection happens automatically if you cons more than |
| @@ -5474,8 +5462,6 @@ See Info node `(elisp)Garbage Collection'. */) | |||
| 5474 | 5462 | ||
| 5475 | gc_in_progress = 1; | 5463 | gc_in_progress = 1; |
| 5476 | 5464 | ||
| 5477 | /* clear_marks (); */ | ||
| 5478 | |||
| 5479 | /* Mark all the special slots that serve as the roots of accessibility. */ | 5465 | /* Mark all the special slots that serve as the roots of accessibility. */ |
| 5480 | 5466 | ||
| 5481 | for (i = 0; i < staticidx; i++) | 5467 | for (i = 0; i < staticidx; i++) |
| @@ -5592,7 +5578,6 @@ See Info node `(elisp)Garbage Collection'. */) | |||
| 5592 | 5578 | ||
| 5593 | CHECK_CONS_LIST (); | 5579 | CHECK_CONS_LIST (); |
| 5594 | 5580 | ||
| 5595 | /* clear_marks (); */ | ||
| 5596 | gc_in_progress = 0; | 5581 | gc_in_progress = 0; |
| 5597 | 5582 | ||
| 5598 | consing_since_gc = 0; | 5583 | consing_since_gc = 0; |