]> gitweb.factorcode.org Git - factor.git/blob - vm/stacks.hpp
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / vm / stacks.hpp
1 namespace factor
2 {
3
4 #define DEFPUSHPOP(prefix,ptr) \
5         inline static cell prefix##peek() { return *(cell *)ptr; } \
6         inline static void prefix##repl(cell tagged) { *(cell *)ptr = tagged; } \
7         inline static cell prefix##pop() \
8         { \
9                 cell value = prefix##peek(); \
10                 ptr -= sizeof(cell); \
11                 return value; \
12         } \
13         inline static void prefix##push(cell tagged) \
14         { \
15                 ptr += sizeof(cell); \
16                 prefix##repl(tagged); \
17         }
18
19 }