X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana2%2Ftiming.c;h=c8b73213508a96a8059298c88e2020e0be5077bb;hb=29902f3b814d06659a96397214bc3f491895415b;hp=cb1088a9d74a9b0f26c4a5d9eaf9784227f44cee;hpb=2612e4e1fb7e6b1447af30bcb4153518ec5a05cb;p=libfirm diff --git a/ir/ana2/timing.c b/ir/ana2/timing.c index cb1088a9d..c8b732135 100644 --- a/ir/ana2/timing.c +++ b/ir/ana2/timing.c @@ -1,30 +1,42 @@ /* -*- c -*- */ /* - * Time-stamp: <26.10.2004 11:57:13h liekweg> - * Project: libFIRM - * File name: ir/ana2/timing.c - * Purpose: generic timing routines - * Author: Florian - * Modified by: - * Created: Mon 18 Oct 2004 - * CVS-ID: $Id$ - * Copyright: (c) 1999-2004 Universität Karlsruhe - * Licence: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE. + * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * + * This file is part of libFirm. + * + * This file may be distributed and/or modified under the terms of the + * GNU General Public License version 2 as published by the Free Software + * Foundation and appearing in the file LICENSE.GPL included in the + * packaging of this file. + * + * Licensees holding valid libFirm Professional Edition licenses may use + * this file in accordance with the libFirm Commercial License. + * Agreement provided with the Software. + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. */ -/* - Timing stuff. Not really part of ana2, but where else should it go. -*/ +/** + * @file + * @brief generic timing routines + * @author Florian + * @date Mon 18 Oct 2004 + * @version $Id$ + * @note + * Timing stuff. Not really part of ana2, but where else should it go. + */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include -#include -# include "timing.h" +#include "timing.h" +#include "xmalloc.h" struct timing_env { @@ -32,7 +44,15 @@ struct timing_env struct timeval *end; }; - +#ifdef _WIN32 +/* no support yet */ +timing_t *start_timing (void) {} +int end_timing (timing_t *t) {} + +#else +#include + + /* Helpers */ @@ -55,17 +75,17 @@ timeval_subtract (struct timeval *x, struct timeval *y) return ((x->tv_sec - y->tv_sec) * 1000000 + (x->tv_usec - y->tv_usec)); } - + /* Public Interface */ timing_t * start_timing (void) { - timing_t *t = (timing_t*) malloc (sizeof (timing_t)); + timing_t *t = (timing_t*) xmalloc (sizeof (timing_t)); - t->start = (struct timeval*) malloc (sizeof (struct timeval)); - t->end = (struct timeval*) malloc (sizeof (struct timeval)); + t->start = (struct timeval*) xmalloc (sizeof (struct timeval)); + t->end = (struct timeval*) xmalloc (sizeof (struct timeval)); gettimeofday (t->start, NULL); @@ -92,15 +112,23 @@ end_timing (timing_t *t) return (time); } +#endif /* _WIN32 */ + - /* $Log$ + Revision 1.5 2006/09/12 12:17:37 matze + more warning fixes + + Revision 1.4 2006/06/06 12:06:27 beck + use xmalloc instead of malloc + + Revision 1.3 2005/01/05 14:25:38 beck + added Win32 "support" + Revision 1.2 2004/12/21 15:52:23 beck moved struct timing_env to .c file, added config.h Revision 1.1 2004/10/29 18:55:52 liekweg (mostly) generic timimg - - */