[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Boehm's GC (Was: libguile on Win32...)
From: |
Lars J. Aas |
Subject: |
Boehm's GC (Was: libguile on Win32...) |
Date: |
Thu, 16 Nov 2000 18:52:57 +0100 |
User-agent: |
Mutt/1.2.5i |
On Thu, Nov 16, 2000 at 05:04:30PM +0100, Lars J. Aas wrote:
: I've now managed to compile everything under libguile/ with Cygwin +
: Visual C++ (disabled a lot of things), except for the gc_os_dep.c file.
: In that file it fails on the undeclared identifier `GC_page_size'.
: Can anyone tell me how/where that variable is supposed to be defined?
I went to the source (Hans-J. Boehm's GC) and found a whole bunch of
references to GC_page_size in os_dep.c. I applied the following, which
hopefully works (it compiles at least). One step closer to a working
w32 build (not that you guys care :)...
Lars J
Index: libguile/gc_os_dep.c
===================================================================
RCS file: /cvs/guile/guile-core/libguile/gc_os_dep.c,v
retrieving revision 1.3
diff -u -r1.3 gc_os_dep.c
--- libguile/gc_os_dep.c 2000/10/18 18:27:55 1.3
+++ libguile/gc_os_dep.c 2000/11/16 17:47:29
@@ -1568,12 +1568,25 @@
return(buf.RegionSize);
}
+static word GC_page_size = 0;
+
+static void GC_setpagesize()
+{
+ SYSTEM_INFO sysinfo;
+
+ GetSystemInfo(&sysinfo);
+ GC_page_size = sysinfo.dwPageSize;
+}
+
void *scm_get_stack_base()
{
int dummy;
ptr_t sp = (ptr_t)(&dummy);
- ptr_t trunc_sp = (ptr_t)((word)sp & ~(GC_page_size - 1));
- word size = GC_get_writable_length(trunc_sp, 0);
+ ptr_t trunc_sp;
+ word size;
+ if (!GC_page_size) GC_set_page_size();
+ trunc_sp = (ptr_t)((word)sp & ~(GC_page_size - 1));
+ size = GC_get_writable_length(trunc_sp, 0);
return(trunc_sp + size);
}
- libguile on Win32..., Lars J. Aas, 2000/11/16
- Boehm's GC (Was: libguile on Win32...),
Lars J. Aas <=