Reorder chan struct to reduce cache misses
This commit is contained in:
parent
2d8b68bff2
commit
c72f71e61e
@ -98,10 +98,10 @@ chan_set(struct chan *chan, struct value value)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DEBUG
|
||||
char buf[128];
|
||||
UNUSED(buf);
|
||||
dbg("%s: sets value to %s\n",
|
||||
chan->name, value_str(value, buf));
|
||||
dbg("%s: sets value to %s", chan->name, value_str(value, buf));
|
||||
#endif
|
||||
chan->data.value = value;
|
||||
|
||||
if (set_dirty(chan) != 0) {
|
||||
|
@ -43,14 +43,14 @@ struct chan;
|
||||
typedef int (*chan_cb_t)(struct chan *chan, void *ptr);
|
||||
|
||||
struct chan {
|
||||
char name[MAX_CHAN_NAME];
|
||||
enum chan_type type;
|
||||
union chan_data data;
|
||||
int is_dirty;
|
||||
int prop[CHAN_MAXPROP];
|
||||
struct value last_value;
|
||||
chan_cb_t dirty_cb;
|
||||
void *dirty_arg;
|
||||
struct value last_value;
|
||||
enum chan_type type;
|
||||
union chan_data data;
|
||||
char name[MAX_CHAN_NAME];
|
||||
};
|
||||
|
||||
void chan_init(struct chan *chan, enum chan_type type, const char *fmt, ...);
|
||||
|
Loading…
Reference in New Issue
Block a user