mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 07:19:18 +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);
|
Node:=FPascalTools.FindSuccessor(Node);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Stats.Add('KeywordFuncLists.Global',KeywordFuncLists.CalcMemSize);
|
||||||
Stats.WriteReport;
|
Stats.WriteReport;
|
||||||
Stats.Free;
|
Stats.Free;
|
||||||
end;
|
end;
|
||||||
|
@ -168,11 +168,14 @@ var
|
|||||||
function UpperCaseStr(const s: string): string;
|
function UpperCaseStr(const s: string): string;
|
||||||
function IsUpperCaseStr(const s: string): boolean;
|
function IsUpperCaseStr(const s: string): boolean;
|
||||||
|
|
||||||
|
function CalcMemSize: PtrUInt;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
var
|
var
|
||||||
CharToIHash: array[char] of integer;
|
CharToIHash: array[char] of integer;
|
||||||
UpWords: array[word] of word;
|
UpWords: array[word] of word;
|
||||||
|
KeyWordLists: TFPList;
|
||||||
|
|
||||||
function UpperCaseStr(const s: string): string;
|
function UpperCaseStr(const s: string): string;
|
||||||
var i, l, l2: integer;
|
var i, l, l2: integer;
|
||||||
@ -200,6 +203,19 @@ begin
|
|||||||
Result:=i>l;
|
Result:=i>l;
|
||||||
end;
|
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 }
|
{ TBaseKeyWordFunctionList }
|
||||||
|
|
||||||
constructor TBaseKeyWordFunctionList.Create;
|
constructor TBaseKeyWordFunctionList.Create;
|
||||||
@ -703,8 +719,6 @@ end;
|
|||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
var KeyWordLists: TFPList;
|
|
||||||
|
|
||||||
procedure InternalInit;
|
procedure InternalInit;
|
||||||
var
|
var
|
||||||
c: char;
|
c: char;
|
||||||
|
Loading…
Reference in New Issue
Block a user