|
|
@@ -25,7 +25,7 @@ implementation |
|
|
|
{$IFDEF PROFILER_ENABLE} |
|
|
|
|
|
|
|
uses |
|
|
|
Windows, Classes; |
|
|
|
Windows, Classes, uutlStreamHelper; |
|
|
|
|
|
|
|
type |
|
|
|
TWriterThread = class(TThread) |
|
|
@@ -220,13 +220,19 @@ end; |
|
|
|
constructor TProfileDataFile.Create(const aFileName: string); |
|
|
|
var |
|
|
|
H: TPBHeader; |
|
|
|
hh: THandle; |
|
|
|
begin |
|
|
|
inherited Create; |
|
|
|
// fDF:= TFastFileStream.Create(aFileName, fmCreate); |
|
|
|
fDF:= TFileStream.Create(aFileName, fmCreate); |
|
|
|
fDF:= TutlPagedBufferStream.Create(TFileStream.Create(aFileName, fmCreate), 4096*64, true); |
|
|
|
H.VersionMagic:= NtoBE(HEADER_VER_MAGIC); |
|
|
|
H.PtrSize:= Sizeof(PtrUInt); |
|
|
|
H.ProgramName:= ExtractFileName(ParamStr(0)); |
|
|
|
hh:= FileOpen(ParamStr(0), fmOpenRead or fmShareDenyNone); |
|
|
|
try |
|
|
|
H.ProgramFileSize:= FileSeek(hh, 0, soFromEnd); |
|
|
|
finally |
|
|
|
FileClose(hh); |
|
|
|
end; |
|
|
|
fDF.Write(H, sizeof(H)); |
|
|
|
end; |
|
|
|
|
|
|
|