diff options
Diffstat (limited to 'src/defs.h')
-rw-r--r-- | src/defs.h | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -30,6 +30,18 @@ .get_next_element_cache = stub_getnext, .place_next_element_direct = stub_put, \ .place_next_element_cache = stub_put, .split = stub_split, .flush = stub_flush +union nextoff { + struct entry_l *next; + ptrdiff_t offset; + int64_t spacer; /* make sure it is 8-byte-alligned on 32 bit pointer systems */ +}; + +union cachewrap { + char *cache; + struct entry *cache_a; + struct entry_l *cache_l; +}; + /* for array implementation */ struct entry { uint64_t val; @@ -38,7 +50,7 @@ struct entry { /* for linked list implementation */ struct entry_l { struct entry; - int64_t next; /* """pointer""" to the next element. */ + union nextoff; }; enum opmode { @@ -73,11 +85,10 @@ struct stream { char *name; size_t stride; size_t index; - struct entry_l *cnode; - char *cache; + struct entry_l *pnode; /* "previous" node */ + struct entry_l *cnode; /* "current" node */ + union cachewrap; struct settings *settings; - struct entry *cache_a; - struct entry_l *cache_l; struct entry_l *(*get_next_element_direct)(struct stream * const); struct entry_l *(*get_next_element_cache)(struct stream * const); int (*place_next_element_direct)(struct stream * const, struct entry_l const * const); |