Memory Leaks
On the way home tonight I came up with a method of memory leak detection. The problem with memory leak detection, is if you have objects still active, your list of unallocated memory can be quite big, and if its a small leak, it can take a long time to track down. So as well as storing the filename and line number, I thought, why not store the "this" pointer for objects.
Now when allocation happens again on the same line number and filename, if there is an allocation for the current "this" object matching these, then allocation is happening again on the same object.
There is a problem with this however, loops that allocate will flag as reallocation without deallocation. These can be ignored though if care is taken with the objects that are doing this.
Optimizing C++
I was just randomly googling, can't quite remember what it was, but it was something code related, and I can by this paper on optimising C++.
I finally understand how the cache works and can improve my code to suit it.
iPhone Developer
I awoke this morning to find an email in my inbox from Apple, reminding me that I hadn't finished enrolling for becoming an iPhone Developer yet. Surprised since they hadn't told me I could finish yet, I just assumed that it must have been filtered by my spam filter (must remember to fix that thing).
So since there was an hour to go before work, I quickly followed the instructions, paid for my membership and got an emailing saying that within 24 hours they will get back to me with instructions of how to setup my iPhone to allow development. However upon getting back from work, I was greeted by an email telling me it had all been setup and that I was now able to develop and publish applications for the iPhone.
The setup process was a little annoying, the tutorials aren't fully specific, but I managed, and sometimes it was my fault for not reading them correctly, but they do come with pictures depicting how things should look when it is done correctly, which is very helpful. Finally, I setup one of my iPhone examples to compile and run, and bobs your uncle (which he is quite ironically) it worked. So next weekend I'll start work on porting my chuck norris game as a starter to get use to developing for it.
There are so many things that can be done with an accelerometer that I hadn't thought of, I even found an example on the internet that uses the accelerometer in a MacBook Pro so you can move water about on your screen. Usually its just used to move the needle off the hard drive when there is a suddenly change of gravity. It can also be used to detect seismic movements, or used in conjuction with Expose so you can tap the side of your laptop and shift screens, I probably won't use this, I'm already afraid of smashing the glass screen.
Threading Class
I recently took an interest in multithreading, and during which I came by this great article on Flipcode for a threading class.
C++ 0x Standard
I was reading through the new C++ Standard today, needing a break from the Massively Multiplayer Game Development book I”ve been reading. Some very nice features are being added with the new standard, such as Lambda functions, initializer lists, and finally hash tables to the Standard Template Library.
Const Correctness
Whilst idling in IRC and working on an application, and reading a great book I found in the library (Object Orientated Game Development - from what I’ve read from other places, this one has the best descriptions and examples I’ve seen. Though I haven’t read that many, so there may be better.) I came by some C++ links that are helpful.
The Top 20 C++ Tips of All Time
I’ve always wondered the difference between “const int *pointer” and “const int * const pointer”, the second link gave insight. Not that it matters, I”ve been using it correctly since I started.