[MLton-commit] r4861
Vesa Karvonen
vesak at mlton.org
Mon Nov 27 01:36:18 PST 2006
Changed to import malloc and free statically rather than dynamically
(through dl* functions). The reason for this change is that dynamic
import of malloc and free is problematic on at least the MinGW platform
and there seems to be no reason to prefer dynamic import.
----------------------------------------------------------------------
U mlton/trunk/lib/mlnlffi/memory/memalloc-a4-unix.sml
----------------------------------------------------------------------
Modified: mlton/trunk/lib/mlnlffi/memory/memalloc-a4-unix.sml
===================================================================
--- mlton/trunk/lib/mlnlffi/memory/memalloc-a4-unix.sml 2006-11-22 16:50:00 UTC (rev 4860)
+++ mlton/trunk/lib/mlnlffi/memory/memalloc-a4-unix.sml 2006-11-27 09:36:16 UTC (rev 4861)
@@ -21,6 +21,7 @@
type addr = Ptr.t
type addr' = addr
+(*
structure DL = DynLinkage
fun main's s = DL.lib_symbol (DL.main_lib, s)
@@ -37,8 +38,8 @@
let val p_u = _import * : MLton.Pointer.t -> addr -> unit;
in p_u (DL.addr free_h) a
end
+*)
-(*
fun sys_malloc (n : Word32.word) =
let val w_p = _import "malloc" : Word32.word -> addr;
val a = w_p n
@@ -49,7 +50,6 @@
let val p_u = _import "free" : addr -> unit;
in p_u a
end
-*)
fun alloc bytes = sys_malloc bytes
fun free a = sys_free a
More information about the MLton-commit
mailing list