svn: r4018
This commit is contained in:
Matthew Flatt 2006-08-10 17:01:52 +00:00
parent 552cda94f9
commit 314091946d
9 changed files with 973 additions and 1008 deletions

View File

@ -1169,7 +1169,6 @@ void MrEdMacSleep(float secs, void *fds, SLEEP_PROC_PTR mzsleep)
} else { } else {
EventRecord e; EventRecord e;
#ifdef OS_X
if (!cb_socket_ready) { if (!cb_socket_ready) {
/* ARGH: We set up a pipe for the purpose of breaking the Carbon /* ARGH: We set up a pipe for the purpose of breaking the Carbon
event manager out of its loop. When the watcher thread sees event manager out of its loop. When the watcher thread sees
@ -1218,21 +1217,17 @@ void MrEdMacSleep(float secs, void *fds, SLEEP_PROC_PTR mzsleep)
if (!StartFDWatcher(mzsleep, secs, fds)) { if (!StartFDWatcher(mzsleep, secs, fds)) {
secs = 0; secs = 0;
} }
#endif
going++; going++;
#ifdef OS_X
if (need_post) /* useless check in principle, but an optimization if (need_post) /* useless check in principle, but an optimization
in the case that the select() succeeds before in the case that the select() succeeds before
we even start */ we even start */
#endif
if (WNE(&e, secs ? secs : kEventDurationForever)) if (WNE(&e, secs ? secs : kEventDurationForever))
QueueTransferredEvent(&e); QueueTransferredEvent(&e);
--going; --going;
#ifdef OS_X
/* Shut down the watcher thread */ /* Shut down the watcher thread */
EndFDWatcher(); EndFDWatcher();
if (cb_socket_ready) { if (cb_socket_ready) {
@ -1240,7 +1235,6 @@ void MrEdMacSleep(float secs, void *fds, SLEEP_PROC_PTR mzsleep)
char buf[1]; char buf[1];
read(ready_sock, buf, 1); read(ready_sock, buf, 1);
} }
#endif
} }
} }

View File

@ -2730,14 +2730,14 @@ static int record_stack_source = 0;
#else #else
# define X_source(p) /* */ # define X_source(p) /* */
#endif #endif
#define gcX(p) gcMARK(p) #define gcX(a) gcMARK(*a)
#include "var_stack.c" #include "var_stack.c"
#undef GC_X_variable_stack #undef GC_X_variable_stack
#undef gcX #undef gcX
#undef X_source #undef X_source
#define GC_X_variable_stack GC_fixup_variable_stack #define GC_X_variable_stack GC_fixup_variable_stack
#define gcX(p) gcFIXUP(p) #define gcX(a) gcFIXUP(*a)
#define X_source(p) /* */ #define X_source(p) /* */
#include "var_stack.c" #include "var_stack.c"
#undef GC_X_variable_stack #undef GC_X_variable_stack
@ -2757,7 +2757,8 @@ static void check_ptr(void **a)
page = find_page(p); page = find_page(p);
if (page) { if (page) {
if (page->type == MTYPE_TAGGED) { if ((page->type == MTYPE_TAGGED)
&& !(page->flags & MFLAG_BIGBLOCK)) {
Type_Tag tag; Type_Tag tag;
tag = *(Type_Tag *)p; tag = *(Type_Tag *)p;
@ -2769,7 +2770,7 @@ static void check_ptr(void **a)
&& (tag != gc_on_free_list_tag))) { && (tag != gc_on_free_list_tag))) {
GCPRINT(GCOUTF, "bad tag: %d at %lx, references from %lx\n", tag, (long)p, (long)a); GCPRINT(GCOUTF, "bad tag: %d at %lx, references from %lx\n", tag, (long)p, (long)a);
GCFLUSHOUT(); GCFLUSHOUT();
CRASH(7); CRASH(70);
} }
} }
@ -2782,63 +2783,24 @@ static void check_ptr(void **a)
} }
# endif # endif
#define GC_X_variable_stack GC_do_check_variable_stack
#define gcX(a) check_ptr(a)
#define X_source(p) /* */
#include "var_stack.c"
#undef GC_X_variable_stack
#undef gcX
#undef X_source
void GC_check_variable_stack() void GC_check_variable_stack()
{ {
void **limit, **var_stack;
# if CHECK_STACK_PTRS # if CHECK_STACK_PTRS
long size, count; GC_do_check_variable_stack(GC_variable_stack,
void ***p, **a; 0,
(void **)(GC_get_thread_stack_base
? GC_get_thread_stack_base()
: stack_base));
# endif # endif
limit = (void **)(GC_get_thread_stack_base
? GC_get_thread_stack_base()
: stack_base);
var_stack = GC_variable_stack;
while (var_stack) {
if (var_stack == limit)
return;
# ifdef XXXXXXXXX
if (*var_stack && ((unsigned long)*var_stack <= (unsigned long)var_stack))
CRASH(33);
# endif
size = *(long *)(var_stack + 1);
if (var_stack + size + 2 == limit)
return;
# if CHECK_STACK_PTRS
size = *(long *)(var_stack + 1);
oo_var_stack = o_var_stack;
o_var_stack = var_stack;
p = (void ***)(var_stack + 2);
while (size--) {
a = *p;
if (!a) {
/* Array */
count = ((long *)p)[2];
a = ((void ***)p)[1];
p += 2;
size -= 2;
while (count--) {
check_ptr(a);
a++;
}
} else {
check_ptr(a);
}
p++;
}
#endif
var_stack = *var_stack;
}
} }
#endif #endif

View File

@ -861,7 +861,7 @@ unsigned long GC_get_stack_base()
#include "stack_comp.c" #include "stack_comp.c"
#define GC_X_variable_stack GC_mark_variable_stack #define GC_X_variable_stack GC_mark_variable_stack
#define gcX(p) gcMARK(p) #define gcX(a) gcMARK(*a)
#define X_source(p) set_backtrace_source(p, BT_STACK) #define X_source(p) set_backtrace_source(p, BT_STACK)
#include "var_stack.c" #include "var_stack.c"
#undef GC_X_variable_stack #undef GC_X_variable_stack
@ -869,7 +869,7 @@ unsigned long GC_get_stack_base()
#undef X_source #undef X_source
#define GC_X_variable_stack GC_fixup_variable_stack #define GC_X_variable_stack GC_fixup_variable_stack
#define gcX(p) gcFIXUP(p) #define gcX(a) gcFIXUP(*a)
#define X_source(p) /* */ #define X_source(p) /* */
#include "var_stack.c" #include "var_stack.c"
#undef GC_X_variable_stack #undef GC_X_variable_stack

View File

@ -36,7 +36,7 @@ void GC_X_variable_stack(void **var_stack, long delta, void *limit)
if (SHALLOWER_STACK_ADDRESS(a, limit)) { if (SHALLOWER_STACK_ADDRESS(a, limit)) {
while (count--) { while (count--) {
X_source(a); X_source(a);
gcX(*a); gcX(a);
a++; a++;
} }
} }
@ -44,7 +44,7 @@ void GC_X_variable_stack(void **var_stack, long delta, void *limit)
a = (void **)((char *)a + delta); a = (void **)((char *)a + delta);
if (SHALLOWER_STACK_ADDRESS(a, limit)) { if (SHALLOWER_STACK_ADDRESS(a, limit)) {
X_source(a); X_source(a);
gcX(*a); gcX(a);
} }
} }
p++; p++;
@ -64,13 +64,13 @@ void GC_X_variable_stack(void **var_stack, long delta, void *limit)
a = (void **)((char *)a + delta); a = (void **)((char *)a + delta);
while (count--) { while (count--) {
X_source(a); X_source(a);
gcX(*a); gcX(a);
a++; a++;
} }
} else { } else {
a = (void **)((char *)a + delta); a = (void **)((char *)a + delta);
X_source(a); X_source(a);
gcX(*a); gcX(a);
} }
p++; p++;
} }

File diff suppressed because it is too large Load Diff

View File

@ -1277,11 +1277,16 @@ scheme_resolve_closure_compilation(Scheme_Object *_data, Resolve_Info *info,
if (!closure_size) { if (!closure_size) {
if (precomputed_lift) { if (precomputed_lift) {
result = SCHEME_CAR(precomputed_lift); result = SCHEME_CAR(precomputed_lift);
((Scheme_Closure *)result)->code = data; if (!just_compute_lift)
} else ((Scheme_Closure *)result)->code = data;
result = scheme_make_closure(NULL, (Scheme_Object *)data, 0); } else {
if (just_compute_lift)
result = (Scheme_Object *)scheme_malloc_empty_closure();
else
result = scheme_make_closure(NULL, (Scheme_Object *)data, 0);
}
} else } else
result = (Scheme_Object *)data; result = (Scheme_Object *)data;
if (need_lift) { if (need_lift) {
if (just_compute_lift) { if (just_compute_lift) {

View File

@ -448,6 +448,9 @@ static struct protoent *proto;
# define mz_gai_strerror gai_strerror # define mz_gai_strerror gai_strerror
#else #else
# define mzAI_PASSIVE 0 # define mzAI_PASSIVE 0
# ifdef MZ_XFORM
START_XFORM_SKIP;
# endif
static int mz_getaddrinfo(const char *nodename, const char *servname, static int mz_getaddrinfo(const char *nodename, const char *servname,
const struct mz_addrinfo *hints, struct mz_addrinfo **res) const struct mz_addrinfo *hints, struct mz_addrinfo **res)
{ {
@ -501,6 +504,9 @@ const char *mz_gai_strerror(int ecode)
{ {
return hstrerror(ecode); return hstrerror(ecode);
} }
# ifdef MZ_XFORM
END_XFORM_SKIP;
# endif
#endif #endif
#if defined(USE_WINSOCK_TCP) || defined(PTHREADS_OK_FOR_GHBN) #if defined(USE_WINSOCK_TCP) || defined(PTHREADS_OK_FOR_GHBN)

View File

@ -300,7 +300,7 @@ void scheme_forget_subthread(struct Scheme_Thread_Memory *);
void scheme_suspend_remembered_threads(void); void scheme_suspend_remembered_threads(void);
void scheme_resume_remembered_threads(void); void scheme_resume_remembered_threads(void);
#endif #endif
#ifdef USE_WIN32_THREAD_TIMER #if defined(USE_WIN32_THREAD_TIMER) || defined(USE_PTHREAD_THREAD_TIMER)
void scheme_start_itimer_thread(long usec); void scheme_start_itimer_thread(long usec);
#endif #endif

View File

@ -9,6 +9,6 @@
#define MZSCHEME_VERSION_MAJOR 352 #define MZSCHEME_VERSION_MAJOR 352
#define MZSCHEME_VERSION_MINOR 2 #define MZSCHEME_VERSION_MINOR 3
#define MZSCHEME_VERSION "352.2" _MZ_SPECIAL_TAG #define MZSCHEME_VERSION "352.3" _MZ_SPECIAL_TAG