TeamForbiddenLLC / warfork-qfusion

Warfork is powered by Qfusion a 3D game engine. Qfusion is a fork of id Tech 2, popularly known as the Quake II engine. Qfusion is free and open-source software subject to the terms of the GNU General Public License.
https://warfork.com
105 stars 43 forks source link

feat: introduce scope abstraction #318

Open pollend opened 6 months ago

pollend commented 6 months ago

I want to uncouple the pool from the memory tracking. scopes works similarly in principle but they don't track the memory that is managed by the user.

The general gist is that a scope can take the ownership of a memory similar to a pool, but developer is required to call free on the memory from the pool and not Q_Free. this will introduce a double free where the user frees the memory as well as the scope.

the scope is just to track the lifecycle of some memory associated with some scope.

going forward I would like to omit the tracking from release builds. my plan is to have the tracking available for builds with debug symbols.