Browse Source

[PATCH 125/188] adding wasmdata entity

From 505041d99961278b6b3d06d09f3531d9690f55e8 Mon Sep 17 00:00:00 2001
From: Dmitry Boyarintsev <[email protected]>
Date: Mon, 23 Mar 2020 16:22:45 -0400

git-svn-id: branches/wasm@46121 -
nickysn 5 years ago
parent
commit
f1d711a61d
1 changed files with 20 additions and 1 deletions
  1. 20 1
      utils/wasmbin/wasmmodule.pas

+ 20 - 1
utils/wasmbin/wasmmodule.pas

@@ -173,7 +173,11 @@ type
   { TWasmData }
   { TWasmData }
 
 
   TWasmData = class(TObject)
   TWasmData = class(TObject)
-    id   : TWasmData;
+    id       : TWasmId;
+    offset   : TWasmInstrList;
+    databuf  : array of byte;
+    function StartOffset: TWasmInstrList;
+    destructor Destroy; override;
   end;
   end;
 
 
   { TWasmMemory }
   { TWasmMemory }
@@ -317,6 +321,21 @@ begin
   l.Clear;
   l.Clear;
 end;
 end;
 
 
+{ TWasmData }
+
+function TWasmData.StartOffset: TWasmInstrList;
+begin
+  if not Assigned(offset) then
+    offset := TWasmInstrList.Create;
+  Result:=offset;
+end;
+
+destructor TWasmData.Destroy;
+begin
+  if Assigned(offset) then offset.Free;
+  inherited Destroy;
+end;
+
 { TWasmElement }
 { TWasmElement }
 
 
 function TWasmElement.AddFunc(idx: integer): integer;
 function TWasmElement.AddFunc(idx: integer): integer;