summaryrefslogtreecommitdiffabout
path: root/src/timer.c
Side-by-side diff
Diffstat (limited to 'src/timer.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/timer.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/timer.c b/src/timer.c
index 1634462..cece63a 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -11,25 +11,24 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with wydawca. If not, see <http://www.gnu.org/licenses/>. */
#include <wydawca.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
-#include <xalloc.h>
struct timer_slot
{
char *name;
double real;
double self_user; /* user time in sec */
double self_system; /* system time in sec */
double children_user; /* user time in sec */
double children_system; /* system time in sec */
struct timeval real_mark;
struct rusage self_mark;
struct rusage children_mark;
@@ -173,25 +172,25 @@ timer_format_time (double t)
s -= h * 3600;
m = s / 60;
s -= m * 60;
if (d)
grecs_asprintf (&str, &size, "%ld+%02ld:%02ld:%02ld", d, h, m, s);
else if (h)
grecs_asprintf (&str, &size, "%02ld:%02ld:%02ld", h, m, s);
else
grecs_asprintf (&str, &size, "%02ld:%02ld", m, s);
}
if (!str)
- xalloc_die ();
+ grecs_alloc_die ();
return str;
}
size_t
timer_get_count ()
{
return _timer_count;
}
struct timer_data
{
struct metadef *def;
@@ -201,25 +200,25 @@ struct timer_data
int
_fill_meta (void *sym, void *data)
{
struct timer_slot *slot = sym;
struct timer_data *tp = data;
#define CREATE_DEF(arg) \
if (tp->num) \
{ \
char *buf = NULL; \
size_t size = 0; \
grecs_asprintf (&buf, &size, "timer:%s:%s", slot->name, #arg); \
if (!buf) \
- xalloc_die (); \
+ grecs_alloc_die (); \
tp->def->kw = buf; \
tp->def->storage = timer_format_time (__cat2__(timer_get_,arg) (slot)); \
tp->def->value = tp->def->storage; \
tp->def->expand = NULL; \
tp->def++; \
tp->num--; \
}
CREATE_DEF(system);
CREATE_DEF(real);
CREATE_DEF(user);

Return to:

Send suggestions and report system problems to the System administrator.