restore Cygwin support
Fix various configuration problems, and make the build work with 3m (probably for the first time). The repairs include corrections for the manual link table, but also switch Cygwin to relying on normal DLL exports, instead, to work properly with the FFI. The `--enable-shared` comfiguration option is no longer required for Cygwin. When it is used, the `gracket` launcher does not work right, because the Cygwin DLL is in the "bin" directory and "gracket.exe" is in the "lib" directory. Along similar lines, stand-alone executables won't work with `--enable-shared`. The change to `ffi/winapi` makes it match the documentation.
This commit is contained in:
parent
d7ee4c3fb5
commit
cceda78374
|
@ -37,8 +37,8 @@
|
||||||
#:wrap (allocator release-pixbuf))
|
#:wrap (allocator release-pixbuf))
|
||||||
|
|
||||||
(define-gdk gdk_cairo_set_source_pixbuf (_fun _cairo_t _GdkPixbuf _double* _double* -> _void))
|
(define-gdk gdk_cairo_set_source_pixbuf (_fun _cairo_t _GdkPixbuf _double* _double* -> _void))
|
||||||
(define-gdk gdk_pixbuf_get_width (_fun _GdkPixbuf -> _int))
|
(define-gdk_pixbuf gdk_pixbuf_get_width (_fun _GdkPixbuf -> _int))
|
||||||
(define-gdk gdk_pixbuf_get_height (_fun _GdkPixbuf -> _int))
|
(define-gdk_pixbuf gdk_pixbuf_get_height (_fun _GdkPixbuf -> _int))
|
||||||
|
|
||||||
(define free-it (ffi-callback free
|
(define free-it (ffi-callback free
|
||||||
(list _pointer)
|
(list _pointer)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
(require ffi/unsafe
|
(require ffi/unsafe
|
||||||
ffi/unsafe/define
|
ffi/unsafe/define
|
||||||
|
ffi/winapi
|
||||||
"utils.rkt")
|
"utils.rkt")
|
||||||
|
|
||||||
(provide gdk_win32_drawable_get_handle
|
(provide gdk_win32_drawable_get_handle
|
||||||
|
@ -20,7 +21,7 @@
|
||||||
(define-gdk gdk_win32_drawable_get_handle (_fun _GdkDrawable -> _pointer)
|
(define-gdk gdk_win32_drawable_get_handle (_fun _GdkDrawable -> _pointer)
|
||||||
#:make-fail make-not-available)
|
#:make-fail make-not-available)
|
||||||
|
|
||||||
(define-user32 GetDC (_fun #:abi 'stdcall _pointer -> _pointer)
|
(define-user32 GetDC (_fun #:abi winapi _pointer -> _pointer)
|
||||||
#:make-fail make-not-available)
|
#:make-fail make-not-available)
|
||||||
(define-user32 ReleaseDC (_fun #:abi 'stdcall _pointer -> _void)
|
(define-user32 ReleaseDC (_fun #:abi winapi _pointer -> _void)
|
||||||
#:make-fail make-not-available)
|
#:make-fail make-not-available)
|
||||||
|
|
|
@ -886,8 +886,8 @@
|
||||||
;; they either take one argument or no pointer arguments.
|
;; they either take one argument or no pointer arguments.
|
||||||
;; So we can ignore them:
|
;; So we can ignore them:
|
||||||
|
|
||||||
|
|
||||||
__get_errno_ptr ; QNX preprocesses errno to __get_errno_ptr
|
__get_errno_ptr ; QNX preprocesses errno to __get_errno_ptr
|
||||||
|
__getreent ; Cygwin
|
||||||
|
|
||||||
strlen cos cosl sin sinl exp expl pow powl log logl sqrt sqrtl atan2 atan2l
|
strlen cos cosl sin sinl exp expl pow powl log logl sqrt sqrtl atan2 atan2l
|
||||||
isnan isinf fpclass _fpclass __fpclassify __fpclassifyf __fpclassifyl
|
isnan isinf fpclass _fpclass __fpclassify __fpclassifyf __fpclassifyl
|
||||||
|
|
|
@ -6,4 +6,7 @@
|
||||||
(and (eq? 'windows (system-type))
|
(and (eq? 'windows (system-type))
|
||||||
(equal? "win32\\x86_64" (path->string (system-library-subpath #f)))))
|
(equal? "win32\\x86_64" (path->string (system-library-subpath #f)))))
|
||||||
|
|
||||||
(define winapi (if win64? 'default 'stdcall))
|
(define winapi (if (or win64?
|
||||||
|
(not (eq? 'windows (system-type))))
|
||||||
|
'default
|
||||||
|
'stdcall))
|
||||||
|
|
|
@ -31,11 +31,10 @@ The result is a Windows-style build, but without MzCOM. If you are using
|
||||||
a variant of MinGW without "libdelayimp.a", get the implementation of
|
a variant of MinGW without "libdelayimp.a", get the implementation of
|
||||||
"delayimp.c" from MinGW-w64 and compile it to "libdelayimp.a".
|
"delayimp.c" from MinGW-w64 and compile it to "libdelayimp.a".
|
||||||
|
|
||||||
To compile with Cygwin tools, follow the Unix instructions below, and be
|
To compile with Cygwin tools, follow the Unix instructions below. The
|
||||||
sure to configure with `--enable-shared'. The result is a Unix-style
|
result is a Unix-style build, not a Windows-style build (e.g.,
|
||||||
build, not a Windows-style build (e.g., Racket's `system-type' procedure
|
Racket's `system-type' procedure returns 'unix, not 'windows, and
|
||||||
returns 'unix, not 'windows, and `racket/gui' uses Gtk instead of
|
`racket/gui' uses Gtk instead of Win32).
|
||||||
Win32).
|
|
||||||
|
|
||||||
Beware that MinGW/Cygwin builds different from the MSVC build when
|
Beware that MinGW/Cygwin builds different from the MSVC build when
|
||||||
SSE-based floating-point math is enabled in the C compiler. In that
|
SSE-based floating-point math is enabled in the C compiler. In that
|
||||||
|
|
1
racket/src/configure
vendored
1
racket/src/configure
vendored
|
@ -4584,7 +4584,6 @@ $as_echo "#define HAVE_STDINT_H 1" >>confdefs.h
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
cygwin*)
|
cygwin*)
|
||||||
enable_cgcdefault="yes"
|
|
||||||
MZINSTALLTARGET=unix-cygwin-install
|
MZINSTALLTARGET=unix-cygwin-install
|
||||||
if test "${enable_shared}" = "yes" ; then
|
if test "${enable_shared}" = "yes" ; then
|
||||||
ar_libtool_no_undefined=" -no-undefined"
|
ar_libtool_no_undefined=" -no-undefined"
|
||||||
|
|
|
@ -267,6 +267,9 @@ static Scheme_Object *foreign_ffi_lib(int argc, Scheme_Object *argv[])
|
||||||
# ifdef __ANDROID__
|
# ifdef __ANDROID__
|
||||||
if (!name) handle = RTLD_DEFAULT; else
|
if (!name) handle = RTLD_DEFAULT; else
|
||||||
# endif /* __ANDROID__ */
|
# endif /* __ANDROID__ */
|
||||||
|
# ifdef __CYGWIN32__
|
||||||
|
if (!name) { handle = RTLD_DEFAULT; null_ok = 1; } else
|
||||||
|
# endif /* __CYGWIN32__ */
|
||||||
handle = dlopen(name, RTLD_NOW | (as_global ? RTLD_GLOBAL : RTLD_LOCAL));
|
handle = dlopen(name, RTLD_NOW | (as_global ? RTLD_GLOBAL : RTLD_LOCAL));
|
||||||
# endif /* WINDOWS_DYNAMIC_LOAD */
|
# endif /* WINDOWS_DYNAMIC_LOAD */
|
||||||
if (handle == NULL && !null_ok) {
|
if (handle == NULL && !null_ok) {
|
||||||
|
|
|
@ -235,6 +235,7 @@ THREAD_LOCAL_DECL(static Scheme_Hash_Table *opened_libs);
|
||||||
handle = LoadLibraryW(WIDE_PATH(name));
|
handle = LoadLibraryW(WIDE_PATH(name));
|
||||||
}{
|
}{
|
||||||
@@IFDEF{__ANDROID__}{if (!name) handle = RTLD_DEFAULT; else}
|
@@IFDEF{__ANDROID__}{if (!name) handle = RTLD_DEFAULT; else}
|
||||||
|
@@IFDEF{__CYGWIN32__}{if (!name) { handle = RTLD_DEFAULT; null_ok = 1; } else}
|
||||||
handle = dlopen(name, RTLD_NOW | (as_global ? RTLD_GLOBAL : RTLD_LOCAL));
|
handle = dlopen(name, RTLD_NOW | (as_global ? RTLD_GLOBAL : RTLD_LOCAL));
|
||||||
}
|
}
|
||||||
if (handle == NULL && !null_ok) {
|
if (handle == NULL && !null_ok) {
|
||||||
|
|
|
@ -718,7 +718,6 @@ case "$host_os" in
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
cygwin*)
|
cygwin*)
|
||||||
enable_cgcdefault="yes"
|
|
||||||
MZINSTALLTARGET=unix-cygwin-install
|
MZINSTALLTARGET=unix-cygwin-install
|
||||||
if test "${enable_shared}" = "yes" ; then
|
if test "${enable_shared}" = "yes" ; then
|
||||||
ar_libtool_no_undefined=" -no-undefined"
|
ar_libtool_no_undefined=" -no-undefined"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#if defined(MZ_PRECISE_GC) && !defined(USE_COMPACT_3M_GC)
|
#if defined(MZ_PRECISE_GC) && !defined(USE_COMPACT_3M_GC)
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(MZ_USE_LARGE_PAGE_SIZE)
|
#if defined(_WIN32) || defined(__CYGWIN32__) || defined(MZ_USE_LARGE_PAGE_SIZE)
|
||||||
# define LOG_APAGE_SIZE 16
|
# define LOG_APAGE_SIZE 16
|
||||||
#else
|
#else
|
||||||
# define LOG_APAGE_SIZE 14
|
# define LOG_APAGE_SIZE 14
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
os_protect_pages
|
os_protect_pages
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) || defined(__CYGWIN32__)
|
||||||
|
|
||||||
/* VirtualProtect can be used only on pages allocated at the same
|
/* VirtualProtect can be used only on pages allocated at the same
|
||||||
time, so we can't collapse ranges. */
|
time, so we can't collapse ranges. */
|
||||||
|
|
|
@ -162,7 +162,10 @@ void fault_handler(int sn, struct siginfo *si, void *ctx)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ========== Windows signal handler ========== */
|
/* ========== Windows signal handler ========== */
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32) || defined(__CYGWIN32__)
|
||||||
|
# if defined(__CYGWIN32__)
|
||||||
|
# include <windows.h>
|
||||||
|
# endif
|
||||||
LONG WINAPI fault_handler(LPEXCEPTION_POINTERS e)
|
LONG WINAPI fault_handler(LPEXCEPTION_POINTERS e)
|
||||||
{
|
{
|
||||||
if ((e->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION)
|
if ((e->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION)
|
||||||
|
|
|
@ -16,8 +16,18 @@ enum {
|
||||||
MMU_WRITABLE = 1,
|
MMU_WRITABLE = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
#if (defined(MZ_USE_PLACES) && !defined(_WIN32)) || defined(PREFER_MMAP_LARGE_BLOCKS)
|
#if defined(_WIN32) || defined(__CYGWIN32__)
|
||||||
|
/* No block cache or alloc cache */
|
||||||
|
#elif defined(OSKIT)
|
||||||
|
# define OS_ALLOCATOR_NEEDS_ALIGNMENT
|
||||||
|
#elif defined(MZ_USE_PLACES) && defined(PREFER_MMAP_LARGE_BLOCKS)
|
||||||
# define USE_BLOCK_CACHE
|
# define USE_BLOCK_CACHE
|
||||||
|
#else
|
||||||
|
# define USE_ALLOC_CACHE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_BLOCK_CACHE
|
||||||
|
# define USE_ALLOC_CACHE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct AllocCacheBlock;
|
struct AllocCacheBlock;
|
||||||
|
@ -25,7 +35,7 @@ struct BlockCache;
|
||||||
typedef struct MMU {
|
typedef struct MMU {
|
||||||
#ifdef USE_BLOCK_CACHE
|
#ifdef USE_BLOCK_CACHE
|
||||||
struct BlockCache *block_cache;
|
struct BlockCache *block_cache;
|
||||||
#elif !( defined(_WIN32) || defined(OSKIT) )
|
#elif defined(USE_ALLOC_CACHE)
|
||||||
struct AllocCacheBlock *alloc_caches[2];
|
struct AllocCacheBlock *alloc_caches[2];
|
||||||
Page_Range *page_range;
|
Page_Range *page_range;
|
||||||
#endif
|
#endif
|
||||||
|
@ -34,16 +44,13 @@ typedef struct MMU {
|
||||||
NewGC *gc;
|
NewGC *gc;
|
||||||
} MMU;
|
} MMU;
|
||||||
|
|
||||||
#if !( defined(_WIN32) || defined(OSKIT) )
|
#ifdef OS_ALLOCATOR_NEEDS_ALIGNMENT
|
||||||
|
static void *os_alloc_aligned_pages(size_t len, size_t alignment, int dirty_ok)
|
||||||
|
#else
|
||||||
static void *os_alloc_pages(size_t len);
|
static void *os_alloc_pages(size_t len);
|
||||||
|
#endif
|
||||||
static void os_free_pages(void *p, size_t len);
|
static void os_free_pages(void *p, size_t len);
|
||||||
static void os_protect_pages(void *p, size_t len, int writable);
|
static void os_protect_pages(void *p, size_t len, int writable);
|
||||||
#else
|
|
||||||
static void *os_alloc_pages(MMU *mmu, size_t len, size_t alignment, int dirty);
|
|
||||||
static void os_free_pages(MMU *mmu, void *p, size_t len);
|
|
||||||
static void os_protect_pages(void *p, size_t len, int writable);
|
|
||||||
static void os_flush_freed_pages(MMU *mmu);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* provides */
|
/* provides */
|
||||||
static inline size_t mmu_get_os_page_size(MMU *mmu) { return mmu->os_pagesize; }
|
static inline size_t mmu_get_os_page_size(MMU *mmu) { return mmu->os_pagesize; }
|
||||||
|
@ -77,32 +84,29 @@ static inline void mmu_assert_os_page_aligned(MMU *mmu, size_t p) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_BLOCK_CACHE
|
#ifdef USE_BLOCK_CACHE
|
||||||
#include "block_cache.c"
|
# include "block_cache.c"
|
||||||
#include "alloc_cache.c"
|
#endif
|
||||||
#include "page_range.c"
|
#ifdef USE_ALLOC_CACHE
|
||||||
#include <unistd.h>
|
# include "alloc_cache.c"
|
||||||
#elif !( defined(_WIN32) || defined(OSKIT) )
|
# include "page_range.c"
|
||||||
#include "alloc_cache.c"
|
# include <unistd.h>
|
||||||
#include "page_range.c"
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static MMU *mmu_create(NewGC *gc) {
|
static MMU *mmu_create(NewGC *gc) {
|
||||||
MMU *mmu = ofm_malloc_zero(sizeof(MMU));
|
MMU *mmu = ofm_malloc_zero(sizeof(MMU));
|
||||||
mmu->gc = gc;
|
mmu->gc = gc;
|
||||||
|
|
||||||
#if !( defined(_WIN32) || defined(OSKIT) )
|
#ifdef USE_ALLOC_CACHE
|
||||||
#ifdef USE_BLOCK_CACHE
|
# ifdef USE_BLOCK_CACHE
|
||||||
mmu->block_cache = block_cache_create(mmu);
|
mmu->block_cache = block_cache_create(mmu);
|
||||||
#else
|
# else
|
||||||
/* initialization of page_range */
|
/* initialization of page_range */
|
||||||
mmu->page_range = page_range_create();
|
mmu->page_range = page_range_create();
|
||||||
|
|
||||||
/* initialization of alloc_cache */
|
/* initialization of alloc_cache */
|
||||||
mmu->alloc_caches[0] = alloc_cache_create();
|
mmu->alloc_caches[0] = alloc_cache_create();
|
||||||
mmu->alloc_caches[1] = alloc_cache_create();
|
mmu->alloc_caches[1] = alloc_cache_create();
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
mmu->os_pagesize = getpagesize();
|
mmu->os_pagesize = getpagesize();
|
||||||
#else
|
#else
|
||||||
|
@ -116,7 +120,7 @@ static void mmu_free(MMU *mmu) {
|
||||||
/* printf("MMU ALLOCATED PRE %li\n", mmu->memory_allocated); */
|
/* printf("MMU ALLOCATED PRE %li\n", mmu->memory_allocated); */
|
||||||
#ifdef USE_BLOCK_CACHE
|
#ifdef USE_BLOCK_CACHE
|
||||||
mmu->memory_allocated += block_cache_free(mmu->block_cache);
|
mmu->memory_allocated += block_cache_free(mmu->block_cache);
|
||||||
#elif !( defined(_WIN32) || defined(OSKIT) )
|
#elif defined(USE_ALLOC_CACHE)
|
||||||
page_range_free(mmu->page_range);
|
page_range_free(mmu->page_range);
|
||||||
mmu->memory_allocated += alloc_cache_free(mmu->alloc_caches[0]);
|
mmu->memory_allocated += alloc_cache_free(mmu->alloc_caches[0]);
|
||||||
mmu->memory_allocated += alloc_cache_free(mmu->alloc_caches[1]);
|
mmu->memory_allocated += alloc_cache_free(mmu->alloc_caches[1]);
|
||||||
|
@ -129,7 +133,7 @@ static void *mmu_alloc_page(MMU* mmu, size_t len, size_t alignment, int dirty, i
|
||||||
mmu_assert_os_page_aligned(mmu, len);
|
mmu_assert_os_page_aligned(mmu, len);
|
||||||
#ifdef USE_BLOCK_CACHE
|
#ifdef USE_BLOCK_CACHE
|
||||||
return block_cache_alloc_page(mmu->block_cache, len, alignment, dirty, type, expect_mprotect, src_block, &mmu->memory_allocated);
|
return block_cache_alloc_page(mmu->block_cache, len, alignment, dirty, type, expect_mprotect, src_block, &mmu->memory_allocated);
|
||||||
#elif !( defined(_WIN32) || defined(OSKIT) )
|
#elif defined(USE_ALLOC_CACHE)
|
||||||
/* len = mmu_round_up_to_os_page_size(mmu, len); */
|
/* len = mmu_round_up_to_os_page_size(mmu, len); */
|
||||||
{
|
{
|
||||||
AllocCacheBlock *alloc_cache = mmu->alloc_caches[!!expect_mprotect];
|
AllocCacheBlock *alloc_cache = mmu->alloc_caches[!!expect_mprotect];
|
||||||
|
@ -137,7 +141,11 @@ static void *mmu_alloc_page(MMU* mmu, size_t len, size_t alignment, int dirty, i
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
mmu->memory_allocated += len;
|
mmu->memory_allocated += len;
|
||||||
return os_alloc_pages(mmu, len, alignment, dirty);
|
# ifdef OS_ALLOCATOR_NEEDS_ALIGNMENT
|
||||||
|
return os_alloc_aligned_pages(len, alignment, dirty);
|
||||||
|
#else
|
||||||
|
return os_alloc_pages(len);
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +156,7 @@ static void mmu_free_page(MMU* mmu, void *p, size_t len, int type, int expect_mp
|
||||||
#ifdef USE_BLOCK_CACHE
|
#ifdef USE_BLOCK_CACHE
|
||||||
mmu->memory_allocated += block_cache_free_page(mmu->block_cache, p, len, type, expect_mprotect, src_block,
|
mmu->memory_allocated += block_cache_free_page(mmu->block_cache, p, len, type, expect_mprotect, src_block,
|
||||||
originated_here);
|
originated_here);
|
||||||
#elif !( defined(_WIN32) || defined(OSKIT) )
|
#elif defined(USE_ALLOC_CACHE)
|
||||||
/* len = mmu_round_up_to_os_page_size(mmu, len); */
|
/* len = mmu_round_up_to_os_page_size(mmu, len); */
|
||||||
{
|
{
|
||||||
AllocCacheBlock *alloc_cache = mmu->alloc_caches[!!expect_mprotect];
|
AllocCacheBlock *alloc_cache = mmu->alloc_caches[!!expect_mprotect];
|
||||||
|
@ -156,18 +164,16 @@ static void mmu_free_page(MMU* mmu, void *p, size_t len, int type, int expect_mp
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (originated_here) mmu->memory_allocated -= len;
|
if (originated_here) mmu->memory_allocated -= len;
|
||||||
os_free_pages(mmu, p, len);
|
os_free_pages(p, len);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mmu_flush_freed_pages(MMU *mmu) {
|
static void mmu_flush_freed_pages(MMU *mmu) {
|
||||||
#ifdef USE_BLOCK_CACHE
|
#ifdef USE_BLOCK_CACHE
|
||||||
mmu->memory_allocated += block_cache_flush_freed_pages(mmu->block_cache);
|
mmu->memory_allocated += block_cache_flush_freed_pages(mmu->block_cache);
|
||||||
#elif !( defined(_WIN32) || defined(OSKIT) )
|
#elif defined(USE_ALLOC_CACHE)
|
||||||
mmu->memory_allocated += alloc_cache_flush_freed_pages(mmu->alloc_caches[0]);
|
mmu->memory_allocated += alloc_cache_flush_freed_pages(mmu->alloc_caches[0]);
|
||||||
mmu->memory_allocated += alloc_cache_flush_freed_pages(mmu->alloc_caches[1]);
|
mmu->memory_allocated += alloc_cache_flush_freed_pages(mmu->alloc_caches[1]);
|
||||||
#elif defined(_WIN32)
|
|
||||||
os_flush_freed_pages(mmu);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +201,7 @@ static void mmu_queue_protect_range(MMU *mmu, void *p, size_t len, int type, int
|
||||||
mmu_assert_os_page_aligned(mmu, len);
|
mmu_assert_os_page_aligned(mmu, len);
|
||||||
#ifdef USE_BLOCK_CACHE
|
#ifdef USE_BLOCK_CACHE
|
||||||
block_cache_queue_protect_range(mmu->block_cache, p, len, type, writeable, src_block);
|
block_cache_queue_protect_range(mmu->block_cache, p, len, type, writeable, src_block);
|
||||||
#elif !( defined(_WIN32) || defined(OSKIT) )
|
#elif defined(USE_ALLOC_CACHE)
|
||||||
page_range_add(mmu->page_range, p, len, writeable);
|
page_range_add(mmu->page_range, p, len, writeable);
|
||||||
#else
|
#else
|
||||||
os_protect_pages(p, len, writeable);
|
os_protect_pages(p, len, writeable);
|
||||||
|
@ -213,7 +219,7 @@ static void mmu_queue_write_unprotect_range(MMU *mmu, void *p, size_t len, int t
|
||||||
static void mmu_flush_write_protect_ranges(MMU *mmu) {
|
static void mmu_flush_write_protect_ranges(MMU *mmu) {
|
||||||
#ifdef USE_BLOCK_CACHE
|
#ifdef USE_BLOCK_CACHE
|
||||||
block_cache_flush_protect_ranges(mmu->block_cache, MMU_WRITE_PROTECTED);
|
block_cache_flush_protect_ranges(mmu->block_cache, MMU_WRITE_PROTECTED);
|
||||||
#elif !( defined(_WIN32) || defined(OSKIT) )
|
#elif defined(USE_ALLOC_CACHE)
|
||||||
page_range_flush(mmu->page_range, MMU_WRITE_PROTECTED);
|
page_range_flush(mmu->page_range, MMU_WRITE_PROTECTED);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -221,7 +227,7 @@ static void mmu_flush_write_protect_ranges(MMU *mmu) {
|
||||||
static void mmu_flush_write_unprotect_ranges(MMU *mmu) {
|
static void mmu_flush_write_unprotect_ranges(MMU *mmu) {
|
||||||
#ifdef USE_BLOCK_CACHE
|
#ifdef USE_BLOCK_CACHE
|
||||||
block_cache_flush_protect_ranges(mmu->block_cache, MMU_WRITABLE);
|
block_cache_flush_protect_ranges(mmu->block_cache, MMU_WRITABLE);
|
||||||
#elif !( defined(_WIN32) || defined(OSKIT) )
|
#elif defined(USE_ALLOC_CACHE)
|
||||||
page_range_flush(mmu->page_range, MMU_WRITABLE);
|
page_range_flush(mmu->page_range, MMU_WRITABLE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,14 +9,14 @@
|
||||||
|
|
||||||
#include <oskit/c/malloc.h>
|
#include <oskit/c/malloc.h>
|
||||||
|
|
||||||
inline static void *os_malloc_pages(MMU *mmu, size_t len, size_t alignment, int dirty_ok)
|
inline static void *os_alloc_aligned_pages(size_t len, size_t alignment, int dirty_ok)
|
||||||
{
|
{
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
p = smemalign(alignment, len);
|
p = smemalign(alignment, len);
|
||||||
|
|
||||||
if (!dirty_ok)
|
if (!dirty_ok)
|
||||||
memset(p, 0, len);
|
memset(p, 0, len);
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,91 +7,19 @@
|
||||||
DONT_NEED_MAX_HEAP_SIZE --- to disable a provide
|
DONT_NEED_MAX_HEAP_SIZE --- to disable a provide
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Cache doesn't seem to help in Windows: */
|
static void *os_alloc_pages(size_t len)
|
||||||
#define CACHE_SLOTS 0
|
|
||||||
|
|
||||||
#if CACHE_SLOTS
|
|
||||||
typedef struct {
|
|
||||||
size_t len;
|
|
||||||
void *page;
|
|
||||||
} alloc_cache_entry;
|
|
||||||
|
|
||||||
/* First dimension is age: */
|
|
||||||
static alloc_cache_entry cache[2][CACHE_SLOTS];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void *os_alloc_pages(MMU *mmu, size_t len, size_t alignment, int dirty_ok)
|
|
||||||
{
|
{
|
||||||
#if CACHE_SLOTS
|
|
||||||
{
|
|
||||||
int i, j;
|
|
||||||
|
|
||||||
for (j = 0; j < 2; j++) {
|
|
||||||
for (i = 0; i < CACHE_SLOTS; i++) {
|
|
||||||
if (cache[j][i].len == len) {
|
|
||||||
if (cache[j][i].page) {
|
|
||||||
void *result = cache[j][i].page;
|
|
||||||
cache[j][i].page = *(void **)result;
|
|
||||||
memset(result, 0, len);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* VirtualAlloc MEM_COMMIT always zeros memory */
|
/* VirtualAlloc MEM_COMMIT always zeros memory */
|
||||||
return (void *)VirtualAlloc(NULL, len,
|
return (void *)VirtualAlloc(NULL, len,
|
||||||
MEM_COMMIT | MEM_RESERVE,
|
MEM_COMMIT | MEM_RESERVE,
|
||||||
PAGE_READWRITE);
|
PAGE_READWRITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void os_free_pages(MMU *mmu, void *p, size_t len)
|
static void os_free_pages(void *p, size_t len)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if CACHE_SLOTS
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < CACHE_SLOTS; i++) {
|
|
||||||
if (!cache[0][i].len)
|
|
||||||
cache[0][i].len = len;
|
|
||||||
if (cache[0][i].len == len) {
|
|
||||||
*(void **)p = cache[0][i].page;
|
|
||||||
cache[0][i].page = p;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VirtualFree(p, 0, MEM_RELEASE);
|
VirtualFree(p, 0, MEM_RELEASE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void os_flush_freed_pages(MMU *mmu)
|
|
||||||
{
|
|
||||||
#if CACHE_SLOTS
|
|
||||||
int i;
|
|
||||||
void *p, *next;
|
|
||||||
|
|
||||||
for (i = 0; i < CACHE_SLOTS; i++) {
|
|
||||||
if (cache[1][i].len) {
|
|
||||||
for (p = cache[1][i].page; p; p = next) {
|
|
||||||
next = *(void **)p;
|
|
||||||
mmu_memory_allocated_dec(mmu, cache[i].len);
|
|
||||||
VirtualFree(p, 0, MEM_RELEASE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cache[1][i].len = cache[0][i].len;
|
|
||||||
cache[1][i].page = cache[0][i].page;
|
|
||||||
cache[0][i].len = 0;
|
|
||||||
cache[0][i].page = NULL;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void os_protect_pages(void *p, size_t len, int writeable)
|
static void os_protect_pages(void *p, size_t len, int writeable)
|
||||||
{
|
{
|
||||||
DWORD old;
|
DWORD old;
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
(call-with-output-file fn
|
(call-with-output-file fn
|
||||||
(lambda (out)
|
(lambda (out)
|
||||||
(fprintf out "#define ~a ~a\n" (cadr m) (caddr m)))
|
(fprintf out "#define ~a ~a\n" (cadr m) (caddr m)))
|
||||||
'truncate/replace)
|
#:exists 'truncate/replace)
|
||||||
(set! cpp (string-append cpp (format " -include ~a" fn)))]
|
(set! cpp (string-append cpp (format " -include ~a" fn)))]
|
||||||
[else
|
[else
|
||||||
(set! cpp (string-append cpp " -D"
|
(set! cpp (string-append cpp " -D"
|
||||||
|
|
|
@ -96,9 +96,6 @@ EXPORTS
|
||||||
scheme_set_can_break
|
scheme_set_can_break
|
||||||
scheme_push_break_enable
|
scheme_push_break_enable
|
||||||
scheme_pop_break_enable
|
scheme_pop_break_enable
|
||||||
scheme_with_stack_freeze
|
|
||||||
scheme_frozen_run_some
|
|
||||||
scheme_is_in_frozen_stack
|
|
||||||
scheme_abort_continuation_no_dws
|
scheme_abort_continuation_no_dws
|
||||||
scheme_call_with_composable_no_dws
|
scheme_call_with_composable_no_dws
|
||||||
scheme_set_on_atomic_timeout
|
scheme_set_on_atomic_timeout
|
||||||
|
|
|
@ -96,9 +96,6 @@ EXPORTS
|
||||||
scheme_set_can_break
|
scheme_set_can_break
|
||||||
scheme_push_break_enable
|
scheme_push_break_enable
|
||||||
scheme_pop_break_enable
|
scheme_pop_break_enable
|
||||||
scheme_with_stack_freeze
|
|
||||||
scheme_frozen_run_some
|
|
||||||
scheme_is_in_frozen_stack
|
|
||||||
scheme_abort_continuation_no_dws
|
scheme_abort_continuation_no_dws
|
||||||
scheme_call_with_composable_no_dws
|
scheme_call_with_composable_no_dws
|
||||||
scheme_set_on_atomic_timeout
|
scheme_set_on_atomic_timeout
|
||||||
|
|
|
@ -93,9 +93,6 @@ scheme_pop_kill_action
|
||||||
scheme_set_can_break
|
scheme_set_can_break
|
||||||
scheme_push_break_enable
|
scheme_push_break_enable
|
||||||
scheme_pop_break_enable
|
scheme_pop_break_enable
|
||||||
scheme_with_stack_freeze
|
|
||||||
scheme_frozen_run_some
|
|
||||||
scheme_is_in_frozen_stack
|
|
||||||
scheme_abort_continuation_no_dws
|
scheme_abort_continuation_no_dws
|
||||||
scheme_call_with_composable_no_dws
|
scheme_call_with_composable_no_dws
|
||||||
scheme_set_on_atomic_timeout
|
scheme_set_on_atomic_timeout
|
||||||
|
|
|
@ -93,9 +93,6 @@ scheme_pop_kill_action
|
||||||
scheme_set_can_break
|
scheme_set_can_break
|
||||||
scheme_push_break_enable
|
scheme_push_break_enable
|
||||||
scheme_pop_break_enable
|
scheme_pop_break_enable
|
||||||
scheme_with_stack_freeze
|
|
||||||
scheme_frozen_run_some
|
|
||||||
scheme_is_in_frozen_stack
|
|
||||||
scheme_abort_continuation_no_dws
|
scheme_abort_continuation_no_dws
|
||||||
scheme_call_with_composable_no_dws
|
scheme_call_with_composable_no_dws
|
||||||
scheme_set_on_atomic_timeout
|
scheme_set_on_atomic_timeout
|
||||||
|
|
|
@ -2128,8 +2128,8 @@ extern Scheme_Extension_Table *scheme_extension_table;
|
||||||
# define MZ_FD_CLR(n, p) scheme_fdclr(p, n)
|
# define MZ_FD_CLR(n, p) scheme_fdclr(p, n)
|
||||||
# define MZ_FD_ISSET(n, p) scheme_fdisset(p, n)
|
# define MZ_FD_ISSET(n, p) scheme_fdisset(p, n)
|
||||||
#else
|
#else
|
||||||
# define MZ_GET_FDSET(p, n) ((void *)(((fd_set *)p) + n))
|
# define MZ_GET_FDSET(p, n) ((void *)(((fd_set *)p) XFORM_OK_PLUS n))
|
||||||
# define MZ_FD_ZERO(p) FD_ZERO((fd_set *)(p))
|
# define MZ_FD_ZERO(p) XFORM_HIDE_EXPR(FD_ZERO((fd_set *)(p)))
|
||||||
# define MZ_FD_SET(n, p) FD_SET(n, (fd_set *)(p))
|
# define MZ_FD_SET(n, p) FD_SET(n, (fd_set *)(p))
|
||||||
# define MZ_FD_CLR(n, p) FD_CLR(n, (fd_set *)(p))
|
# define MZ_FD_CLR(n, p) FD_CLR(n, (fd_set *)(p))
|
||||||
# define MZ_FD_ISSET(n, p) FD_ISSET(n, (fd_set *)(p))
|
# define MZ_FD_ISSET(n, p) FD_ISSET(n, (fd_set *)(p))
|
||||||
|
|
|
@ -49,7 +49,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set up MZ_EXTERN for DLL build */
|
/* Set up MZ_EXTERN for DLL build */
|
||||||
#if (defined(__WIN32__) || defined(WIN32) || defined(_WIN32)) \
|
#if (defined(__WIN32__) || defined(WIN32) || defined(_WIN32) || defined(__CYGWIN32__)) \
|
||||||
&& !defined(LINK_EXTENSIONS_BY_TABLE) \
|
&& !defined(LINK_EXTENSIONS_BY_TABLE) \
|
||||||
&& !defined(SCHEME_EMBEDDED_NO_DLL)
|
&& !defined(SCHEME_EMBEDDED_NO_DLL)
|
||||||
# define MZ_DLLIMPORT __declspec(dllimport)
|
# define MZ_DLLIMPORT __declspec(dllimport)
|
||||||
|
@ -59,10 +59,16 @@ extern "C" {
|
||||||
# else
|
# else
|
||||||
# define MZ_DLLSPEC __declspec(dllimport)
|
# define MZ_DLLSPEC __declspec(dllimport)
|
||||||
# endif
|
# endif
|
||||||
|
# if (defined(__CYGWIN32__) && !defined(MZ_USES_SHARED_LIB)) || defined(MZ_PRECISE_GC)
|
||||||
|
# define MZGC_DLLIMPORT
|
||||||
|
# else
|
||||||
|
# define MZGC_DLLIMPORT MZ_DLLIMPORT
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
# define MZ_DLLSPEC
|
# define MZ_DLLSPEC
|
||||||
# define MZ_DLLIMPORT
|
# define MZ_DLLIMPORT
|
||||||
# define MZ_DLLEXPORT
|
# define MZ_DLLEXPORT
|
||||||
|
# define MZGC_DLLIMPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MZ_EXTERN extern MZ_DLLSPEC
|
#define MZ_EXTERN extern MZ_DLLSPEC
|
||||||
|
|
|
@ -31,7 +31,9 @@
|
||||||
(except for the garbage collector, which is in `gc', `sgc', or
|
(except for the garbage collector, which is in `gc', `sgc', or
|
||||||
`gc2', depending on which one you're using). */
|
`gc2', depending on which one you're using). */
|
||||||
|
|
||||||
#define __MINGW32_DELAY_LOAD__ 1
|
#ifdef __MINGW32__
|
||||||
|
# define __MINGW32_DELAY_LOAD__ 1
|
||||||
|
#endif
|
||||||
#include "scheme.h"
|
#include "scheme.h"
|
||||||
|
|
||||||
/*========================================================================*/
|
/*========================================================================*/
|
||||||
|
|
|
@ -589,9 +589,6 @@
|
||||||
|
|
||||||
# define DO_STACK_CHECK
|
# define DO_STACK_CHECK
|
||||||
# define WINDOWS_FIND_STACK_BOUNDS
|
# define WINDOWS_FIND_STACK_BOUNDS
|
||||||
/* Default stack size is 1MB, but we try to read
|
|
||||||
the actual size from the executable on startup: */
|
|
||||||
# define WINDOWS_DEFAULT_STACK_SIZE 1048576
|
|
||||||
|
|
||||||
# if !defined(_WIN64) || (_MSC_VER >= 1600)
|
# if !defined(_WIN64) || (_MSC_VER >= 1600)
|
||||||
# define USE_MZ_SETJMP
|
# define USE_MZ_SETJMP
|
||||||
|
@ -731,10 +728,6 @@
|
||||||
|
|
||||||
# define REGISTER_POOR_MACHINE
|
# define REGISTER_POOR_MACHINE
|
||||||
|
|
||||||
# ifndef AS_MSVC_EXTENSION
|
|
||||||
# define LINK_EXTENSIONS_BY_TABLE
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# define MZ_USE_JIT_I386
|
# define MZ_USE_JIT_I386
|
||||||
|
|
||||||
# define FLAGS_ALREADY_SET
|
# define FLAGS_ALREADY_SET
|
||||||
|
|
|
@ -7,6 +7,10 @@ prefix = @prefix@
|
||||||
exec_prefix = @exec_prefix@
|
exec_prefix = @exec_prefix@
|
||||||
libdir = @libdir@
|
libdir = @libdir@
|
||||||
|
|
||||||
|
# for version.mak:
|
||||||
|
mainsrcdir = @srcdir@/../..
|
||||||
|
@INCLUDEDEP@ @srcdir@/../version.mak
|
||||||
|
|
||||||
CC = @CC@
|
CC = @CC@
|
||||||
CXX = @CXX@
|
CXX = @CXX@
|
||||||
RANLIB = @RANLIB@
|
RANLIB = @RANLIB@
|
||||||
|
@ -32,7 +36,7 @@ test: $(OBJS) test.@LTO@
|
||||||
gcobjects: $(OBJS)
|
gcobjects: $(OBJS)
|
||||||
|
|
||||||
sgc.@LTO@: $(srcdir)/sgc.c $(srcdir)/autostat.inc $(srcdir)/collect.inc $(srcdir)/../utils/splay.c
|
sgc.@LTO@: $(srcdir)/sgc.c $(srcdir)/autostat.inc $(srcdir)/collect.inc $(srcdir)/../utils/splay.c
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) @OPTIONS@ -I.. -c $(srcdir)/sgc.c -o sgc.@LTO@
|
$(CC) $(CFLAGS) $(CPPFLAGS) @OPTIONS@ -DSGC_EXPORTS -I.. -c $(srcdir)/sgc.c -o sgc.@LTO@
|
||||||
|
|
||||||
test.@LTO@: $(srcdir)/test.c
|
test.@LTO@: $(srcdir)/test.c
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) @OPTIONS@ -c $(srcdir)/test.c -o test.@LTO@
|
$(CC) $(CFLAGS) $(CPPFLAGS) @OPTIONS@ -c $(srcdir)/test.c -o test.@LTO@
|
||||||
|
|
|
@ -7,8 +7,8 @@ extern "C" {
|
||||||
|
|
||||||
#define GC_PTR void*
|
#define GC_PTR void*
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) || defined(__CYGWIN32__)
|
||||||
# ifdef SGC_EXPORTS
|
# if defined(SGC_EXPORTS) || (defined(__CYGWIN32__) && !defined(MZ_USES_SHARED_LIB))
|
||||||
# define SGC_EXTERN __declspec(dllexport)
|
# define SGC_EXTERN __declspec(dllexport)
|
||||||
# else
|
# else
|
||||||
# define SGC_EXTERN __declspec(dllimport)
|
# define SGC_EXTERN __declspec(dllimport)
|
||||||
|
|
|
@ -543,6 +543,7 @@ static uintptr_t adjust_stack_base(uintptr_t bnd) {
|
||||||
#ifdef WINDOWS_FIND_STACK_BOUNDS
|
#ifdef WINDOWS_FIND_STACK_BOUNDS
|
||||||
intptr_t find_exe_stack_size()
|
intptr_t find_exe_stack_size()
|
||||||
{
|
{
|
||||||
|
# define WINDOWS_DEFAULT_STACK_SIZE 1048576
|
||||||
intptr_t sz = WINDOWS_DEFAULT_STACK_SIZE;
|
intptr_t sz = WINDOWS_DEFAULT_STACK_SIZE;
|
||||||
wchar_t *fn;
|
wchar_t *fn;
|
||||||
DWORD len = 1024;
|
DWORD len = 1024;
|
||||||
|
@ -580,7 +581,6 @@ intptr_t find_exe_stack_size()
|
||||||
/* Skip to PE32[+] header's stack reservation value: */
|
/* Skip to PE32[+] header's stack reservation value: */
|
||||||
if (SetFilePointer(fd, pos + 20 + 4 + 72, NULL, FILE_BEGIN)
|
if (SetFilePointer(fd, pos + 20 + 4 + 72, NULL, FILE_BEGIN)
|
||||||
!= INVALID_SET_FILE_POINTER) {
|
!= INVALID_SET_FILE_POINTER) {
|
||||||
mzlonglong lsz;
|
|
||||||
if (kind == 0x10b) {
|
if (kind == 0x10b) {
|
||||||
/* PE32: 32-bit stack size: */
|
/* PE32: 32-bit stack size: */
|
||||||
int ssz;
|
int ssz;
|
||||||
|
|
|
@ -3494,13 +3494,13 @@ extern void *GC_base(void *d);
|
||||||
# define GC_did_mark_stack_overflow() 0
|
# define GC_did_mark_stack_overflow() 0
|
||||||
# define GC_mark_overflow_recover(ptr) /**/
|
# define GC_mark_overflow_recover(ptr) /**/
|
||||||
#else
|
#else
|
||||||
extern MZ_DLLIMPORT void *GC_base(void *);
|
extern MZGC_DLLIMPORT void *GC_base(void *);
|
||||||
extern MZ_DLLIMPORT int GC_is_marked(void *);
|
extern MZGC_DLLIMPORT int GC_is_marked(void *);
|
||||||
extern MZ_DLLIMPORT int GC_did_mark_stack_overflow(void);
|
extern MZGC_DLLIMPORT int GC_did_mark_stack_overflow(void);
|
||||||
extern MZ_DLLIMPORT void GC_mark_overflow_recover(void *p);
|
extern MZGC_DLLIMPORT void GC_mark_overflow_recover(void *p);
|
||||||
#endif
|
#endif
|
||||||
extern MZ_DLLIMPORT void GC_push_all_stack(void *, void *);
|
extern MZGC_DLLIMPORT void GC_push_all_stack(void *, void *);
|
||||||
extern MZ_DLLIMPORT void GC_flush_mark_stack(void);
|
extern MZGC_DLLIMPORT void GC_flush_mark_stack(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3674,7 +3674,7 @@ void scheme_clear_ephemerons()
|
||||||
done_ephemerons = NULL;
|
done_ephemerons = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern MZ_DLLIMPORT void (*GC_custom_finalize)();
|
extern MZGC_DLLIMPORT void (*GC_custom_finalize)();
|
||||||
|
|
||||||
void scheme_init_ephemerons(void)
|
void scheme_init_ephemerons(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1212,7 +1212,7 @@ void scheme_fdzero(void *fd)
|
||||||
scheme_init_fdset_array(fd, 1);
|
scheme_init_fdset_array(fd, 1);
|
||||||
# else
|
# else
|
||||||
# if defined(FILES_HAVE_FDS) || defined(USE_TCP)
|
# if defined(FILES_HAVE_FDS) || defined(USE_TCP)
|
||||||
FD_ZERO((fd_set *)fd);
|
XFORM_HIDE_EXPR(FD_ZERO((fd_set *)fd));
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,8 +91,8 @@ void **GC_variable_stack;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MZ_PRECISE_GC
|
#ifndef MZ_PRECISE_GC
|
||||||
extern MZ_DLLIMPORT void GC_register_late_disappearing_link(void **link, void *obj);
|
extern MZGC_DLLIMPORT void GC_register_late_disappearing_link(void **link, void *obj);
|
||||||
extern MZ_DLLIMPORT void GC_register_indirect_disappearing_link(void **link, void *obj);
|
extern MZGC_DLLIMPORT void GC_register_indirect_disappearing_link(void **link, void *obj);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SHARED_OK static int use_registered_statics;
|
SHARED_OK static int use_registered_statics;
|
||||||
|
@ -102,7 +102,7 @@ SHARED_OK static int use_registered_statics;
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
#if !defined(MZ_PRECISE_GC) && !defined(USE_SENORA_GC)
|
#if !defined(MZ_PRECISE_GC) && !defined(USE_SENORA_GC)
|
||||||
extern MZ_DLLIMPORT void GC_init();
|
extern MZGC_DLLIMPORT void GC_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void scheme_set_stack_base(void *base, int no_auto_statics) XFORM_SKIP_PROC
|
void scheme_set_stack_base(void *base, int no_auto_statics) XFORM_SKIP_PROC
|
||||||
|
@ -1688,7 +1688,7 @@ void scheme_unused_intptr(intptr_t i) { }
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
# endif
|
# endif
|
||||||
extern MZ_DLLIMPORT void GC_dump(void);
|
extern MZGC_DLLIMPORT void GC_dump(void);
|
||||||
# ifdef __cplusplus
|
# ifdef __cplusplus
|
||||||
};
|
};
|
||||||
# endif
|
# endif
|
||||||
|
|
|
@ -201,12 +201,8 @@ MZ_EXTERN void scheme_set_can_break(int on);
|
||||||
MZ_EXTERN void scheme_push_break_enable(Scheme_Cont_Frame_Data *cframe, int on, int pre_check);
|
MZ_EXTERN void scheme_push_break_enable(Scheme_Cont_Frame_Data *cframe, int on, int pre_check);
|
||||||
MZ_EXTERN void scheme_pop_break_enable(Scheme_Cont_Frame_Data *cframe, int post_check);
|
MZ_EXTERN void scheme_pop_break_enable(Scheme_Cont_Frame_Data *cframe, int post_check);
|
||||||
|
|
||||||
MZ_EXTERN int scheme_with_stack_freeze(Scheme_Frozen_Stack_Proc wha_f, void *wha_data);
|
MZ_EXTERN Scheme_Object *scheme_abort_continuation_no_dws(Scheme_Object *pt, Scheme_Object *v);
|
||||||
MZ_EXTERN int scheme_frozen_run_some(Scheme_Frozen_Stack_Proc do_f, void *do_data, int run_msecs);
|
MZ_EXTERN Scheme_Object *scheme_call_with_composable_no_dws(Scheme_Object *proc, Scheme_Object *pt);
|
||||||
MZ_EXTERN int scheme_is_in_frozen_stack();
|
|
||||||
|
|
||||||
MZ_EXTERN Scheme_Object *scheme_abort_continuation_no_dws (Scheme_Object *pt, Scheme_Object *v);
|
|
||||||
MZ_EXTERN Scheme_Object *scheme_call_with_composable_no_dws (Scheme_Object *proc, Scheme_Object *pt);
|
|
||||||
|
|
||||||
MZ_EXTERN Scheme_On_Atomic_Timeout_Proc scheme_set_on_atomic_timeout(Scheme_On_Atomic_Timeout_Proc p);
|
MZ_EXTERN Scheme_On_Atomic_Timeout_Proc scheme_set_on_atomic_timeout(Scheme_On_Atomic_Timeout_Proc p);
|
||||||
|
|
||||||
|
@ -1229,5 +1225,5 @@ MZ_EXTERN void *scheme_register_process_global(const char *key, void *val);
|
||||||
MZ_EXTERN Scheme_Object *scheme_malloc_key(void);
|
MZ_EXTERN Scheme_Object *scheme_malloc_key(void);
|
||||||
MZ_EXTERN void scheme_free_key(Scheme_Object *k);
|
MZ_EXTERN void scheme_free_key(Scheme_Object *k);
|
||||||
|
|
||||||
MZ_EXTERN void* scheme_jit_find_code_end(void *p);
|
MZ_EXTERN void *scheme_jit_find_code_end(void *p);
|
||||||
MZ_EXTERN void scheme_jit_now(Scheme_Object *f);
|
MZ_EXTERN void scheme_jit_now(Scheme_Object *f);
|
||||||
|
|
|
@ -145,11 +145,8 @@ void (*scheme_pop_kill_action)();
|
||||||
void (*scheme_set_can_break)(int on);
|
void (*scheme_set_can_break)(int on);
|
||||||
void (*scheme_push_break_enable)(Scheme_Cont_Frame_Data *cframe, int on, int pre_check);
|
void (*scheme_push_break_enable)(Scheme_Cont_Frame_Data *cframe, int on, int pre_check);
|
||||||
void (*scheme_pop_break_enable)(Scheme_Cont_Frame_Data *cframe, int post_check);
|
void (*scheme_pop_break_enable)(Scheme_Cont_Frame_Data *cframe, int post_check);
|
||||||
int (*scheme_with_stack_freeze)(Scheme_Frozen_Stack_Proc wha_f, void *wha_data);
|
Scheme_Object *(*scheme_abort_continuation_no_dws)(Scheme_Object *pt, Scheme_Object *v);
|
||||||
int (*scheme_frozen_run_some)(Scheme_Frozen_Stack_Proc do_f, void *do_data, int run_msecs);
|
Scheme_Object *(*scheme_call_with_composable_no_dws)(Scheme_Object *proc, Scheme_Object *pt);
|
||||||
int (*scheme_is_in_frozen_stack)();
|
|
||||||
Scheme_Object *scheme_abort_continuation_no_dws;
|
|
||||||
Scheme_Object *scheme_call_with_composable_no_dws;
|
|
||||||
Scheme_On_Atomic_Timeout_Proc (*scheme_set_on_atomic_timeout)(Scheme_On_Atomic_Timeout_Proc p);
|
Scheme_On_Atomic_Timeout_Proc (*scheme_set_on_atomic_timeout)(Scheme_On_Atomic_Timeout_Proc p);
|
||||||
/*========================================================================*/
|
/*========================================================================*/
|
||||||
/* error handling */
|
/* error handling */
|
||||||
|
@ -1001,7 +998,7 @@ Scheme_Hash_Table *(*scheme_get_place_table)(void);
|
||||||
void *(*scheme_register_process_global)(const char *key, void *val);
|
void *(*scheme_register_process_global)(const char *key, void *val);
|
||||||
Scheme_Object *(*scheme_malloc_key)(void);
|
Scheme_Object *(*scheme_malloc_key)(void);
|
||||||
void (*scheme_free_key)(Scheme_Object *k);
|
void (*scheme_free_key)(Scheme_Object *k);
|
||||||
(*scheme_jit_find_code_end)(void *p);
|
void *(*scheme_jit_find_code_end)(void *p);
|
||||||
void (*scheme_jit_now)(Scheme_Object *f);
|
void (*scheme_jit_now)(Scheme_Object *f);
|
||||||
#ifndef SCHEME_EX_INLINE
|
#ifndef SCHEME_EX_INLINE
|
||||||
} Scheme_Extension_Table;
|
} Scheme_Extension_Table;
|
||||||
|
|
|
@ -102,9 +102,6 @@
|
||||||
scheme_extension_table->scheme_set_can_break = scheme_set_can_break;
|
scheme_extension_table->scheme_set_can_break = scheme_set_can_break;
|
||||||
scheme_extension_table->scheme_push_break_enable = scheme_push_break_enable;
|
scheme_extension_table->scheme_push_break_enable = scheme_push_break_enable;
|
||||||
scheme_extension_table->scheme_pop_break_enable = scheme_pop_break_enable;
|
scheme_extension_table->scheme_pop_break_enable = scheme_pop_break_enable;
|
||||||
scheme_extension_table->scheme_with_stack_freeze = scheme_with_stack_freeze;
|
|
||||||
scheme_extension_table->scheme_frozen_run_some = scheme_frozen_run_some;
|
|
||||||
scheme_extension_table->scheme_is_in_frozen_stack = scheme_is_in_frozen_stack;
|
|
||||||
scheme_extension_table->scheme_abort_continuation_no_dws = scheme_abort_continuation_no_dws;
|
scheme_extension_table->scheme_abort_continuation_no_dws = scheme_abort_continuation_no_dws;
|
||||||
scheme_extension_table->scheme_call_with_composable_no_dws = scheme_call_with_composable_no_dws;
|
scheme_extension_table->scheme_call_with_composable_no_dws = scheme_call_with_composable_no_dws;
|
||||||
scheme_extension_table->scheme_set_on_atomic_timeout = scheme_set_on_atomic_timeout;
|
scheme_extension_table->scheme_set_on_atomic_timeout = scheme_set_on_atomic_timeout;
|
||||||
|
|
|
@ -102,9 +102,6 @@
|
||||||
#define scheme_set_can_break (scheme_extension_table->scheme_set_can_break)
|
#define scheme_set_can_break (scheme_extension_table->scheme_set_can_break)
|
||||||
#define scheme_push_break_enable (scheme_extension_table->scheme_push_break_enable)
|
#define scheme_push_break_enable (scheme_extension_table->scheme_push_break_enable)
|
||||||
#define scheme_pop_break_enable (scheme_extension_table->scheme_pop_break_enable)
|
#define scheme_pop_break_enable (scheme_extension_table->scheme_pop_break_enable)
|
||||||
#define scheme_with_stack_freeze (scheme_extension_table->scheme_with_stack_freeze)
|
|
||||||
#define scheme_frozen_run_some (scheme_extension_table->scheme_frozen_run_some)
|
|
||||||
#define scheme_is_in_frozen_stack (scheme_extension_table->scheme_is_in_frozen_stack)
|
|
||||||
#define scheme_abort_continuation_no_dws (scheme_extension_table->scheme_abort_continuation_no_dws)
|
#define scheme_abort_continuation_no_dws (scheme_extension_table->scheme_abort_continuation_no_dws)
|
||||||
#define scheme_call_with_composable_no_dws (scheme_extension_table->scheme_call_with_composable_no_dws)
|
#define scheme_call_with_composable_no_dws (scheme_extension_table->scheme_call_with_composable_no_dws)
|
||||||
#define scheme_set_on_atomic_timeout (scheme_extension_table->scheme_set_on_atomic_timeout)
|
#define scheme_set_on_atomic_timeout (scheme_extension_table->scheme_set_on_atomic_timeout)
|
||||||
|
|
|
@ -47,10 +47,10 @@ HOOK_SHARED_OK void (*scheme_set_external_stack_val)(void *);
|
||||||
stack copy to account for pointers to the interior of collectable
|
stack copy to account for pointers to the interior of collectable
|
||||||
objects. */
|
objects. */
|
||||||
|
|
||||||
extern MZ_DLLIMPORT void GC_push_all_stack(void *, void *);
|
extern MZGC_DLLIMPORT void GC_push_all_stack(void *, void *);
|
||||||
extern MZ_DLLIMPORT void GC_flush_mark_stack(void);
|
extern MZGC_DLLIMPORT void GC_flush_mark_stack(void);
|
||||||
extern MZ_DLLIMPORT void (*GC_push_last_roots)(void);
|
extern MZGC_DLLIMPORT void (*GC_push_last_roots)(void);
|
||||||
extern MZ_DLLIMPORT void (*GC_push_last_roots_again)(void);
|
extern MZGC_DLLIMPORT void (*GC_push_last_roots_again)(void);
|
||||||
/* GC_push_last_roots_again is called after marking eager
|
/* GC_push_last_roots_again is called after marking eager
|
||||||
finalizations (once at each stage). We rely on the fact that no
|
finalizations (once at each stage). We rely on the fact that no
|
||||||
copied stack will be referenced by (or affected the ordering of)
|
copied stack will be referenced by (or affected the ordering of)
|
||||||
|
@ -60,8 +60,8 @@ extern MZ_DLLIMPORT void (*GC_push_last_roots_again)(void);
|
||||||
# define GC_is_marked(p) GC_base(p)
|
# define GC_is_marked(p) GC_base(p)
|
||||||
# define GC_did_mark_stack_overflow() 0
|
# define GC_did_mark_stack_overflow() 0
|
||||||
#else
|
#else
|
||||||
extern MZ_DLLIMPORT int GC_is_marked(void *);
|
extern MZGC_DLLIMPORT int GC_is_marked(void *);
|
||||||
extern MZ_DLLIMPORT int GC_did_mark_stack_overflow(void);
|
extern MZGC_DLLIMPORT int GC_did_mark_stack_overflow(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define get_copy(s_c) (((CopiedStack *)s_c)->_stack_copy)
|
#define get_copy(s_c) (((CopiedStack *)s_c)->_stack_copy)
|
||||||
|
@ -673,12 +673,13 @@ void scheme_reset_jmpup_buf(Scheme_Jumpup_Buf *b)
|
||||||
is fragile, because it's not well defined whether the compiler
|
is fragile, because it's not well defined whether the compiler
|
||||||
will generate frame-pointer setup; use mzsj86g.S, instead. */
|
will generate frame-pointer setup; use mzsj86g.S, instead. */
|
||||||
|
|
||||||
#ifdef __MINGW32__
|
#if (__OPTIMIZE__ > 0) || defined(MZ_XFORM)
|
||||||
# if __OPTIMIZE__ > 0
|
# define NEED_STACK_FRAME_SETUP
|
||||||
# define NEED_STACK_FRAME_SETUP
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
MZ_DO_NOT_INLINE(int scheme_mz_setjmp(mz_pre_jmp_buf b));
|
||||||
|
MZ_DO_NOT_INLINE(void scheme_mz_longjmp(mz_pre_jmp_buf b, int v));
|
||||||
|
|
||||||
int scheme_mz_setjmp(mz_pre_jmp_buf b)
|
int scheme_mz_setjmp(mz_pre_jmp_buf b)
|
||||||
{
|
{
|
||||||
#ifdef NEED_STACK_FRAME_SETUP
|
#ifdef NEED_STACK_FRAME_SETUP
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MZ_PRECISE_GC
|
#ifndef MZ_PRECISE_GC
|
||||||
extern MZ_DLLIMPORT void (*GC_custom_finalize)(void);
|
extern MZGC_DLLIMPORT void (*GC_custom_finalize)(void);
|
||||||
#endif
|
#endif
|
||||||
#ifndef USE_SENORA_GC
|
#ifndef USE_SENORA_GC
|
||||||
extern int GC_is_marked(void *);
|
extern int GC_is_marked(void *);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user