THRIFT-5428 Prevent costly reallocations to improve performance
Client: Delphi
Patch: Jens Geyer
diff --git a/lib/delphi/src/Thrift.Transport.WinHTTP.pas b/lib/delphi/src/Thrift.Transport.WinHTTP.pas
index b0f32ef..746611d 100644
--- a/lib/delphi/src/Thrift.Transport.WinHTTP.pas
+++ b/lib/delphi/src/Thrift.Transport.WinHTTP.pas
@@ -41,7 +41,7 @@
strict private
FUri : string;
FInputStream : IThriftStream;
- FOutputMemoryStream : TMemoryStream;
+ FOutputMemoryStream : TThriftMemoryStream;
FDnsResolveTimeout : Integer;
FConnectionTimeout : Integer;
FSendTimeout : Integer;
@@ -127,7 +127,7 @@
FSecureProtocols := DEFAULT_THRIFT_SECUREPROTOCOLS;
FCustomHeaders := TThriftDictionaryImpl<string,string>.Create;
- FOutputMemoryStream := TMemoryStream.Create;
+ FOutputMemoryStream := TThriftMemoryStream.Create;
end;
destructor TWinHTTPClientImpl.Destroy;
@@ -269,7 +269,7 @@
procedure TWinHTTPClientImpl.Open;
begin
FreeAndNil( FOutputMemoryStream);
- FOutputMemoryStream := TMemoryStream.Create;
+ FOutputMemoryStream := TThriftMemoryStream.Create;
end;
procedure TWinHTTPClientImpl.Close;
@@ -284,7 +284,7 @@
SendRequest;
finally
FreeAndNil( FOutputMemoryStream);
- FOutputMemoryStream := TMemoryStream.Create;
+ FOutputMemoryStream := TThriftMemoryStream.Create;
ASSERT( FOutputMemoryStream <> nil);
end;
end;