mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 12:09:30 +02:00
* fixed compilation.
git-svn-id: trunk@7965 -
This commit is contained in:
parent
4917931c63
commit
6ffbbb5734
@ -1587,46 +1587,43 @@ procedure InitWinCEWidestrings;
|
|||||||
Memory manager
|
Memory manager
|
||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
|
||||||
function malloc(Size : ptrint) : Pointer; cdecl; external 'coredll';
|
function malloc(Size : ptruint) : Pointer; cdecl; external 'coredll';
|
||||||
procedure free(P : pointer); cdecl; external 'coredll';
|
procedure free(P : pointer); cdecl; external 'coredll';
|
||||||
function realloc(P : Pointer; Size : ptrint) : pointer; cdecl; external 'coredll';
|
function realloc(P : Pointer; Size : ptruint) : pointer; cdecl; external 'coredll';
|
||||||
function _msize(P : pointer): ptrint; cdecl; external 'coredll';
|
function _msize(P : pointer): ptruint; cdecl; external 'coredll';
|
||||||
|
|
||||||
function SysGetMem (Size : ptrint) : Pointer;
|
function SysGetMem (Size : ptruint) : Pointer;
|
||||||
begin
|
begin
|
||||||
Result:=malloc(Size);
|
Result:=malloc(Size);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function SysFreeMem (P : pointer) : ptrint;
|
Function SysFreeMem (P : pointer) : ptruint;
|
||||||
begin
|
begin
|
||||||
free(P);
|
free(P);
|
||||||
Result:=0;
|
Result:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function SysFreeMemSize(p:pointer;Size:ptrint):ptrint;
|
Function SysFreeMemSize(p:pointer;Size:ptruint):ptruint;
|
||||||
begin
|
begin
|
||||||
Result:=0;
|
Result:=0;
|
||||||
if size < 0 then
|
if (size > 0) and (p <> nil) then
|
||||||
runerror(204)
|
Result:=SysFreeMem(P);
|
||||||
else
|
|
||||||
if (size > 0) and (p <> nil) then
|
|
||||||
Result:=SysFreeMem(P);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function SysAllocMem(Size : ptrint) : Pointer;
|
Function SysAllocMem(Size : ptruint) : Pointer;
|
||||||
begin
|
begin
|
||||||
Result:=SysGetMem(Size);
|
Result:=SysGetMem(Size);
|
||||||
if Result <> nil then
|
if Result <> nil then
|
||||||
FillChar(Result^, Size, 0);
|
FillChar(Result^, Size, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function SysReAllocMem (var p:pointer;Size:ptrint):Pointer;
|
Function SysReAllocMem (var p:pointer;Size:ptruint):Pointer;
|
||||||
begin
|
begin
|
||||||
Result:=realloc(p, Size);
|
Result:=realloc(p, Size);
|
||||||
p:=Result;
|
p:=Result;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function SysTryResizeMem(var p:pointer;size : ptrint):boolean;
|
function SysTryResizeMem(var p:pointer;size : ptruint):boolean;
|
||||||
var
|
var
|
||||||
res: pointer;
|
res: pointer;
|
||||||
begin
|
begin
|
||||||
@ -1636,7 +1633,7 @@ begin
|
|||||||
p:=res;
|
p:=res;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function SysMemSize(P : pointer): ptrint;
|
function SysMemSize(P : pointer): ptruint;
|
||||||
begin
|
begin
|
||||||
Result:=_msize(P);
|
Result:=_msize(P);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user