forked from andremussche/scalemm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
smmLogging.pas
25 lines (20 loc) · 1002 Bytes
/
smmLogging.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
unit smmLogging;
interface
type
TMemoryLogging = record
//start/stop logging
//log alloc(size), realloc(old, newsize), freed
end;
//note: "Real_" pointers are determined via .map file
{ TODO -oAM : Hook object creation (store allocation type, can also be used for GC later?)
HookProc(@TObject.InitInstance, @NewInitInstance, @OldInitInstance, 'TObject.InitInstance');
HookProc(Real_AfterConstruction, @New_AfterConstruction, @Old_AfterConstruction, '_AfterConstruction');
}
{ TODO -oAM : Hook string creation (store allocation type, can also be used to be ignored by GC later?)
HookProc(Real_NewAnsiString, @New_NewAnsiString, @Old_NewAnsiString, 'NewAnsiString');
}
{ TODO -oAM : Hook array creation (store allocation type, can also be used to be partly ignored by GC later? (only if contains pointer types?))
HookProc(@DynArraySetLength, @NewDynArraySetLength, @OldDynArraySetLength, 'DynArraySetLength');
}
implementation
end.