mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
* lib/timevar.c (get_time): Include children time.
* src/lalr.h (LA, LArule): Don't export them: used with the state_t. * src/lalr.c (LA, LArule): Static. * src/lalr.h, src/lalr.c (lalr_free): New. * src/main.c (main): Call it. * src/tables.c (pack_vector): Check whether loc is >= to the table_size, not >. (pack_tables): Don't free froms, tos, conflict_tos, and pos... (tables_generate): do it, since that's also it which allocates them. Don't free LA and LArule, main does.
This commit is contained in:
@@ -207,15 +207,18 @@ get_time (now)
|
||||
{
|
||||
#ifdef USE_TIMES
|
||||
struct tms tms;
|
||||
now->wall = times (&tms) * ticks_to_msec;
|
||||
now->user = tms.tms_utime * ticks_to_msec;
|
||||
now->sys = tms.tms_stime * ticks_to_msec;
|
||||
now->wall = times (&tms) * ticks_to_msec;
|
||||
now->user = (tms.tms_utime + tms.tms_cutime) * ticks_to_msec;
|
||||
now->sys = (tms.tms_stime + tms.tms_cstime) * ticks_to_msec;
|
||||
#endif
|
||||
#ifdef USE_GETRUSAGE
|
||||
struct rusage rusage;
|
||||
getrusage (RUSAGE_SELF, &rusage);
|
||||
now->user = rusage.ru_utime.tv_sec + rusage.ru_utime.tv_usec * 1e-6;
|
||||
now->sys = rusage.ru_stime.tv_sec + rusage.ru_stime.tv_usec * 1e-6;
|
||||
getrusage (RUSAGE_CHILDREN, &rusage);
|
||||
now->user += rusage.ru_utime.tv_sec + rusage.ru_utime.tv_usec * 1e-6;
|
||||
now->sys += rusage.ru_stime.tv_sec + rusage.ru_stime.tv_usec * 1e-6;
|
||||
#endif
|
||||
#ifdef USE_CLOCK
|
||||
now->user = clock () * clocks_to_msec;
|
||||
|
||||
Reference in New Issue
Block a user