Archive | CPP RSS feed for this section

Using the NDK and JNI to build android applications

25 Aug

When writing applications for android in java, there are often parts that you expected to perform better. It’s not always the algorithm that is to blame. Java has its limits. Even with a JIT compiler it will have more runtime overhead, and a garbage collector will run at times you don’t want it to. We can solve this by moving demanding pieces of our code to C, C++ or assembler.  Continue reading

Memory management in C++ Part 2

29 Jun

While part 1 focussed on avoiding memory leaks, this post will look at memory strategies which optimize speed. While in many cases a normal allocation/reallocation/deallocation scheme works well, there are several instances where this can slow down software considerably. In these cases one of the following strategies can help to improve the performance of your application.

Continue reading

Memory management in C++ Part 1

23 Jan

While scripting and other high level languages often have one way to manage memory, working with a lower level language gives you the ability to choose how to manage each allocated piece of memory. This can be both a blessing and a curse, as one way is not always the best solution for each case, so choosing the best strategy can become hard. This article tries to give an overview of several techniques.

Continue reading