[MLton-commit] r4497

Stephen Weeks MLton@mlton.org
Mon, 8 May 2006 19:40:32 -0700


Added __attribute__ ((unused)).  Caught up with name changes to
functions.  No testing yet.


----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/platform/hpux.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c

----------------------------------------------------------------------

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c	2006-05-09 02:11:41 UTC (rev 4496)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/darwin.c	2006-05-09 02:40:31 UTC (rev 4497)
@@ -8,15 +8,6 @@
 #include "mmap-protect.c"
 #include "use-mmap.c"
 
-static void catcher (int sig, siginfo_t *sip, ucontext_t *ucp) {
-        GC_handleSigProf ((pointer) ucp->uc_mcontext->ss.srr0);
-}
-
-void setSigProfHandler (struct sigaction *sa) {
-        sa->sa_flags = SA_ONSTACK | SA_RESTART | SA_SIGINFO;
-        sa->sa_sigaction = (void (*)(int, siginfo_t*, void*))catcher;
-}
-
 void *getTextEnd () {
         return (void*)(get_etext ());
 }
@@ -31,7 +22,7 @@
         return mh;
 }
 
-void showMem () {
+void GC_displayMem () {
         /* FIXME: this won't actually work. */
         static char buffer[256];
 
@@ -39,7 +30,18 @@
         (void)system (buffer);
 }
 
-W32 totalRam (GC_state s) {
+static void catcher (__attribute__ ((unused)) int sig,  
+                        __attribute__ ((unused)) siginfo_t *sip, 
+                        ucontext_t *ucp) {
+        GC_handleSigProf ((pointer) ucp->uc_mcontext->ss.srr0);
+}
+
+void GC_setSigProfHandler (struct sigaction *sa) {
+        sa->sa_flags = SA_ONSTACK | SA_RESTART | SA_SIGINFO;
+        sa->sa_sigaction = (void (*)(int, siginfo_t*, void*))catcher;
+}
+
+W32 GC_totalRam (GC_state s) {
         int mem;
         size_t len;
 

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.c	2006-05-09 02:11:41 UTC (rev 4496)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/freebsd.c	2006-05-09 02:40:31 UTC (rev 4497)
@@ -5,23 +5,25 @@
 #include "mmap-protect.c"
 #include "use-mmap.c"
 
-static void catcher (int sig, siginfo_t *sip, ucontext_t *ucp) {
+void GC_displayMem () {
+        static char buffer[256];
+
+        sprintf (buffer, "/bin/cat /proc/%d/map\n", (int)getpid ());
+        (void)system (buffer);
+}
+
+static void catcher (__attribute__ ((unused)) int sig,
+                        __attribute__ ((unused)) siginfo_t *sip, 
+                        ucontext_t *ucp) {
         GC_handleSigProf ((pointer) ucp->uc_mcontext.mc_eip);
 }
 
-void setSigProfHandler (struct sigaction *sa) {
+void GC_setSigProfHandler (struct sigaction *sa) {
         sa->sa_flags = SA_ONSTACK | SA_RESTART | SA_SIGINFO;
         sa->sa_sigaction = (void (*)(int, siginfo_t*, void*))catcher;
 }
 
-void showMem () {
-        static char buffer[256];
-
-        sprintf (buffer, "/bin/cat /proc/%d/map\n", (int)getpid ());
-        (void)system (buffer);
-}
-
-W32 totalRam (GC_state s) {
+W32 GC_totalRam (GC_state s) {
         int mem, len;
 
         len = sizeof (int);

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/hpux.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/hpux.c	2006-05-09 02:11:41 UTC (rev 4496)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/hpux.c	2006-05-09 02:40:31 UTC (rev 4497)
@@ -12,14 +12,16 @@
 #include "mkdir2.c"
 #include "setenv.putenv.c"
 
-W32 totalRam (GC_state s) {
-        struct pst_static buf;
+extern void *__text_start;
+extern void *etext;
 
-        if (pstat_getstatic (&buf, sizeof(buf), 1, 0) < 0)
-                diee ("failed to get physical memory size");
-        return buf.physical_memory * buf.page_size;
+void *getTextStart () {
+        return &__text_start;
 }
 
+void *getTextEnd () {
+        return &etext;
+}
 
 struct pstnames {
         int type;
@@ -65,7 +67,7 @@
         return fname;
 }
 
-void showMem () {
+void GC_displayMem () {
         int i;
         struct pst_vm_status buf;
         size_t page_size = sysconf(_SC_PAGE_SIZE);
@@ -88,22 +90,22 @@
 }
 
 
-static void catcher (int sig, siginfo_t* sip, void* mystery) {
+static void catcher (__attribute__ ((unused)) int sig,
+                        __attribute__ ((unused)) siginfo_t* sip,
+                        void* mystery) {
         ucontext_t* ucp = (ucontext_t*)mystery;
         GC_handleSigProf ((pointer) (ucp->uc_link));
 }
 
-void setSigProfHandler (struct sigaction *sa) {
+void GC_setSigProfHandler (struct sigaction *sa) {
         sa->sa_flags = SA_ONSTACK | SA_RESTART | SA_SIGINFO;
         sa->sa_sigaction = (void (*)(int, siginfo_t*, void*))catcher;
 }
 
-extern void *__text_start;
-extern void *etext;
+W32 GC_totalRam (GC_state s) {
+        struct pst_static buf;
 
-void *getTextStart () {
-        return &__text_start;
+        if (pstat_getstatic (&buf, sizeof(buf), 1, 0) < 0)
+                diee ("failed to get physical memory size");
+        return buf.physical_memory * buf.page_size;
 }
-void *getTextEnd () {
-        return &etext;
-}

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c	2006-05-09 02:11:41 UTC (rev 4496)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/mingw.c	2006-05-09 02:40:31 UTC (rev 4497)
@@ -4,10 +4,26 @@
 
 #include "windows.c"
 
-void decommit (void *base, size_t length) {
+void GC_decommit (void *base, size_t length) {
         Windows_decommit (base, length);
 }
 
+void *GC_mmapAnon (void *start, size_t length) {
+        return Windows_mmapAnon (start, length);
+}
+
+void GC_release (void *base, size_t length) {
+        Windows_release (base);
+}
+
+Word32 GC_totalRam (GC_state s) {
+        MEMORYSTATUS memStat;
+
+        memStat.dwLength = sizeof(memStat);
+        GlobalMemoryStatus(&memStat);
+        return memStat.dwTotalPhys;
+}
+
 HANDLE fileDesHandle (int fd) {
         return (HANDLE)(_get_osfhandle (fd));
 }
@@ -32,22 +48,6 @@
         return _open (file_name, _O_CREAT | _O_RDWR, _S_IREAD | _S_IWRITE);
 }
 
-void *mmapAnon (void *start, size_t length) {
-        return Windows_mmapAnon (start, length);
-}
-
-void release (void *base, size_t length) {
-        Windows_release (base);
-}
-
-Word32 totalRam (GC_state s) {
-        MEMORYSTATUS memStat;
-
-        memStat.dwLength = sizeof(memStat);
-        GlobalMemoryStatus(&memStat);
-        return memStat.dwTotalPhys;
-}
-
 /* ------------------------------------------------- */
 /*                       Date                        */
 /* ------------------------------------------------- */

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c	2006-05-09 02:11:41 UTC (rev 4496)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/netbsd.c	2006-05-09 02:40:31 UTC (rev 4497)
@@ -7,11 +7,13 @@
 #include "totalRam.sysctl.c"
 #include "use-mmap.c"
 
-static void catcher (int sig, int code, struct sigcontext *ucp) {
+static void catcher (__attribute__ ((unused)) int sig,
+                        __attribute__ ((unused)) int code, 
+                        struct sigcontext *ucp) {
         GC_handleSigProf ((pointer) ucp->sc_eip);
 }
 
-void setSigProfHandler (struct sigaction *sa) {
+void GC_setSigProfHandler (struct sigaction *sa) {
         sa->sa_flags = SA_ONSTACK | SA_RESTART;
         sa->sa_handler = (void (*)(int))catcher;
 }

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c	2006-05-09 02:11:41 UTC (rev 4496)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/platform/openbsd.c	2006-05-09 02:40:31 UTC (rev 4497)
@@ -7,11 +7,13 @@
 #include "totalRam.sysctl.c"
 #include "use-mmap.c"
 
-static void catcher (int sig, siginfo_t *sip, ucontext_t *ucp) {
+static void catcher (__attribute__ ((unused)) int sig,
+                        __attribute__ ((unused)) siginfo_t *sip,
+                        ucontext_t *ucp) {
         GC_handleSigProf ((pointer) ucp->sc_eip);
 }
 
-void setSigProfHandler (struct sigaction *sa) {
+void GC_setSigProfHandler (struct sigaction *sa) {
         sa->sa_flags = SA_ONSTACK | SA_RESTART | SA_SIGINFO;
         sa->sa_sigaction = (void (*)(int, siginfo_t*, void*))catcher;
 }