[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: w32 port, patch 2: Boehm's GC
From: |
Lars J. Aas |
Subject: |
Re: w32 port, patch 2: Boehm's GC |
Date: |
Sat, 18 Nov 2000 18:12:12 +0100 |
User-agent: |
Mutt/1.2.5i |
The code in this patch is taken directly from the gc5.2 archive,
with only some structural modifications by me.
* gc_os_dep.c: add detection of page size on the w32 architecture.
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/18 17:03:23
@@ -1572,9 +1572,16 @@
{
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;
+ static word GC_page_size = 0;
+ if (!GC_page_size) {
+ SYSTEM_INFO sysinfo;
+ GetSystemInfo(&sysinfo);
+ GC_page_size = sysinfo.dwPageSize;
+ }
+ trunc_sp = (ptr_t)((word)sp & ~(GC_page_size - 1));
+ size = GC_get_writable_length(trunc_sp, 0);
return(trunc_sp + size);
}