Browse Source

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

git-svn-id: branches/wasm@48289 -
nickysn 4 năm trước cách đây
mục cha
commit
fe7fd69d5e
2 tập tin đã thay đổi với 5 bổ sung0 xóa
  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;
 begin
+  DebugWriteLn('SysOSAlloc');
+  SysOSAlloc:=nil;
 end;
 
 procedure SysOSFree(p: pointer; size: ptruint);
 begin
+  DebugWriteLn('SysOSFree');
 end;

+ 2 - 0
rtl/wasi/system.pp

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