瀏覽代碼

+ initialize heap in the system unit startup (but SysOSAlloc is not yet implemented)

git-svn-id: branches/wasm@48289 -
nickysn 4 年之前
父節點
當前提交
fe7fd69d5e
共有 2 個文件被更改,包括 5 次插入0 次删除
  1. 3 0
      rtl/wasi/sysheap.inc
  2. 2 0
      rtl/wasi/system.pp

+ 3 - 0
rtl/wasi/sysheap.inc

@@ -22,8 +22,11 @@
 
 
 function SysOSAlloc(size: ptruint): pointer;
 function SysOSAlloc(size: ptruint): pointer;
 begin
 begin
+  DebugWriteLn('SysOSAlloc');
+  SysOSAlloc:=nil;
 end;
 end;
 
 
 procedure SysOSFree(p: pointer; size: ptruint);
 procedure SysOSFree(p: pointer; size: ptruint);
 begin
 begin
+  DebugWriteLn('SysOSFree');
 end;
 end;

+ 2 - 0
rtl/wasi/system.pp

@@ -171,5 +171,7 @@ begin
   { To be set if this is a library and not a program  }
   { To be set if this is a library and not a program  }
   IsLibrary := FALSE;
   IsLibrary := FALSE;
 {$endif def FPC_HAS_FEATURE_DYNLIBS}
 {$endif def FPC_HAS_FEATURE_DYNLIBS}
+  { Setup heap }
+  InitHeap;
   DebugWriteLn('System unit initialization end');
   DebugWriteLn('System unit initialization end');
 end.
 end.