comparison src/profile.c @ 5581:56144c8593a8

Mechanically change INT to FIXNUM in our sources. src/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT (where it refers to non-bignum Lisp integers) to FIXNUM in our sources. Done for the following functions, enums, and macros: Lisp_Type_Int_Even, Lisp_Type_Int_Odd, INT_GCBITS, INT_VALBITS, make_int(), INTP(), XINT(), CHECK_INT(), XREALINT(), INT_PLUS(), INT_MINUS(), EMACS_INT_MAX (to MOST_POSITIVE_FIXNUM), EMACS_INT_MIN (to MOST_NEGATIVE_FIXNUM), NUMBER_FITS_IN_AN_EMACS_INT() to NUMBER_FITS_IN_A_FIXNUM(), XFLOATINT, XCHAR_OR_INT, INT_OR_FLOAT. The EMACS_INT typedef was not changed, it does not describe non-bignum Lisp integers. Script that did the change available in http://mid.gmane.org/20067.17650.181273.12014@parhasard.net . modules/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers. See the src/ChangeLog entry for more details. man/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> * internals/internals.texi (How Lisp Objects Are Represented in C): * internals/internals.texi (Integers and Characters): Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 09 Oct 2011 09:51:57 +0100
parents 0af042a0c116
children 3192994c49ca
comparison
equal deleted inserted replaced
5580:a0e81357194e 5581:56144c8593a8
201 201
202 inline static void 202 inline static void
203 profile_sow_backtrace (struct backtrace *bt) 203 profile_sow_backtrace (struct backtrace *bt)
204 { 204 {
205 bt->current_total_timing_val = 205 bt->current_total_timing_val =
206 XINT (Fgethash (*bt->function, Vtotal_timing_profile_table, Qzero)); 206 XFIXNUM (Fgethash (*bt->function, Vtotal_timing_profile_table, Qzero));
207 bt->current_total_gc_usage_val = 207 bt->current_total_gc_usage_val =
208 XINT (Fgethash (*bt->function, Vtotal_gc_usage_profile_table, Qzero)); 208 XFIXNUM (Fgethash (*bt->function, Vtotal_gc_usage_profile_table, Qzero));
209 bt->function_being_called = 1; 209 bt->function_being_called = 1;
210 /* Need to think carefully about the exact order of operations here 210 /* Need to think carefully about the exact order of operations here
211 so that we don't end up with totals being less than function-only 211 so that we don't end up with totals being less than function-only
212 values; */ 212 values; */
213 bt->total_consing_at_start = total_consing; 213 bt->total_consing_at_start = total_consing;
253 is executing, and its value will be > our total value. */ 253 is executing, and its value will be > our total value. */
254 bt->function_being_called = 0; 254 bt->function_being_called = 0;
255 Fputhash (*bt->function, 255 Fputhash (*bt->function,
256 /* This works even when the total_ticks value has overwrapped. 256 /* This works even when the total_ticks value has overwrapped.
257 Same for total_consing below. */ 257 Same for total_consing below. */
258 make_int ((EMACS_INT) (ticks - bt->total_ticks_at_start) 258 make_fixnum ((EMACS_INT) (ticks - bt->total_ticks_at_start)
259 + bt->current_total_timing_val), 259 + bt->current_total_timing_val),
260 Vtotal_timing_profile_table); 260 Vtotal_timing_profile_table);
261 Fputhash (*bt->function, 261 Fputhash (*bt->function,
262 make_int ((EMACS_INT) 262 make_fixnum ((EMACS_INT)
263 (total_consing - bt->total_consing_at_start) 263 (total_consing - bt->total_consing_at_start)
264 + bt->current_total_gc_usage_val), 264 + bt->current_total_gc_usage_val),
265 Vtotal_gc_usage_profile_table); 265 Vtotal_gc_usage_profile_table);
266 } 266 }
267 267
362 if (NILP (microsecs)) 362 if (NILP (microsecs))
363 msecs = default_profiling_interval; 363 msecs = default_profiling_interval;
364 else 364 else
365 { 365 {
366 #ifdef HAVE_BIGNUM 366 #ifdef HAVE_BIGNUM
367 check_integer_range (microsecs, make_int (1000), make_integer (INT_MAX)); 367 check_integer_range (microsecs, make_fixnum (1000), make_integer (INT_MAX));
368 msecs = 368 msecs =
369 BIGNUMP (microsecs) ? bignum_to_int (XBIGNUM_DATA (microsecs)) : 369 BIGNUMP (microsecs) ? bignum_to_int (XBIGNUM_DATA (microsecs)) :
370 XINT (microsecs); 370 XFIXNUM (microsecs);
371 #else 371 #else
372 check_integer_range (microsecs, make_int (1000), 372 check_integer_range (microsecs, make_fixnum (1000),
373 make_integer (EMACS_INT_MAX)); 373 make_integer (MOST_POSITIVE_FIXNUM));
374 msecs = XINT (microsecs); 374 msecs = XFIXNUM (microsecs);
375 #endif 375 #endif
376 } 376 }
377 if (msecs <= 0) 377 if (msecs <= 0)
378 msecs = 1000; 378 msecs = 1000;
379 379
471 EMACS_INT val; 471 EMACS_INT val;
472 472
473 key = GET_LISP_FROM_VOID (void_key); 473 key = GET_LISP_FROM_VOID (void_key);
474 val = (EMACS_INT) void_val; 474 val = (EMACS_INT) void_val;
475 475
476 Fputhash (key, make_int (val), closure->timing); 476 Fputhash (key, make_fixnum (val), closure->timing);
477 return 0; 477 return 0;
478 } 478 }
479 479
480 static Lisp_Object 480 static Lisp_Object
481 copy_hash_table_or_blank (Lisp_Object table) 481 copy_hash_table_or_blank (Lisp_Object table)
532 for profile overhead, and it looks strange for it to come out 0, 532 for profile overhead, and it looks strange for it to come out 0,
533 so make sure it looks reasonable. */ 533 so make sure it looks reasonable. */
534 if (!gethash (STORE_LISP_IN_VOID (QSprofile_overhead), big_profile_table, 534 if (!gethash (STORE_LISP_IN_VOID (QSprofile_overhead), big_profile_table,
535 &overhead)) 535 &overhead))
536 overhead = 0; 536 overhead = 0;
537 Fputhash (QSprofile_overhead, make_int ((EMACS_INT) overhead), 537 Fputhash (QSprofile_overhead, make_fixnum ((EMACS_INT) overhead),
538 Vtotal_timing_profile_table); 538 Vtotal_timing_profile_table);
539 539
540 unbind_to (count); 540 unbind_to (count);
541 } 541 }
542 542
558 set_profiling_info_timing_maphash (Lisp_Object key, 558 set_profiling_info_timing_maphash (Lisp_Object key,
559 Lisp_Object val, 559 Lisp_Object val,
560 void *UNUSED (void_closure)) 560 void *UNUSED (void_closure))
561 { 561 {
562 /* This function does not GC */ 562 /* This function does not GC */
563 if (!INTP (val)) 563 if (!FIXNUMP (val))
564 invalid_argument_2 564 invalid_argument_2
565 ("Function timing count is not an integer in given entry", 565 ("Function timing count is not an integer in given entry",
566 key, val); 566 key, val);
567 567
568 puthash (STORE_LISP_IN_VOID (key), (void *) XINT (val), big_profile_table); 568 puthash (STORE_LISP_IN_VOID (key), (void *) XFIXNUM (val), big_profile_table);
569 569
570 return 0; 570 return 0;
571 } 571 }
572 572
573 DEFUN ("set-profiling-info", Fset_profiling_info, 1, 1, 0, /* 573 DEFUN ("set-profiling-info", Fset_profiling_info, 1, 1, 0, /*