Skip to content

Commit 0953a79

Browse files
committedFeb 24, 2025
Minor
1 parent 5480c66 commit 0953a79

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed
 

‎ScriptEngine.pas

+20-8
Original file line numberDiff line numberDiff line change
@@ -202,16 +202,18 @@ TSEValue = record
202202
end;
203203

204204
TSEValueHelper = record helper for TSEValue
205-
procedure AllocBuffer(constref Size: Integer); inline; overload;
206-
procedure AllocMap; inline; overload;
207-
procedure AllocString(const S: String); inline; overload;
208-
procedure AllocPascalObject(const Obj: TObject; const IsManaged: Boolean = True); inline; overload;
205+
procedure AllocBuffer(constref Size: Integer); inline;
206+
procedure AllocMap; inline;
207+
procedure AllocString(const S: String); inline;
208+
procedure AllocPascalObject(const Obj: TObject; const IsManaged: Boolean = True); inline;
209209
function GetValue(constref I: Integer): TSEValue; inline; overload;
210210
function GetValue(constref S: String): TSEValue; inline; overload;
211211
function GetValue(constref I: TSEValue): TSEValue; inline; overload;
212212
procedure SetValue(constref I: Integer; const A: TSEValue); inline; overload;
213213
procedure SetValue(constref S: String; const A: TSEValue); inline; overload;
214214
procedure SetValue(I: TSEValue; const A: TSEValue); inline; overload;
215+
procedure Lock; inline;
216+
procedure Unlock; inline;
215217
end;
216218

217219
TSEValueList = specialize TList<TSEValue>;
@@ -1129,22 +1131,22 @@ procedure SEMapSet(constref V, I: TSEValue; const A: TSEValue); inline; overload
11291131
TSEValueMap(V.VarMap).Set2(S, A);
11301132
end;
11311133

1132-
procedure TSEValueHelper.AllocBuffer(constref Size: Integer); inline; overload;
1134+
procedure TSEValueHelper.AllocBuffer(constref Size: Integer); inline;
11331135
begin
11341136
GC.AllocBuffer(@Self, Size);
11351137
end;
11361138

1137-
procedure TSEValueHelper.AllocMap; inline; overload;
1139+
procedure TSEValueHelper.AllocMap; inline;
11381140
begin
11391141
GC.AllocMap(@Self);
11401142
end;
11411143

1142-
procedure TSEValueHelper.AllocString(const S: String); inline; overload;
1144+
procedure TSEValueHelper.AllocString(const S: String); inline;
11431145
begin
11441146
GC.AllocString(@Self, S);
11451147
end;
11461148

1147-
procedure TSEValueHelper.AllocPascalObject(const Obj: TObject; const IsManaged: Boolean = True); inline; overload;
1149+
procedure TSEValueHelper.AllocPascalObject(const Obj: TObject; const IsManaged: Boolean = True); inline;
11481150
begin
11491151
GC.AllocPascalObject(@Self, Obj, IsManaged);
11501152
end;
@@ -1179,6 +1181,16 @@ procedure TSEValueHelper.SetValue(I: TSEValue; const A: TSEValue); inline; overl
11791181
SEMapSet(Self, I, A);
11801182
end;
11811183

1184+
procedure TSEValueHelper.Lock; inline;
1185+
begin
1186+
GC.Lock(@Self);
1187+
end;
1188+
1189+
procedure TSEValueHelper.Unlock; inline;
1190+
begin
1191+
GC.Unlock(@Self);
1192+
end;
1193+
11821194
function SEMapIsValidArray(constref V: TSEValue): Boolean; inline;
11831195
begin
11841196
if V.Kind <> sevkMap then

0 commit comments

Comments
 (0)
Please sign in to comment.