O'Reilly logo

Android NDK Game Development Cookbook by Viktor Latypov, Sergey Kosarevsky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing memory using reference counting

When working in the native code environment, every memory allocation event is handled by the developer. Tracking all the allocations in a multithreaded environment becomes notoriously difficult. The C++ language provides a way to avoid manual object deallocation using smart pointers. Since we are developing mobile applications, we cannot afford to use the whole Boost library just to include smart pointers.

Note

You can use the Boost library with Android NDK. The main two reasons we avoid it in our small examples are as follows: a drastically increased compilation time and the desire for showing how basic things can be implemented yourself. If your project already includes Boost, you are advised to use smart ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required