Thursday, November 19, 2015

RAD Studio 10 Seattle Update 1 Available

The first major update of Delphi, C++Builder and RAD Studio 10 Seattle is now available.

RAD Studio 10 Seattle Subscription Update 1

The update is now available for download. This update consists of over 250 bug fixes, including fixes to 70+ customer-reported issues -- see the list at Almost all of these 70+ customer reported bugs come from Quality Portal,, and include the 5 top voted issues specifically opened for 10 Seattle (and among the most voted overall). Here are the download links:

RAD Studio 10 Seattle Web Install (includes Update 1)

C++Builder 10 Seattle Web Install (includes Update 1)

Delphi 10 Seattle Web Install (includes Update 1)

Update 1 Details

The update includes the following notable fixes (some of which are specific to Delphi or C++):

  • Win64 compiler bug causing indeterministic behavior (RSP-12512, this issue was also previously addressed with a beta hot fix available to all registered users)
  • DataSnap REST client call issues due to the switch to the HTTP client library (RSP-12685)
  • DBGrid columns sizing bugs (like RSP-12433, RSP-11797)
  • High-resolution monitor and tabbed dialog handling (RSP-12332)
  • C++ 32bit CLANG compiler issues (like RSP-12250 and RSP-11883)
  • Themed common dialogs (RS-11814)
  • TPushEvents Android exception (RSP-12347)

Notice that these bugs will be marked as closed in QP in a few days, along with all other bugs that are closed as fixed or as duplicate of other bugs that have been fixed. The process is automated but requires manual overview...

Re-Install, Only For Subscription Customers

Two more tidbits. First, this update is a full uninstall/re-install. As usual the reason is this update touches such a large number of files, that individually updating those files won't really save any time (it will be much slower, in fact), but facing more risk of errors. You might have seen the size of the recent 64bit compiler hotfix.

Second, as the name implies and as already happened for XE8 and part of Embarcadero policy since the beginning of 2015, the Update is available only to active Update Subscription customers. If you own a 10 Seattle license without Update Subscription don't try to install it: you'll have to re-install the original version. What you can do is add the Update Subscription to your current license, contacting sales or a reseller partner. The standard limitations for buying Subscription only with or immediately after the product have been waived, so any 10 Seattle customer can now buy the Subscription for the next couple of weeks.

The Most Stable RAD Studio

RAD Studio 10 Seattle was a very stable release, and with this further Update is really becomes a version that's hard to miss for any C++Builder or Delphi developer! And if you still haven't bought 10 Seattle, you can take advantage of the current, incredible offers that provide you free high-quality components (RAD Solution Pack, Konopka Controls or CodeSite, depending on the SKU) with your license. Read more at

Update: ISO Link

The ISO download is now at



Friday, November 13, 2015

Delphi Blogs of the Week/Month #35

I just realized it has been almost two months since my last collection of links, but I did blog quite a bit with the most important ones anyway.

I just realized it has been almost two months since my last collection of links, but I did blog quite a bit with the most important ones anyway. Still, welcome back to this collection of links, blogs, and other information you might have missed. here is the list, with no specific order:

That is all for this round. Maybe I should get back to my old model of sharing my Twitter retweets and Favorites on the blog... and do it more timely. But I'll probably just try to get back to a monthly list.


Tuesday, November 10, 2015

More on ARC, Weak References, and Unsafe References in Delphi Mobile Compilers

This blog post delves into some technical information about ARC and the available types of references in the Delphi compilers for iOS and Android.

This blog post delves into some technical information about ARC and the available types of references in the Delphi mobile compilers for iOS and Android. The reason for this blog post is that there has been very little technical information about this topic and I've personally only recently come to realize -- in conversations with Embarcadero developers, particularly Allen Bauer -- some of the implications (so that my Object Pascal Handbook, while correct, can be considered incomplete). 

Here I'm not going to repeat all of in the information already in my book and other sources, but provide a short overview and focus on the latest part, unsafe references, which is the most neglected one so far.

What is ARC?

Automatic Reference Counting is a memory management model based on tracking the references to a single object in memory and disposing the object in a fairly deterministic way when all references go out of scope. Unlike garbage collection, ARC happens in the thread of execution and in synch with the program flow, even if the flow can be fairly complex to easily understand when each given object will get deleted. (Not that here I want to delve into the merits of ARC vs. GC, this could be a whole different blog post). ARC is the standard memory model for Apple programming languages on both OS X and iOS.

Delphi mobile compilers all embrace ARC as the primary model, with ways to mitigate the transition from the traditional memory model thanks to extra methods built into the TObject class. When all references to a Delphi object go out of scope, the object is deleted and its destructor called. You can set a reference to nil in advance, to make this happen sooner, and even force the execution of the destructor in advance (calling DisposeOf).

Again, a lot has been written about ARC and ARC in Delphi, and I don't really have too much to add here.

What is a Weak Reference?

Weak references are a fundamental element of the ARC model. With ARC, unlike a GC, there is no loop detection so you need to "break" any loop using a weak references. This is something I cover in my book, I wrote about in white papers, and that is documented in several other sources. The implication of weak references is that these are managed. The system tracks all pending weak references, and if an object is destroyed and there is a weak references pending, this is automatically set to nil. This way you can check if a weak reference is nil to verify the object the weak reference is pointing to is still in memory -- something not available with the traditional memory model. The management of weak references has a runtime cost (although this cost is lower in Delphi than in Apple's implementation), as the system need to store them and track them. A large number of weak references might become expensive at runtime.

Can we skip using weak references altogether and use a manual, traditional approach? This is certainly a possibility, as explained below, however if you need to set up another complex object destruction notification system of your own, you might end up with a system that implies writing more code and have a larger runtime penalty compared to weak references.

What is an Unsafe Reference?

The last element, and the main point of this entire blog post, is the existence of unsafe references. There are a few documented examples of their use (including in my book) mostly focused around the scenario of handling temporary objects. A classic example is that of a function creating and returning an instance. At the point the function returns and before the object is assigned to another variable (for example as the result of an expression) the instance might end up with exactly zero references, and could be subject to (unwanted) disposal.

However, unsafe references can be useful in other scenarios. You declare one with the unsafe keyword, or (even better) the [unsafe] attribute. You can use this attribute to decorate a local variable or a field in a class or record.

What is in essence an unsafe reference under ARC compilers? It behaves basically as a traditional non-reference-counted reference of the Delphi world. No increase or decrease of the reference count happens when an unsafe reference is assigned an object or goes out of scope. No check for zero references is performed. Just like with a "good old" Delphi reference. (Along the same line mixing unsafe and ARC references can get you in some tricky scenarios, more or less like mixing interface and object references on the Windows compilers). 

Does this mean developers should scrap ARC and go for the traditional model? To me this does make sense in some very specific scenarios, in which another memory management model is already in action. In general, ARC is a very powerful and complete model I recommend understanding and embracing, rather than fighting. Make sure you learn your options, and than make an decision, rather than taking a shortcut to the scenario you know from the past.

Consider also that our entire library uses ARC and weak references (although some of those might end up moving to unsafe references in the future).

A Roundup Micro Demo

To round up the blog post, let me finish with a very simple code demo, to highlight in less than 10 lines of code the differences between regular ARC references, weak references, and unsafe references. Consider this code snippet:

  myObj: TMyClass;
  myObj2: TMyClass;
  [weak] myObjW: TMyClass;
  [unsafe] myObjU: TMyClass;
  myObj := TMyClass.Create;

  myObj2 := myObj;

  myObjW := myObj;

  myObjU := myObj;

  myObj2 := nil;
  myObj := nil; // frees the object
        // are references still (apparently) valid?   
  Show(Integer(Pointer (myObjW)).ToString);
  Show(Integer(Pointer (myObjU)).ToString);

The program creates an object with two regular (ARC) references plus a weak and an unsafe one. The reference count is displayed each time. Later the two main references are set to nil (effectively freeing the object), and we look at the raw pointer value of the two "pending" references, the weak and the unsafe one. Can you guess the output without looking to the image below?

As you can see, the weak reference is automatically set to zero (so you can do an if Assigned test before using it), while the unsafe reference becomes in all effects a dangling reference, a reference to the memory location where the object used to be (before being destroyed). Using that reference is bound to incur in errors and it is very difficult to determine at run time if that reference is indeed valid. Which is the main reason for using a weak reference in the first place.

Of course, the point of using weak and unsafe references is in managing very complex data structures, but this small snippet should convey the key technical differences among these three reference types, underlying the fact that they behave in a significantly different way. I hope this blog post helps shed some light.

Wednesday, November 4, 2015

FireMonkey Paint Canvases

While giving a session on FireMonkey architecture yesterday at EKON, we got to the subject of alternative configuration for the direct paint operations, using the GPU in different ways.

While giving a session on FireMonkey architecture yesterday at EKON, we got to the subject of alternative configuration for the direct paint operations, using the GPU in different ways. To demonstrate that on different platforms the Canvas object you use for painting is different, I added to an empty FireMonkey form the following OnPaint event handler:

      procedure TFormFMtoGPU.FormPaint(Sender: TObject; Canvas: TCanvas;
  const ARect: TRectF);
  Canvas.Fill.Color := TAlphaColorRec.Blue;
  Canvas.Font.Size := Height div 3;
  Canvas.FillText (
    ARect, Canvas.ClassName, True,
    1, [], TTextAlign.taCenter);

If you run this FireMonkey applications on different platforms, you'll see different Canvas objects are going to be used:

  • on Windows, by default, you get TCanvas2D2 (for Direct2D support)
  • on the Mac, you get TCanvasQuartz (Quartz is the OS X GPU library)
  • on mobile platforms, both iOS and Android, you get a TCanvasGpu

This "GPU Canvas" is a way to send graphic commands to the GPU directly, bypassing an operating system stack which is not always very efficient. Now what it less know is that you can use the same GPU Canvas also on Windows, by forcing it with the global setting  FMX.Types.GlobalUseGPUCanvas to True in the project source code before the application object is initialized. On Windows there is also the option of disabling DirectX and using the GDI+ fallback, generally a slower solution with much worse anti-aliasing effects. This is achieved by setting to False the global setting  FMX.Types.GlobalUseDirect2D . In other words, on Windows you have 3 separate options.

For more information, you can read the following:

The session at EKON was mostly focused on styles in FireMonkey, however a developer in the audience was able to tweak the canvas and get an application working on a rather old PC, so I though it was worth sharing the tip.


Thursday, October 29, 2015

October 2015 XE6 Hotfix Available

A new hotfix for RAD Studio XE6 (but also Delphi XE6 and C++Builder XE6) is available on CodeCentral, but only for current Update Subscription customers.

Following the XE7 counterpart, there is now a hotfix available for RAD Studio XE6, called "October 2015 XE6 Update Subscription Update". This includes a subset of the issues fixed in the recent XE7 hotfix. Again, this hotfix is available only to Update Subscription customers, as an extra bonus for our most loyal customers.

As we covered a few times, Update Subscription is your way to stay current with the products and also have fixes for recent past versions. We understand that even if you have the latest version available you cannot migrate immediately and cannot migrate all of your applications. While newer versions offers many significant enhancements in many areas of the product, and we certainly want to encourage everyone to move to RAD Studio 10 Seattle, having project on older versions with a few issues fixes can be beneficial.

So if you bought XE8 with Update Subscription you can head to

download and install. If you started update subscription with 10 Seattle, you can also download the package, but you might have to refresh your license in License Manager (at least over the next few days) before you can apply the fix. The installer, in fact, checks for a specific update subscription + license combination. By the way, the same applies to the XE7 fix: we are doing some final testing and will explain the actual steps as soon as possible.

Finally, the team is also working on an XE8 Update including some of the fixes introduced in 10 Seattle. And also working on the first main Update for 10 Seattle itself. These updates will also be limited to Update Subscription customers: If you bought 10 Seattle recently you might still have time to add the Update Subscription to it!


Tuesday, October 27, 2015

Speaking at EKON 19 Next Week

Next week I'll be speaking at the 19th EKON conference in Germany, a rather large Delphi-focused event with tracks in German and in English, and many top quality speakers.

Next week I'll be speaking at the 19th EKON conference in Germany, a rather large Delphi-focused event with tracks in German and in English, and many top quality speakers.

EKON,, is one of the longest standing Delphi events, now in its 19th edition (even if originally it was a multi-technology developer conference). The conference runs November 2nd (Monday) to 4th (Wednesday) in Koeln (or Cologne), Germany. The location is a minute from the main train station, very easy to reach.

There are two speakers coming from the US (Cary Jensen and Nick Hodges), many well known German and European speakers, an Embarcadero presence with myself and Matthias Eissing. I'll give a keynote on Delphi 10 Seattle and the product status in general, and also two technical sessions on VCL/Windows 10 and on FireMonkey.

EKON is generally a very nice event for networking with other developers, chat over a beer, and have some fun. If you are coming, I'll be available for a chat, for a meeting with your team, or anything else. I can also bring printed copies of my latest Object Pascal Handbook, if you want one signed -- but let me know in advance.


Wednesday, October 21, 2015

Running Delphi Applications on Android Intel

As I mentioned in my last blog post about my CodeRage product address, it is technically possible to run Delphi Android applications on Intel devices. Here are some details on how to disable the Intel platform checks.

As I mentioned in my last blog post about my CodeRage product address, it is technically possible to run Delphi Android applications on Intel devices. For the conference, Jim McKeeth had an Android Intel device he used, but I don't have one at hand. It was good someone suggested me to look into this blog post by Magno Lima,, focused on using Bluestacks Android Intel emulator.

This emulator (unlike others) runs a full Android and it does support libHoudini, the emulation layer for ARM binaries. So armed with a little time today I installed Bluestacks, fiddled a little with the adb tool to make it visible to the Android SDK (and RAD Studio), and started some experiments. If you take a plan FireMonkey application and deploy it, this is what you get:

This happens because FireMonkey, by default, injects platform test code into the application. Originally an ARM binary would just crash on Intel, so better show an error message than an exception. You can read about this at (and the case is similar to the Amazon table one). So what you have to do in practice (and Magno explains very well), you have to remove the x86 check by removing the library from your project in the deployment options:

In the background you can also see the Bluestacks target (with a rather random name) in the Project pane of RAD Studio. Now run the application again, and it should work:

Of course, you can run also some fairly more complex applications, like the one below (in this case notice the issue with the title bar, explained again by Magno at -- along with a workaround). Something to work on for our dev team. Anyway, this is the output of the actual demo:

I ended up with some "fire" apps on Bluestacks... but again, the same should work on a physical Android Intel device, with a recent version of Android (Lollipop preferred) equipped with libHoudini:


Monday, October 19, 2015

My CodeRage Delphi Product Address and the Broadening our Android Platform

In my CodeRage X Product Address for the Delphi/Object Pascal track last week I covered the status of the product and highlighted the "broadening" of FireMonkey Android target platform.

In my CodeRage X Product Address for the Delphi/Object Pascal track last week I covered the status of the product with Luis Navarro and highlighted the "broadening" of FireMonkey Android target platform. In particular I showed two short demos covering:

  • How the current beta version of the Microsoft Astoria UWP (Universal Windows Platform) bridge can be used to execute FireMonkey applications build for Android on a beta version of the Windows 10 Phone operating system. To test this you need a compatible phone, with a beta of Windows 10, to sign up for project Astoria, configure the Android SDK with specific Microsoft add-ons, and the RAD Studio IDE will be able to target the Lumia devices directly. Not everything we have tested works, but this is still in beta.
  • How the most recent Android Intel tablets can run FireMonkey applications build for ARM targets using the pre-installed libHoudini library Intel is offering. From some recent internal tests on the libHuodini that comes with Intel Android Lollipop, the compatibility is very high, and in the session Jim demonstrated running InterBase IBLite, FireDAC, and FireMonkey smoothly. It is important to notice you need to disable the Intel platform check in the deployment options, or that code will display an error message and stop the application. That check was originally added to avoid an odd crash of the application on earlier Android Intel devices.

Now the real question becomes, with these solutions working is RAD Studio going to provide also a native solution for Windows Phone and Android Intel?

In the case of Windows Phone the apps you are building in RAD Studio are binaries that can run on the phone CPU as they are, with a mapping layer for APIs only. Astoria offers extra Java APIs and an Astoria app is a UWP app that you should be able to distribute via Windows Store. While we do plan improving our support for Windows 10 Phone via Astoria once this is released, we consider this native platform support.

In the case of Android Intel, the solution works like a virtual machine, remapping assembly instructions to a different CPU, while the APIs are already compatible. This is not the ideal solution, as performance is affected, although the applications still seem quite responsive. We plan keeping this platform under scrutiny, collecting feedback on the libHoudini layer, evaluating the market share (which remains quite modest), and determining the priority for a potential Intel Android compiler and toolchain.

Getting back to the overall Product Address, including the mentioned demos, you can find it on YouTube or linked below:


Friday, October 9, 2015

CodeRage X Online Conference Starting Next Tuesday

The 10th edition of the online CodeRage developer conference is starting next week, Tuesday to Thursday. Sign up now and don't miss the online sessions and live Q&A.

The 10th edition of the online CodeRage developer conference is starting next week, Tuesday to Thursday. The theme for this year’s CodeRage conference is " Develop Anything, Anytime, Anywhere ".

Most of you have probably attended past edition, and it is great if you have a chance to reserve a little time next week for training... better understanding Delphi and C++ Builder product features (not limited to the 10 Seattle release) and exploring solutions and third party components. The online conference has two parallel tracks devoted to the two programming languages used by RAD Studio developers.

The conference goes from 5am to 5pm US Pacific time, which is 8am to 8pm US eastern time, 2pm to 2am for those in central Europe, and so on. More technical information, the webinar software downlaod and so on at

Object Pascal / Delphi Sessions

Among the Delphi sessions, I'll give the introductory Product Address, and there will sessions on Windows 10, IoT, Parse, AWS, DataSnap, VCL styling, core RTL, InterBase, VCL components, WinRT integration, security, parallel programming and multi-threading, MongoDB, Android services and Intents, mobile sensors.

R&D team member sessions including those FireMonkey, BeaconFence, EMS, and PAServer. Third party and Embarcadero components include FastReports, Gnostice, AppAnalytics, CodeSite, FastReport, FrameStand, and Arduino. Plus other sessions I've probably missed.

The complete list is at

C++ / C++Builder Sessions

Many C++ sessions have the same content of those above, so the list is similar, and that should not come as a surprise. After a C++ Product address, the C++ specific sessions include a special "Meet the C++ team event", some component session like OpenWire, some FireDAC sessions, and more. As you can see in the list, some of the sessions are not strictly product specific but are only in one of the tracks, other are duplicated as the code demos will be specific to the track.

The complete list is at:

Register Now!

If you still haven't done so, sign up now at:

and don't miss the online sessions and live Q&A. We are expecting a packed house... good that we'll have enough room (ehm, bandwidth) for you all.

See You Online

And see you online next week! I'm heading to Scott Valley, California over the weekend to help host the event, be there for live Q&A, and have my regular visit to the office, as well. We'll be online in the Embarcadero Community, Facebook, Twitter, Google+ and more, to engage with all online conference attendees and have also a bit of fun.


Tuesday, October 6, 2015

Summer 2015 XE7 Hotfix Available

A new hotfix for RAD Studio XE7 (but also Delphi XE7 and C++Builder XE7) is available on CodeCentral, but only for Update Subscription customers.

Called " Summer 2015 XE7 Update Subscription Update ", a new hotfix for XE7 is available on CodeCentral. As you can guess from the name, we planned to release it a couple of weeks ago (well, they say October is part of Indian Summer in California). Anyway, the idea is to use a "season" name, rather than a number, to make it is easier to refer to different fixes released over a longer time period.

It is important to notice that this hotfix is available only for Update Subscription customers. This is part of the new model introduced by the company since earlier this year and you can read more about at

What is the rationale of this approach? Many of our customers told us that even if they are on Update Subscription they don't plan migrating all developers, and even less all existing projects, to the latest release, which is why offering fixes for some of the most critical bugs in older releases is relevant. Notice we don't plan to update target operating systems support in older releases, although some exceptions might happen. If you need to target the latest operating systems, particularly the mobile ones, staying current with RAD Studio will be an advantage.

However, if you have projects based on XE7, this hotfix can help with a few quite core issues, mostly in the RTL. The list of actual fixes (a dozen, all customer reported issues either on QP or QC), along with the download -- a whopping 670MB, please ignore the "Download 0 bytes reference" -- is available at:

We are currently working on fixes for XE6 (very similar to the XE7 set) and XE8 (mostly focusing on regressions already fixed in 10 Seattle). This work is done as part of the new Update Subscription model promise to offer fixes for past versions for up to 2 years, which is a significant change from the past approach.