Increased alloca support

This commit is contained in:
Justin Ethier 2018-10-26 13:03:54 -04:00
parent 6bc445e9ed
commit 4824fc50ed
2 changed files with 25 additions and 1 deletions

View file

@ -1128,11 +1128,30 @@ typedef pair_type *pair;
make_pair(l##__2, a2, &l##__3); \
make_pair(l, a1, &l##__2);
#define alloca_list_1(l, a1) \
alloca_pair(l, a1, NULL);
#define alloca_list_2(l, a1, a2) \
alloca_pair(l##__2, a2, NULL); \
alloca_pair(l, a1, &l##__2);
#define alloca_list_3(l, a1, a2, a3) \
alloca_pair(l##__3, a3, NULL); \
alloca_pair(l##__2, a2, &l##__3); \
alloca_pair(l, a1, &l##__2);
#define alloca_list_4(l, a1, a2, a3, a4) \
alloca_pair(l##__4, a4, NULL); \
alloca_pair(l##__3, a3, &l##__4); \
alloca_pair(l##__2, a2, &l##__3); \
alloca_pair(l, a1, &l##__2);
/**
* Create a pair with a single value.
* This is useful to create an object that can be modified.
*/
#define make_cell(n,a) make_pair(n,a,NULL);
#define alloca_cell(n,a) alloca_pair(n,a,NULL);
/**
* \defgroup objects_unsafe_cxr Unsafe pair access macros

View file

@ -465,7 +465,12 @@
;; created via alloca or such, and cannot be declared as stack vars.
;; This is to support C loops in place of recursion.
(cond
((eq? p 'cons) "alloca_pair")
((eq? p 'cons) "alloca_pair")
((eq? p 'Cyc-fast-list-1) "alloca_list_1")
((eq? p 'Cyc-fast-list-2) "alloca_list_2")
((eq? p 'Cyc-fast-list-3) "alloca_list_3")
((eq? p 'Cyc-fast-list-4) "alloca_list_4")
((eq? p 'cell) "alloca_cell")
(else
(_prim->c-func p))))
(else