The smells of “crap we’ve been sued, better do something”. Isn’t this deja vu?
Archive for June, 2009
Visual Studio post version 6 has an interesting time with its runtime library. For those that remember back that far, Visual C++ 6 used a library called msvcrt.dll / msvcrtd.dll. These libraries are included, to this day, in all versions of Windows and remain perfect compatible with Visual C++ 6 compiled binaries.
A lot of other analysis has gone into this on other blogs. I won’t repeat all of it here, but be sure to check out the blog of the KovoIRC developer.
Let’s start out with a simple program. It’s quite basic, but it’s a good starting point. I have made a small Win32 Console Project in Visual Studio making sure that I have made a directory made for the solution and the project directory sits within it.
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
char* x = new char[100];
memcpy(x, "Hello World", 11);
puts(x);
delete [] x;
return 0;
}
Your first question is probably; Why are you creating a buffer using new then using memcpy and delete? The answer is that I want to make sure I use the new/delete operators. sprintf isn’t available, so I can’t use that.

Visual Studio Runtime Picker
Let’s statically link the runtime with it and produce a release executable. That produces a 53KB EXE. Ok, that’s not fair, there’s features in other runtimes we can’t use. So let’s turn off the security checking etc. Still 53KB.

Normal Static Linked Binary Size
Now we have our base point. Let’s do the following:
- Convert the solution directory to a GIT repo
- Add the git submodule from git://github.com/leepa/libctiny.git
- Add the new sub project to the solution in Visual Studio
- Add a Project Dependency to the HelloBlogPost project so it depends on MiniCrt
Git makes managing these things insanely easy. By using a git submodule you get to ensure you stay at the point you want to, but update it easily if needs be. Basically, it’s a great way of including 3rd party libraries in a project.
To do all this we can do the following (assuming msysGIT in Windows).
git.exe init # You probably now want to do your # adds/commits and .gitignore # stuff git.exe submodule add -- "git://github.com/leepa/libctiny.git" "libctiny"
Ace, now let’s try and compile again… 4KB. That’s a bit better isn’t it? The same program but a much small runtime footprint.

EXE Size with libctiny
Isn’t that much better? For when you just need to do simple executable files, this can’t be beat. I can’t take credit for the library, I just added it a public Git repository and fixed a couple of new intrinsic functions that Visual Studio 2008 defines (ohama @ Google updated it to VS2005).
Credits: Under the Hood: Reduce EXE and DLL Size with LIBCTINY.LIB & omaha – Software installer and auto-updater for Windows.
MacRumors is reporting that the new Unibody MacBook Pros announced last week have an interesting issue:
Apple seems to have quietly downgraded the SATA Interface from 3.0Gbit to 1.5Gbit speeds in some of the new MacBook Pros introduced last week
As correctly highlighted in the posting, most drives can’t saturate it. Apart from, unfortunately, SSD drives. Although these little beggars are still beyond most people’s level of feasibility, they are useful for more rugged conditions. I’m hoping this is a bug in OSX rather than a purposeful hardware change. Or, maybe it’s to make the battery last a log longer?
13″ and 15″ MacBook Pros Have a Slower SATA Interface – Mac Rumors
Stories like this enrage me. Why? Let’s take a look at the story’s strapline on the front page as of right now:
A patient with swine flu and other health problems has died, a Scottish government spokesman has confirmed.
Right, so a patient, who has flu… you with me so far? Died. Ok, that’s fine. The important detail is also included near the top of the story:
The patient, who had underlying health problems, is understood to have died while being treated at the Royal Alexandra Hospital in Paisley.
Of course, the general public will ignore the bits I have bolded here. It’s written as a scare story with the facts only mentioned in passing. The media, already known for blowing things out of proportion, are just at it again. It’s a well known fact, even with normal Flu variants, that if you have underlying health problems, the risk of complications is high. Nice one BBC News, I notice you failed to mention that little detail.
It’s annoying, spammy, and makes subscribing to a blog pointless. It did however stop the spam as it appears spam bots tend to go more for blogs that have no updates at all. However, for one reason or another, I will have more time to update my blog over the coming months. So fingers crossed, I won’t need that again!
The BBC has posted their first article about E3 opening this week choosing to go with the PSP Go. It’s the first I have personally seen of the device which has had leaked pictures posted all over the Internet.
It looks interesting, but only in that Sony have been desperate to pull consumers away from the Nintendo DS. It’s surely feeling a lot of pressure from the recent DSi release and this is the response.
There is also a bit of talk about the Slimline PS3 – let’s hope they have solved the power issues i.e. the fact it requires a small nuclear power station to be on standby.

