Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/ml-nlffi-lib/internals/c-int.sml
ViewVC logotype

Diff of /sml/trunk/src/ml-nlffi-lib/internals/c-int.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1077, Tue Feb 19 15:48:50 2002 UTC revision 1078, Tue Feb 19 21:26:48 2002 UTC
# Line 66  Line 66 
66      type ro = unit      type ro = unit
67      type rw = unit      type rw = unit
68    
69      type ('t, 'c) ptr = addr * objt     (* RTTI for target value *)      type 'o ptr = addr * objt           (* RTTI for target value *)
70      type ('t, 'c) ptr' = addr      type 'o ptr' = addr
71    
72      type ('t, 'n) arr = unit      type ('t, 'n) arr = unit
73    
74      type 'f fptr = addr * 'f      type 'f fptr = addr * 'f
75      type 'f fptr' = addr                (* does not carry function around *)      type 'f fptr' = addr                (* does not carry function around *)
76    
77      type voidptr = addr      type void = unit
78        type voidptr = void ptr'
79    
80      type 'tag su = unit      type 'tag su = unit
81    
82      type schar = MLRep.Signed.int      type schar = MLRep.Signed.int
# Line 242  Line 244 
244    
245      structure Heavy = struct      structure Heavy = struct
246          val obj = pair_type_addr          val obj = pair_type_addr
247          val ptr = pair_type_addr          fun ptr (PTR t) p = (p, t)
248              | ptr _ _ = bug "Heavy.ptr (non-object-pointer-type)"
249          fun fptr (FPTR mkf) p = (p, Unsafe.cast mkf p)          fun fptr (FPTR mkf) p = (p, Unsafe.cast mkf p)
250            | fptr _ _ = bug "Heavy.fptr (non-function-pointer-type)"            | fptr _ _ = bug "Heavy.fptr (non-function-pointer-type)"
251      end      end
# Line 472  Line 474 
474    
475      structure U = struct      structure U = struct
476          fun fcast (f : 'a fptr') : 'b fptr' = f          fun fcast (f : 'a fptr') : 'b fptr' = f
477          fun p2i (a : voidptr) : ulong = CMemory.p2i a          fun p2i (a : 'o ptr') : ulong = CMemory.p2i a
478          fun i2p (a : ulong) : voidptr = CMemory.i2p a          fun i2p (a : ulong) : 'o ptr' = CMemory.i2p a
479      end      end
480    
481      (* ------------- internal stuff ------------- *)      (* ------------- internal stuff ------------- *)

Legend:
Removed from v.1077  
changed lines
  Added in v.1078

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0