mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 03:35:57 +02:00
codetools: mem stats plus keywordfunclist
git-svn-id: trunk@19928 -
This commit is contained in:
parent
20e525a22b
commit
2ffb8e87be
@ -5141,6 +5141,7 @@ begin
|
||||
Node:=FPascalTools.FindSuccessor(Node);
|
||||
end;
|
||||
end;
|
||||
Stats.Add('KeywordFuncLists.Global',KeywordFuncLists.CalcMemSize);
|
||||
Stats.WriteReport;
|
||||
Stats.Free;
|
||||
end;
|
||||
|
@ -168,11 +168,14 @@ var
|
||||
function UpperCaseStr(const s: string): string;
|
||||
function IsUpperCaseStr(const s: string): boolean;
|
||||
|
||||
function CalcMemSize: PtrUInt;
|
||||
|
||||
implementation
|
||||
|
||||
var
|
||||
CharToIHash: array[char] of integer;
|
||||
UpWords: array[word] of word;
|
||||
KeyWordLists: TFPList;
|
||||
|
||||
function UpperCaseStr(const s: string): string;
|
||||
var i, l, l2: integer;
|
||||
@ -200,6 +203,19 @@ begin
|
||||
Result:=i>l;
|
||||
end;
|
||||
|
||||
function CalcMemSize: PtrUInt;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
Result:=0;
|
||||
if KeyWordLists<>nil then begin
|
||||
inc(Result,PtrUInt(KeyWordLists.InstanceSize)
|
||||
+SizeOf(Pointer)*PtrUInt(KeyWordLists.Capacity));
|
||||
for i:=0 to KeyWordLists.Count-1 do
|
||||
inc(Result,TBaseKeyWordFunctionList(KeyWordLists[i]).CalcMemSize);
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TBaseKeyWordFunctionList }
|
||||
|
||||
constructor TBaseKeyWordFunctionList.Create;
|
||||
@ -703,8 +719,6 @@ end;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
var KeyWordLists: TFPList;
|
||||
|
||||
procedure InternalInit;
|
||||
var
|
||||
c: char;
|
||||
|
Loading…
Reference in New Issue
Block a user