qemu-timer: Optimize data structures
Remove all holes which were found by pahole on Linux x86_64 (and replace "struct QEMUTimer" by "QEMUTimer"). Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
8205199d7b
commit
9a14b298bb
14
qemu-timer.c
14
qemu-timer.c
@ -47,22 +47,22 @@
|
|||||||
#define QEMU_CLOCK_HOST 2
|
#define QEMU_CLOCK_HOST 2
|
||||||
|
|
||||||
struct QEMUClock {
|
struct QEMUClock {
|
||||||
int type;
|
|
||||||
bool enabled;
|
|
||||||
|
|
||||||
QEMUTimer *active_timers;
|
QEMUTimer *active_timers;
|
||||||
|
|
||||||
NotifierList reset_notifiers;
|
NotifierList reset_notifiers;
|
||||||
int64_t last;
|
int64_t last;
|
||||||
|
|
||||||
|
int type;
|
||||||
|
bool enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct QEMUTimer {
|
struct QEMUTimer {
|
||||||
QEMUClock *clock;
|
|
||||||
int64_t expire_time; /* in nanoseconds */
|
int64_t expire_time; /* in nanoseconds */
|
||||||
int scale;
|
QEMUClock *clock;
|
||||||
QEMUTimerCB *cb;
|
QEMUTimerCB *cb;
|
||||||
void *opaque;
|
void *opaque;
|
||||||
struct QEMUTimer *next;
|
QEMUTimer *next;
|
||||||
|
int scale;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct qemu_alarm_timer {
|
struct qemu_alarm_timer {
|
||||||
@ -71,8 +71,8 @@ struct qemu_alarm_timer {
|
|||||||
void (*stop)(struct qemu_alarm_timer *t);
|
void (*stop)(struct qemu_alarm_timer *t);
|
||||||
void (*rearm)(struct qemu_alarm_timer *t, int64_t nearest_delta_ns);
|
void (*rearm)(struct qemu_alarm_timer *t, int64_t nearest_delta_ns);
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
int fd;
|
|
||||||
timer_t timer;
|
timer_t timer;
|
||||||
|
int fd;
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
HANDLE timer;
|
HANDLE timer;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user