[uim-commit] r1560 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Sat Sep 24 03:19:20 PDT 2005
Author: yamaken
Date: 2005-09-24 03:19:17 -0700 (Sat, 24 Sep 2005)
New Revision: 1560
Modified:
branches/r5rs/sigscheme/sigscheme.h
branches/r5rs/sigscheme/storage-protection.c
Log:
* sigscheme/sigscheme.h
- (SigScm_GC_ProtectStack): Add the 'designated_stack_start' arg
- (SCM_GC_CALL_PROTECTED_FUNC_INTERNAL): Follow the API change
* sigscheme/storage-protection.c
- (SigScm_GC_ProtectStack):
* Support the 'designated_stack_start' arg
* Add some comments
Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h 2005-09-24 04:59:51 UTC (rev 1559)
+++ branches/r5rs/sigscheme/sigscheme.h 2005-09-24 10:19:17 UTC (rev 1560)
@@ -146,7 +146,7 @@
SCM_GC_PROTECTED_FUNC_T(func) fp; \
ScmObj *stack_start; \
\
- stack_start = SigScm_GC_ProtectStack(); \
+ stack_start = SigScm_GC_ProtectStack(NULL); \
fp = (SCM_GC_PROTECTED_FUNC_T(func)) \
SigScm_GC_EnsureUninlinedFunc((ScmCFunc)&func); \
exp_ret (*fp)args; \
@@ -213,7 +213,7 @@
* Ordinary programs should not call these functions directly. Use
* SCM_GC_CALL_PROTECTED_*FUNC() instead.
*/
-ScmObj *SigScm_GC_ProtectStack(void) SCM_NOINLINE;
+ScmObj *SigScm_GC_ProtectStack(ScmObj *designated_stack_start) SCM_NOINLINE;
void SigScm_GC_UnprotectStack(ScmObj *stack_start) SCM_NOINLINE;
ScmCFunc SigScm_GC_EnsureUninlinedFunc(ScmCFunc func) SCM_NOINLINE;
#endif /* SCM_GCC4_READY_GC */
Modified: branches/r5rs/sigscheme/storage-protection.c
===================================================================
--- branches/r5rs/sigscheme/storage-protection.c 2005-09-24 04:59:51 UTC (rev 1559)
+++ branches/r5rs/sigscheme/storage-protection.c 2005-09-24 10:19:17 UTC (rev 1560)
@@ -225,15 +225,22 @@
Function Implementations
=======================================*/
#if SCM_GCC4_READY_GC
-ScmObj *SigScm_GC_ProtectStack(void)
+ScmObj *SigScm_GC_ProtectStack(ScmObj *designated_stack_start)
{
- ScmObj stack_start = NULL;
+ /*
+ * &stack_start will be relocated to start of the frame of subsequent
+ * function call
+ */
+ ScmObj stack_start;
+ if (!designated_stack_start)
+ designated_stack_start = &stack_start;
+
if (!scm_stack_start_pointer)
- scm_stack_start_pointer = &stack_start;
+ scm_stack_start_pointer = designated_stack_start;
- /* intentionally returning invalidated local address */
- return &stack_start;
+ /* may intentionally be an invalidated local address */
+ return designated_stack_start;
}
void SigScm_GC_UnprotectStack(ScmObj *stack_start)
More information about the uim-commit
mailing list