Commit 211a0b2a authored by Paul Eggert's avatar Paul Eggert

* alloc.c (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.

parent 5a25e253
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
(n_vectors, n_symbol_blocks, n_marker_blocks): Remove. (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
These were 'int' variables that could overflow on 64-bit hosts; These were 'int' variables that could overflow on 64-bit hosts;
they were never used, so remove them instead of repairing them. they were never used, so remove them instead of repairing them.
(nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
* alloc.c (Fmake_bool_vector): Don't assume vector size fits in int. * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
(allocate_vectorlike): Check for ptrdiff_t overflow. (allocate_vectorlike): Check for ptrdiff_t overflow.
......
...@@ -3905,11 +3905,11 @@ static Lisp_Object zombies[MAX_ZOMBIES]; ...@@ -3905,11 +3905,11 @@ static Lisp_Object zombies[MAX_ZOMBIES];
/* Number of zombie objects. */ /* Number of zombie objects. */
static int nzombies; static EMACS_INT nzombies;
/* Number of garbage collections. */ /* Number of garbage collections. */
static int ngcs; static EMACS_INT ngcs;
/* Average percentage of zombies per collection. */ /* Average percentage of zombies per collection. */
...@@ -3917,7 +3917,7 @@ static double avg_zombies; ...@@ -3917,7 +3917,7 @@ static double avg_zombies;
/* Max. number of live and zombie objects. */ /* Max. number of live and zombie objects. */
static int max_live, max_zombies; static EMACS_INT max_live, max_zombies;
/* Average number of live objects per GC. */ /* Average number of live objects per GC. */
...@@ -3928,7 +3928,7 @@ DEFUN ("gc-status", Fgc_status, Sgc_status, 0, 0, "", ...@@ -3928,7 +3928,7 @@ DEFUN ("gc-status", Fgc_status, Sgc_status, 0, 0, "",
(void) (void)
{ {
Lisp_Object args[8], zombie_list = Qnil; Lisp_Object args[8], zombie_list = Qnil;
int i; EMACS_INT i;
for (i = 0; i < nzombies; i++) for (i = 0; i < nzombies; i++)
zombie_list = Fcons (zombies[i], zombie_list); zombie_list = Fcons (zombies[i], zombie_list);
args[0] = build_string ("%d GCs, avg live/zombies = %.2f/%.2f (%f%%), max %d/%d\nzombies: %S"); args[0] = build_string ("%d GCs, avg live/zombies = %.2f/%.2f (%f%%), max %d/%d\nzombies: %S");
...@@ -4255,7 +4255,7 @@ dump_zombies (void) ...@@ -4255,7 +4255,7 @@ dump_zombies (void)
{ {
int i; int i;
fprintf (stderr, "\nZombies kept alive = %d:\n", nzombies); fprintf (stderr, "\nZombies kept alive = %"pI":\n", nzombies);
for (i = 0; i < min (MAX_ZOMBIES, nzombies); ++i) for (i = 0; i < min (MAX_ZOMBIES, nzombies); ++i)
{ {
fprintf (stderr, " %d = ", i); fprintf (stderr, " %d = ", i);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment