CodeGear

You are currently browsing articles tagged CodeGear.

Small Celebration

We rewarded us with a small celebration today at the office in Stockholm. The count of Delphi 2006 licenses sold in the Nordic countries (that is Denmark, Finland, Norway, Sweden and Iceland) passed the count of Delphi 7 licenses. And No, we are not cheating and counting the free Turbo products.

The following days are going to be busy for me. I’m doing a Delphi Migration seminar in Denmark on Thursday, Gothenburg on Friday, Helsinki on Monday and Stockholm on Tuesday. The goal with the seminar and workshop is to help Delphi developers that wants to upgrade their projects from Delphi 5,6,7 to Delphi 2006 or want to learn more about what they have to do to adapt their application to Windows Vista. All events are fully booked except in Helsinki where there are a few seats left.

Tags: ,

Delphi 2006 on Vista

I promised Magnus who is one of the organizers of the Delphi User Group in Gothenburg to promote the Swedish Delphi IRC channel. Just start IRC when you come to work and have the channel open and your Swedish Delphi peers are only a few clicks away… I guess our Scandinavian friends are welcome to ;-)

To use IRC you need a client just like your browser and the most popular client is mIRC (download). It is shareware but there are others that are free, just google around a little…

There are many, many different irc networks so you need to connect to Quakenet when your client is installed and join the channel #delphi.nordic

Delphi 2006 and Windows Vista

I reinstalled the RTM version of Windows Vista a few days ago. Delphi 2006 is running fine on the my new operating system even if there where some quirks during the install. I thought I should mention them here if you too run into them. The installer issues appear to be related to the fact that Windows Vista has a new version of msiexec that behaves slightly different. If you google this topic you might find a few references on the net that Delphi does not install at all on Vista but that only applies to Vista Release Candidate 2, that had a defect in the installer.

Bootstrap – Before you can install you have to install a few Microsoft components. All of them installs fine except SP1 for dot net 1.1. You will get a big dialogue with all msi command line options. Before you hit OK manually start the installation of SP1 from you CD by double clicking on XXX. When installation is complete, reboot you computer. When it restarts there will be a warning in your system tray that a program is blocked. Right click on the icon and select run blocked program from the popup menu.

Delphi Update 2 – The msi package with update 2 does not find the installation if you double click on it. You have to click on the Windows Start button, type cmd, right click on the Cmd Short cut and select run as administrator. From the console windows follow the instructions in the readme file for msi version 3.

Tags: , ,

I have been teaching Delphi in Linkoping, Sweden this week. Even if you know your topic it requires constant concentration and it is exhausting but fun.

This week, a colleague of mine attended the Java User Group meetings in Stockholm and Gothenburg (together with 350 Java developers) and talked about JBuilder 2007. Most seem to have the understanding that we have been knocked-out but are happy to see us up and running again with new innovations in the Java area and a good well founded support for our Eclipse strategy. All developers that we have spoken to are courious about JB2007 and most understand the needs we address in the product and they way we are doing it. All find Eclipse to be a hassle to configure but really appreciate the open api’s and flexibility, from that perspective all buy into what we are doing with JBuilder.

It is nice to have a company name again and at December 13th we (the eight CodeGear guys in Stockholm) move to our new office in Solna Business Park.

There are a lot of Delphi activities in Scandinavia the following weeks.

Delphi Migration Seminar and Workshop

For Delphi developers that want help to upgrade their projects from Delphi 5, 6, 7 to Delphi 2006 or want to learn more about what they have to do to adapt their applications to Windows Vista.

Copenhagen, December 7th

Gothenburg, December 8th

Helsinki, December 11th

Stockholm, December 12th

Delphi Day in Oslo

There are also plans for a one day seminar in Oslo at December 15th. More details are coming about this…

Have a look at Jedi Code Format

A very useful little tool if you are running into a project that has all text in uppercase and no indenting. I love it! I just had to tell you about it if you missed it.

Tags: ,

Looking for a new Job?

I noticed that Skype is searching for a new Delphi programmer doing UI Development for Windows. Interesting if you happens to live in Estonia!

You do not have so many options good options today if you want to develop native applications (and with native I mean not a managed .NET application). I guess the main candidates are Delphi, C++Builder, VB6 and possible C++ if you like MFC. Correct me if I’m wrong…

Tags: ,

Yesterday evening I attended a Delphi user group meeting in Stockholm, Sweden.

Memory Manager

I spoke very shortly about the change of Memory Manager in Delphi 2006. Except for the IDE, the new memory manager only affects Delphi and C++ applications compiled to native code (i.e. Win 32) not .Net applications.

function GetMem(Size: Integer): Pointer;

function FreeMem(P: Pointer): Integer;

function ReallocMem(P: Pointer; Size: Integer): Pointer;

The Memory Management is only three functions to implement as effectively as possible. These basal functions are used by almost everything in you application so changing them can have a remarkable effect on your application – they affect the overall speed and memory usage.

But implementing them is easier said than done. There is a lot of interesting optimizations problems; memory fragmentation is one area.

Memory Fragmentation

The large rectangle in picture 1 represents one part of your heap. It is a larger memory block that the memory manager required from the operating system. The green rectangles are smaller blocks that are in use – they could contain for example a string, a button instance, a dynamic array, etc.

In picture 2 more objects are created and space is reserved for them on the heap. In picture 3 old objects are freed and memory is available for use again.

Notice that we get gaps. In picture 4 we need to allocate room for a new block that is slightly larger. We need to spend time to search for a space that is large enough and when we find a gap the fit might not be perfect and we get smaller gaps of unused space.

fragmentation1.gif

FastCode Project

In 2005 the FastCode Project had a challenge to write the fastest replacement for the Delphi Memory Manager. The Fastcode Challenges is a project running on a volunteer basis that provides highly optimized functions for the Delphi community. (Thank you guys!) Functions are faster versions of Delphi runtime library functions, VCL functions or functions meant as extensions for these.

Pierre le Riche won the challenge with his memory manager FastMM. In Developer Studio
2006 (and the new Turbo Delphi and Turbo C++) is the old Memory Manager (located in getmem.inc) replaced with Pierre’s code from FastMM.

New and Old

The FastCode project has a benchmark and validation tool to measure and test the different contributions and the benchmark below compares the default memory manager in Delphi 7 and Delphi 2006.

benchmark1.gif

As you can see there is a drastic difference. Will it double the speed of your application if you recompile? Probably not but it depends on your code off course. I guess the easiest way to find out is to recompile your application in Delphi 2006 and test.

There are other benefits except for increased speed and reduced memory consumption. Since there is less memory fragmentation, memory intense application can run longer before the dreaded out of memory exception occurs. You can also use more than 3GB memory.

Report on Memory Leaks

The new memory manager works differently than the old memory manager and does more pointer checking, so it will catch more errors.

Setting ReportMemoryLeaksOnShutdown to True shows a message box with a report on all memory leaks every time you shut down your application.

{Display leaks on shutdown if a debugger is present}
ReportMemoryLeaksOnShutdown := DebugHook <> 0;

Turning it on can be a bit horrifying if you add it to an existing project. It will take some time before you get a clean project but it can be very useful if you have it in place from the beginning of a new project.

Read more about the new memory manager in a BDN article by Pierre le Riche.

Stuck on older versions?

It is possible to replace the default memory manager in older Delphi versions with your own. The only thing you have to do is to call SetMemoryManager in the System unit. If you have an old Delphi application you have not upgraded yet it is possible to download FastMM and use it in your existing application.

Tags: ,

« Older entries § Newer entries »