mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 03:18:55 +02:00
LCL: TLCLNonFreeMemManager extended for 64bit
git-svn-id: trunk@19675 -
This commit is contained in:
parent
c454c572c6
commit
668b4abdb4
@ -23,7 +23,7 @@
|
||||
Abstract:
|
||||
Defines TCodeToolMemManager, which is the base class for the various
|
||||
memory manager in the codetools. An own memory manager is somewhat faster
|
||||
and makes debugging and proiling easier.
|
||||
and makes debugging and profiling easier.
|
||||
}
|
||||
unit CodeToolMemManager;
|
||||
|
||||
@ -72,7 +72,7 @@ type
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -197,6 +197,9 @@ type
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
type
|
||||
|
||||
{ TGlobalIdentifierTree }
|
||||
|
||||
TGlobalIdentifierTree = class
|
||||
private
|
||||
FItems: TAVLTree; // tree of PChar;
|
||||
@ -206,6 +209,7 @@ type
|
||||
procedure Clear;
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
function Count: integer;
|
||||
end;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@ -579,6 +583,14 @@ begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function TGlobalIdentifierTree.Count: integer;
|
||||
begin
|
||||
if FItems<>nil then
|
||||
Result:=FItems.Count
|
||||
else
|
||||
Result:=0;
|
||||
end;
|
||||
|
||||
function TGlobalIdentifierTree.AddCopy(Identifier: PChar): PChar;
|
||||
var Len: integer;
|
||||
begin
|
||||
|
@ -5117,6 +5117,7 @@ begin
|
||||
// create nodes
|
||||
ScanChilds(InterfaceNode);
|
||||
|
||||
DebugLn(['TFindDeclarationTool.BuildInterfaceIdentifierCache ',MainFilename,' ',FInterfaceIdentifierCache.Items.Count,' ',GlobalIdentifierTree.Count]);
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
|
@ -72,15 +72,17 @@ type
|
||||
|
||||
TLCLNonFreeMemManager = class
|
||||
private
|
||||
FItemSize: integer;
|
||||
FItemSize: PtrInt;
|
||||
FItems: TFPList;
|
||||
FCurItem: Pointer;
|
||||
FEndItem: Pointer;
|
||||
FCurSize: integer;
|
||||
FFirstSize: integer;
|
||||
FCurSize: PtrInt;
|
||||
FFirstSize: PtrInt;
|
||||
FMaxItemsPerChunk: PtrInt;
|
||||
public
|
||||
ClearOnCreate: boolean;
|
||||
property ItemSize: integer read FItemSize;
|
||||
property ItemSize: PtrInt read FItemSize;
|
||||
property MaxItemsPerChunk: PtrInt read FMaxItemsPerChunk write FMaxItemsPerChunk;
|
||||
procedure Clear;
|
||||
constructor Create(TheItemSize: integer);
|
||||
destructor Destroy; override;
|
||||
@ -229,6 +231,8 @@ begin
|
||||
if (FCurItem=FEndItem) then begin
|
||||
// each item has double the size of its predecessor
|
||||
inc(FCurSize,FCurSize);
|
||||
if (FMaxItemsPerChunk>0) and (FCurSize>FMaxItemsPerChunk*FItemSize) then
|
||||
FCurSize:=FMaxItemsPerChunk*FItemSize;
|
||||
GetMem(FCurItem,FCurSize);
|
||||
if ClearOnCreate then
|
||||
FillChar(FCurItem^,FCurSize,0);
|
||||
|
Loading…
Reference in New Issue
Block a user