Browse Source

+ add a size parameter to FreeMemory() as some platforms might need that

git-svn-id: trunk@42182 -
svenbarth 6 years ago
parent
commit
f17c689829

+ 1 - 1
packages/rtl-objpas/src/i386/invoke.inc

@@ -907,7 +907,7 @@ end;
 destructor TSystemFunctionCallback.Destroy;
 begin
   if Assigned(fData) then
-    FreeMemory(fData);
+    FreeMemory(fData, fSize);
 end;
 
 constructor TSystemFunctionCallbackProc.Create(aHandler: TFunctionCallProc; aContext: Pointer; aCallConv: TCallConv; constref aArgs: array of TFunctionCallParameterInfo; aResultType: PTypeInfo; aFlags: TFunctionCallFlags);

+ 1 - 1
packages/rtl-objpas/src/inc/rtti.pp

@@ -770,7 +770,7 @@ begin
 {$ENDIF}
 end;
 
-procedure FreeMemory(aPtr: Pointer);
+procedure FreeMemory(aPtr: Pointer; aSize: PtrUInt);
 begin
 {$IF DEFINED(WINDOWS)}
   VirtualFree(aPtr, 0, MEM_RELEASE);

+ 1 - 1
packages/rtl-objpas/src/x86_64/invoke.inc

@@ -654,7 +654,7 @@ destructor TSystemFunctionCallback.Destroy;
 begin
 {$ifdef windows}
   if Assigned(fData) then
-    FreeMemory(fData);
+    FreeMemory(fData, fSize);
 {$endif}
 end;