Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support AK_MEM_DEBUG version of AK.MemoryMgr.malloc and AK.MemoryMgr.free() #9

Open
mlarouche opened this issue Jun 10, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mlarouche
Copy link
Member

Add support in AK.MemoryMgr to allocate using the debug version if requested

See this block as a reference

#ifdef AK_MEMDEBUG
	#define AkNew( _pool, _what )								new( ( _pool ), AkPoolNewKey(), __FILE__, __LINE__ ) _what
	#define AkAlloc( _pool, _size )								( AK::MemoryMgr::dMalloc( ( _pool ), _size, __FILE__, __LINE__ ) )
	#define AkMalign( _pool, _size, _align )					( AK::MemoryMgr::dMalign( ( _pool ), _size, _align, __FILE__, __LINE__ ) )
	#define AkNewAligned( _pool, _what, _align )				new( ( _pool ), AkPoolNewKey(), ( _align ), __FILE__ , __LINE__ ) _what
	#define AkRealloc( _pool, _pvmem, _size )					( AK::MemoryMgr::dRealloc( ( _pool ), _pvmem, _size, __FILE__, __LINE__ ) )
	#define AkReallocAligned( _pool, _pvmem, _size, _align )	( AK::MemoryMgr::dReallocAligned( ( _pool ), _pvmem, _size, _align, __FILE__, __LINE__ ) )
#else
	#define AkNew( _pool, _what )								new( ( _pool ), AkPoolNewKey() ) _what
	#define AkAlloc( _pool, _size )								( AK::MemoryMgr::Malloc( ( _pool ), _size ) )
	#define AkMalign( _pool, _size, _align )					( AK::MemoryMgr::Malign( ( _pool ), _size, _align ) )
	#define AkNewAligned( _pool, _what, _align )				new( ( _pool ), AkPoolNewKey(), ( _align ) ) _what
	#define AkRealloc( _pool, _pvmem, _size )					( AK::MemoryMgr::Realloc( ( _pool ), _pvmem, _size ) )
	#define AkReallocAligned( _pool, _pvmem, _size, _align )	( AK::MemoryMgr::ReallocAligned( ( _pool ), _pvmem, _size, _align ) )
#endif
@mlarouche mlarouche added enhancement New feature or request good first issue Good for newcomers labels Jun 10, 2023
@mlarouche mlarouche added the help wanted Extra attention is needed label Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant