Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Delphi 10.4 Runtime Library Enhancements

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.

Bit Counting Standard Functions

We have introduced new standard functions for common low-level bit processing operations, listed below.

Additional Features for Classic Classes

Better Stream Buffering

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

[crayon-662cd94657179199853459/]

Performance Optimization

FreeAndNil

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:

[crayon-662cd94657187896768776/]

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.

Additional Assorted Features

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

Exit mobile version