Unreal Engine 4 Scripting with C++ Cookbook
上QQ阅读APP看书,第一时间看更新

Chapter 3. Memory Management and Smart Pointers

In this chapter, we are going to cover the following topics:

  • Unmanaged memory – using malloc()/free()
  • Unmanaged memory – using new/delete
  • Managed memory – using NewObject< > and ConstructObject< >
  • Managed memory – deallocating memory
  • Managed memory – smart pointers (TSharedPtr, TWeakPtr, TAutoPtr) to track an object
  • Using TScopedPointer to track an object
  • Unreal's garbage collection system and UPROPERTY()
  • Forcing garbage collection
  • Breakpoints and stepping through code
  • Finding bugs and using call stacks
  • Using the Profiler to identify hot spots