Summary
In this chapter, we learned more about resource management. We learned how to provide a customized memory allocation function to Lua. We also learned how to hold the actual C++ object in a Lua userdata. Finally, we familiarized ourselves with the RAII resource management technique.
In the next chapter, we will explore multithreading when integrating Lua into C++.