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/memory/memory-a4s2i4l4f4d8.sml
ViewVC logotype

Diff of /sml/trunk/src/ml-nlffi-lib/memory/memory-a4s2i4l4f4d8.sml

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

revision 1014, Tue Jan 15 16:32:43 2002 UTC revision 1015, Tue Jan 15 21:46:00 2002 UTC
# Line 10  Line 10 
10   * author: Matthias Blume (blume@research.bell-labs.com)   * author: Matthias Blume (blume@research.bell-labs.com)
11   *)   *)
12  structure CMemory : CMEMORY = struct  structure CMemory : CMEMORY = struct
13        exception OutOfMemory
14    
15      type addr = Word32.word      type addr = Word32.word
16      val null = 0w0 : addr      val null = 0w0 : addr
17      fun isNull a = a = null      fun isNull a = a = null
# Line 71  Line 73 
73                        -> Word32.word                        -> Word32.word
74              val a = w_p (DL.addr malloc_h, n, [])              val a = w_p (DL.addr malloc_h, n, [])
75          in          in
76              if a = 0w0 then NONE else SOME a              if a = 0w0 then raise OutOfMemory else a
77          end          end
78          fun sys_free (a : Word32.word) = let          fun sys_free (a : Word32.word) = let
79              val p_u = RawMemInlineT.rawccall :              val p_u = RawMemInlineT.rawccall :
# Line 122  Line 124 
124      fun unwrap_ulong (x : cc_ulong) = x : MLRep.ULong.word      fun unwrap_ulong (x : cc_ulong) = x : MLRep.ULong.word
125      fun unwrap_float (x : cc_float) = x : MLRep.Float.real      fun unwrap_float (x : cc_float) = x : MLRep.Float.real
126      fun unwrap_double (x : cc_double) = x : MLRep.Double.real      fun unwrap_double (x : cc_double) = x : MLRep.Double.real
127    
128        fun p2i (x : addr) = x : MLRep.ULong.word
129        fun i2p (x : MLRep.ULong.word) = x : addr
130  end  end

Legend:
Removed from v.1014  
changed lines
  Added in v.1015

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