1 /* Copyright (C) 1995,1996,1997, 2000, 2001 Free Software Foundation, Inc.
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "libguile/_scm.h"
22 #include "libguile/ports.h"
23 #include "libguile/root.h"
25 #include "libguile/stackchk.h"
32 int scm_stack_checking_enabled_p
;
34 SCM_SYMBOL (scm_stack_overflow_key
, "stack-overflow");
37 scm_report_stack_overflow ()
39 scm_stack_checking_enabled_p
= 0;
40 scm_error (scm_stack_overflow_key
,
50 scm_stack_size (SCM_STACKITEM
*start
)
53 #if SCM_STACK_GROWS_UP
54 return &stack
- start
;
56 return start
- &stack
;
57 #endif /* SCM_STACK_GROWS_UP */
65 scm_intprint (scm_stack_size (SCM_BASE (scm_rootcont
)) * sizeof (SCM_STACKITEM
),
67 scm_puts (" of stack: 0x", scm_cur_errp
);
68 scm_intprint ((long) SCM_BASE (scm_rootcont
), 16, scm_cur_errp
);
69 scm_puts (" - 0x", scm_cur_errp
);
70 scm_intprint ((long) &stack
, 16, scm_cur_errp
);
71 scm_puts ("\n", scm_cur_errp
);
80 #include "libguile/stackchk.x"