Delphi Runtime Library is one of the foundations of the product, as the UI libraries such as VCL and FireMonkey and also database access libraries and many third party components reply on the core RTL. That is why changes to the RTL are particularly relevant, as they tend to affect all developers. Here are some key changes that are now available.
We have introduced new standard functions for common low-level bit processing operations, listed below.
The CopyFrom function of the base TStream class used to have a fixed constant buffer for copying data (set to 60K). This can be very inefficient for copying large streams. The new default is 1MB, but the method has an additional parameter you can use to provide a specific buffer size depending on the copy operation you are doing (source and target streams). The new signature of the method is
// class TStream
function CopyFrom(const Source: TStream; Count: Int64 = 0;
BufferSize: Integer = $100000): Int64;
We updated the signature of the FreeAndNil procedure, to avoid its use with interface references and other unsupported data types. It is now declared to require a reference to a TObject:
procedure FreeAndNil(const [ref] Obj: TObject); inline;
This means that incorrect usage of FreeAndNil will now cause a compiler error. In the past, incorrect usage would not be caught, leading to difficult bugs. Note that although the parameter is declared as const, the by-reference variable is indeed modified.
That's just a partial list. We have also done quite some work on the Parallel Programming Library, AppTethering, the REST and HTTP client libraries and more of the other Delphi RTL subsystems. Hope these improvements, even if relatively minor, will be appreciated for their positive impact in every day Delphi developers work.
Learn more about RAD Studio 10.4 and download your 30 day free trial on our website
Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder. Design. Code. Compile. Deploy.
Start Free Trial
Free Delphi Community Edition
Free C++Builder Community Edition
1. Thank you for the good news!
2. Your code has a bug: "The TCustomIniFile class has bew methods"