mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-27 01:10:10 +01:00
perf: Remove unused alarm functions
This commit is contained in:
parent
df8cc10073
commit
499a3a7c47
5 changed files with 0 additions and 63 deletions
|
|
@ -64,35 +64,6 @@ timer_elapsed (void) {
|
|||
return d;
|
||||
}
|
||||
|
||||
/* alarms */
|
||||
|
||||
void
|
||||
alarm_handler (int signal) {
|
||||
if (signal == SIGALRM) {
|
||||
cairo_perf_alarm_expired = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
set_alarm (double seconds) {
|
||||
struct itimerval tr;
|
||||
long sec, usec;
|
||||
|
||||
cairo_perf_alarm_expired = 0;
|
||||
signal (SIGALRM, alarm_handler);
|
||||
|
||||
sec = floor (seconds);
|
||||
seconds -= sec;
|
||||
usec = seconds * 1e6;
|
||||
|
||||
tr.it_interval.tv_sec = 0;
|
||||
tr.it_interval.tv_usec = 0;
|
||||
tr.it_value.tv_sec = sec;
|
||||
tr.it_value.tv_usec = usec;
|
||||
|
||||
setitimer (ITIMER_REAL, &tr, NULL);
|
||||
}
|
||||
|
||||
/* yield */
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -63,26 +63,6 @@ timer_elapsed (void) {
|
|||
return d;
|
||||
}
|
||||
|
||||
/* alarms */
|
||||
|
||||
void CALLBACK
|
||||
alarm_handler (void *closure, DWORD dwTimerLowValue, DWORD dwTimerHighValue) {
|
||||
cairo_perf_alarm_expired = 1;
|
||||
}
|
||||
|
||||
HANDLE hTimer = NULL;
|
||||
void
|
||||
set_alarm (double seconds) {
|
||||
if (hTimer == NULL)
|
||||
hTimer = CreateWaitableTimer(NULL, TRUE, NULL);
|
||||
cairo_perf_alarm_expired = 0;
|
||||
|
||||
LARGE_INTEGER expTime;
|
||||
expTime.QuadPart = - (seconds * 10000000);
|
||||
if (!SetWaitableTimer (hTimer, &expTime, 0, alarm_handler, &cairo_perf_alarm_expired, FALSE))
|
||||
fprintf (stderr, "SetWaitableTimer failed!\n");
|
||||
}
|
||||
|
||||
/* yield */
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -34,8 +34,6 @@ typedef struct _cairo_perf_timer_t cairo_perf_timer_t;
|
|||
|
||||
/* timers */
|
||||
|
||||
extern int alarm_expired;
|
||||
|
||||
void
|
||||
timer_start (void);
|
||||
|
||||
|
|
@ -45,14 +43,6 @@ timer_stop (void);
|
|||
double
|
||||
timer_elapsed (void);
|
||||
|
||||
/* alarms */
|
||||
|
||||
void
|
||||
alarm_handler (int signal);
|
||||
|
||||
void
|
||||
set_alarm (double seconds);
|
||||
|
||||
/* yield */
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -29,8 +29,6 @@
|
|||
|
||||
int cairo_perf_iterations = 100;
|
||||
|
||||
int cairo_perf_alarm_expired = 0;
|
||||
|
||||
typedef struct _cairo_perf {
|
||||
const char *name;
|
||||
cairo_perf_func_t run;
|
||||
|
|
|
|||
|
|
@ -32,8 +32,6 @@
|
|||
|
||||
#include "cairo-perf-timer.h"
|
||||
|
||||
extern int cairo_perf_alarm_expired;
|
||||
|
||||
typedef double (*cairo_perf_func_t) (cairo_t *cr, int width, int height);
|
||||
|
||||
#define CAIRO_PERF_DECL(func) double func (cairo_t *cr, int width, int height)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue