[MLton-commit] r4419

Matthew Fluet MLton@mlton.org
Tue, 25 Apr 2006 13:25:44 -0700


Pointer casts
----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/runtime/TODO
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/util/pointer.h

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

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/TODO
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/TODO	2006-04-25 20:10:36 UTC (rev 4418)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/TODO	2006-04-25 20:25:43 UTC (rev 4419)
@@ -4,7 +4,7 @@
 
 * Use C99 <assert.h> instead of util/assert.{c,h}
 
-Fix PackWord{16,32,64}_{sub,upadate}{,Rev} to use byte offset; This
+Fix PackWord{16,32,64}_{sub,update}{,Rev} to use byte offset; This
 requires fixing the semantics of the primitives as well.
 
 Rename primitives to indicate that these are not bit-wise identities
@@ -18,5 +18,3 @@
 basis/Int/Word.c
 basis/MLton/allocTooLarge.c
 basis/MLton/bug.c
-basis/Real/PackReal.c
-basis/Int/PackWord.c

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.c	2006-04-25 20:10:36 UTC (rev 4418)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.c	2006-04-25 20:25:43 UTC (rev 4419)
@@ -44,7 +44,7 @@
 size_t cardMapIndexToSize (GC_cardMapIndex i) {
   return (size_t)i << CARD_SIZE_LOG2;
 }
-pointer pointerToCardMapAddr (GC_state s, pointer p) {
+GC_cardMapElem *pointerToCardMapAddr (GC_state s, pointer p) {
   pointer res;
   
   res = &s->generationalMaps.cardMapAbsolute[pointerToCardMapIndexAbsolute (p)];

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.h	2006-04-25 20:10:36 UTC (rev 4418)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.h	2006-04-25 20:25:43 UTC (rev 4419)
@@ -59,7 +59,7 @@
 static inline GC_cardMapIndex pointerToCardMapIndexAbsolute (pointer p);
 static inline GC_cardMapIndex sizeToCardMapIndex (size_t z);
 static inline size_t cardMapIndexToSize (GC_cardMapIndex i);
-static inline pointer pointerToCardMapAddr (GC_state s, pointer p);
+static inline GC_cardMapElem *pointerToCardMapAddr (GC_state s, pointer p);
 
 static inline bool isCardMarked (GC_state s, pointer p);
 static inline void markCard (GC_state s, pointer p);

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c	2006-04-25 20:10:36 UTC (rev 4418)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c	2006-04-25 20:25:43 UTC (rev 4419)
@@ -63,7 +63,9 @@
 
 static char* mlTypesHStd[] = {
   "/* ML types */",
-  "typedef unsigned char* /* uintptr_t */ Pointer;",
+  "typedef unsigned char* Pointer;",
+  // "typedef void* Pointer;",
+  // "typedef uintptr_t Pointer;",
   "#define Array(t) Pointer",
   "#define Ref(t) Pointer",
   "#define Vector(t) const Pointer",

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/util/pointer.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/util/pointer.h	2006-04-25 20:10:36 UTC (rev 4418)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/util/pointer.h	2006-04-25 20:25:43 UTC (rev 4419)
@@ -7,5 +7,6 @@
  */
 
 typedef unsigned char* pointer;
+// typedef void* pointer;
 #define POINTER_SIZE sizeof(pointer)
 #define FMTPTR "0x%016"PRIxPTR