Commit 464b522e authored by Erick Gallesio's avatar Erick Gallesio

Preparing version stklos-0.80-beta7

parent dd21b978
2006-10-28 Erick Gallesio <eg@essi.fr>
* src/mutex-pthreads.c:
* src/misc.c:
* src/stklos.c:
* src/stklos.h: Fixes for MacOS X
2006-10-27 Erick Gallesio <eg@essi.fr>
* Changed the GC to version 7.0alpha7
......
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: 9-Jan-2000 12:50 (eg)
* Last file update: 4-Apr-2006 19:00 (eg)
* Last file update: 28-Oct-2006 20:03 (eg)
*/
#include "stklos.h"
......@@ -121,6 +121,25 @@ DEFINE_PRIMITIVE("address-of", address_of, subr1, (SCM object))
}
/*===========================================================================*\
*
* GC stuff
*
\*===========================================================================*/
#ifdef STK_DEBUG
static void ignore_GC_warning(char *msg, GC_word arg) { return; }
#endif
void STk_gc_init(void)
{
GC_init();
#ifdef STK_DEBUG
/* No warning when on production. Is this reasonable? */
GC_set_warn_proc(ignore_GC_warning);
#endif
}
/*
<doc gc
* (gc)
......
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: 28-Dec-1999 21:19 (eg)
* Last file update: 28-Oct-2006 17:45 (eg)
* Last file update: 28-Oct-2006 19:59 (eg)
*/
#include <stklos.h>
......@@ -142,6 +142,12 @@ int mymain(int argc, char *argv[])
int ret;
char *argv0 = *argv;
/* Initialize the Garbage Collector */
#if (defined(__CYGWIN32__) && defined(GC_DLL)) || defined(_AIX)
# error GC problem
#endif
STk_gc_init();
/* Process command arguments */
ret = process_program_arguments(argc, argv);
argc -= ret;
......@@ -178,12 +184,6 @@ int mymain(int argc, char *argv[])
int main(int argc, char *argv[])
{
/* Initialize the Garbage Collector */
#if (defined(__CYGWIN32__) && defined(GC_DLL)) || defined(_AIX)
# error GC problem
#endif
STk_gc_init();
#ifdef THREADS_LURC
return STk_thread_main(&mymain, argc, argv);
#else
......
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: 28-Dec-1999 22:58 (eg)
* Last file update: 28-Oct-2006 17:37 (eg)
* Last file update: 28-Oct-2006 20:09 (eg)
*/
#ifndef STKLOS_H
......@@ -147,7 +147,10 @@ extern "C"
#define STk_register_finalizer(ptr, f) GC_register_finalizer((void *) (ptr), \
(GC_finalization_proc)(f), 0, 0, 0)
#define STk_gc() GC_gcollect()
#define STk_gc_init() GC_init()
void STk_gc_init(void);
/*===========================================================================*\
*
......@@ -273,6 +276,15 @@ struct primitive_obj {
#define THE_PRIMITIVE(_name) ((SCM) CPP_CONCAT(&STk_o_, _name))
/*
------------------------------------------------------------------------------
----
---- B A S E 6 4 . C
----
------------------------------------------------------------------------------
*/
int STk_init_base64(void);
/*
------------------------------------------------------------------------------
......@@ -1099,7 +1111,6 @@ int STk_init_symbol(void);
int STk_dirp(const char *path);
int STk_init_system();
int STk_do_exit_tasks(SCM retcode);
EXTERN_PRIMITIVE("%pre-exit", pre_exit, subr1, (SCM retcode));
EXTERN_PRIMITIVE("exit", exit, subr01, (SCM retcode));
......@@ -1113,6 +1124,8 @@ EXTERN_PRIMITIVE("exit", exit, subr01, (SCM retcode));
------------------------------------------------------------------------------
*/
EXTERN_PRIMITIVE("current-thread", current_thread, subr0, (void));
int STk_init_threads(int stack_size, void *start_stack);
int STk_init_mutexes(void);
/*
------------------------------------------------------------------------------
......
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@essi.fr]
* Creation date: 23-Jan-2006 12:14 (eg)
* Last file update: 25-Oct-2006 16:20 (eg)
* Last file update: 28-Oct-2006 19:27 (eg)
*/
......@@ -120,8 +120,9 @@ void STk_sys_thread_start(SCM thr)
pthread_attr_setdetachstate(&attr, TRUE);
// pthread_mutex_lock(&THREAD_MYMUTEX(thr));
if (pthread_create(&THREAD_PTHREAD(thr), NULL, start_scheme_thread, thr))
/* !!!!! Use the GC_pthread_create instaed of pthread_create !!!!! */
if (GC_pthread_create(&THREAD_PTHREAD(thr), NULL, start_scheme_thread, thr))
STk_error("cannot start thread ~S", thr);
pthread_attr_destroy(&attr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment