source: doc/theses/mike_brooks_MMath/benchmarks/list/fx-cfa-cfa.h @ d96d4f0

Last change on this file since d96d4f0 was 0b66ef9, checked in by Michael Brooks <mlbrooks@…>, 19 months ago

Add linked list performance experiment

  • Property mode set to 100644
File size: 1.1 KB
Line 
1#include <containers/list.hfa>
2
3#define BFX_INTRUSION(S)                         inline dlink(S);
4#define BFX_EXTRUSION_DECL(S)
5#define BFX_EXTRUSION_FOLLOWUP(S)                P9_EMBEDDED( S, dlink(S) )
6#define BFX_LIST_HEAD_T(S)                       dlist(S)
7#define BFX_LISTED_ELEM_T(S)                     S*
8
9#define BFX_INSERT_FIRST(S, lst, item)           (insert_first (lst, item), (S*)&(item))
10#define BFX_INSERT_LAST(S, lst, item)            (insert_last  (lst, item), (S*)&(item))
11#define BFX_INSERT_BEFORE(S, lst, item, refIter) (insert_before(*refIter, item), (S*)&(item))
12#define BFX_INSERT_AFTER(S, lst, item, refIter)  (insert_after (*refIter, item), (S*)&(item))
13#define BFX_REMOVE_FIRST(S, lst)                 remove(lst`first)
14#define BFX_REMOVE_LAST(S, lst)                  remove(lst`last)
15#define BFX_REMOVE_HERE(S, lst, refIter)         remove(*refIter)
16#define BFX_INIT(S, lst)
17
18#define BFX_GET_AFTER(S, lst, iter)              (&(*iter)`next)
19#define BFX_GET_BEFORE(S, lst, iter)             (&(*iter)`prev)
20#define BFX_IS_VALID_POS(S, lst, iter)           ((iter)!=NULL)
21#define BFX_DEREF_POS(S, lst, iter)              (iter)
Note: See TracBrowser for help on using the repository browser.