mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
* stacks.h: In struct scm_stack: Turn field frames into a pointer.
Turn n_tail into an integer directly representing current number of frames in stack. Add field tail.
This commit is contained in:
parent
d7189b4983
commit
c692c370d8
1 changed files with 5 additions and 4 deletions
|
@ -61,17 +61,18 @@ typedef struct scm_info_frame {
|
|||
#define SCM_FRAME_N_SLOTS (sizeof (scm_info_frame) / sizeof (SCM))
|
||||
|
||||
#define SCM_STACK(obj) ((scm_stack *) SCM_STRUCT_DATA (obj))
|
||||
#define SCM_STACK_LAYOUT "pwpW"
|
||||
#define SCM_STACK_LAYOUT "pwuopW"
|
||||
typedef struct scm_stack {
|
||||
SCM id; /* Stack id */
|
||||
unsigned long n_tail; /* Size of struct tail array */
|
||||
scm_info_frame frames[1]; /* Info frames */
|
||||
scm_info_frame *frames; /* Info frames */
|
||||
unsigned int length; /* Stack length */
|
||||
scm_info_frame tail[1];
|
||||
} scm_stack;
|
||||
|
||||
extern SCM scm_stack_type;
|
||||
|
||||
#define SCM_STACKP(obj) (SCM_STRUCTP (obj) && SCM_STRUCT_VTABLE (obj) == scm_stack_type)
|
||||
#define SCM_STACK_LENGTH(stack) (SCM_STACK (stack) -> n_tail / SCM_FRAME_N_SLOTS)
|
||||
#define SCM_STACK_LENGTH(stack) (SCM_STACK (stack) -> length)
|
||||
|
||||
#define SCM_FRAMEP(obj) (SCM_CONSP (obj) \
|
||||
&& SCM_NIMP (SCM_CAR (obj)) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue