common: add ALLOC_CHECK macro that enables attribute alloc_size on GCC that allows to prevent suspicious allocation sizes

This commit is contained in:
Alibek Omarov
2023-12-09 19:00:25 +03:00
parent 20ced857b4
commit 683c4874f8
7 changed files with 12 additions and 9 deletions

View File

@@ -143,7 +143,7 @@ typedef struct ui_enginefuncs_s
void *(*pfnKeyGetState)( const char *name ); // for mlook, klook etc
// engine memory manager
void* (*pfnMemAlloc)( size_t cb, const char *filename, const int fileline );
void* (*pfnMemAlloc)( size_t cb, const char *filename, const int fileline ) ALLOC_CHECK( 1 );
void (*pfnMemFree)( void *mem, const char *filename, const int fileline );
// collect info from engine