engine: set malloc like and warn_unused_result attributes on common allocation functions, fs, image and soundlib

This commit is contained in:
Alibek Omarov
2024-09-30 04:00:28 +03:00
parent 953ad98a16
commit 9ee1b32e2d
6 changed files with 91 additions and 39 deletions
+6 -3
View File
@@ -389,10 +389,13 @@ typedef struct ref_api_s
int (*pfnGetStudioModelInterface)( int version, struct r_studio_interface_s **ppinterface, struct engine_studio_api_s *pstudio );
// memory
poolhandle_t (*_Mem_AllocPool)( const char *name, const char *filename, int fileline );
poolhandle_t (*_Mem_AllocPool)( const char *name, const char *filename, int fileline )
WARN_UNUSED_RESULT;
void (*_Mem_FreePool)( poolhandle_t *poolptr, const char *filename, int fileline );
void *(*_Mem_Alloc)( poolhandle_t poolptr, size_t size, qboolean clear, const char *filename, int fileline ) ALLOC_CHECK( 2 );
void *(*_Mem_Realloc)( poolhandle_t poolptr, void *memptr, size_t size, qboolean clear, const char *filename, int fileline ) ALLOC_CHECK( 3 );
void *(*_Mem_Alloc)( poolhandle_t poolptr, size_t size, qboolean clear, const char *filename, int fileline )
ALLOC_CHECK( 2 ) WARN_UNUSED_RESULT;
void *(*_Mem_Realloc)( poolhandle_t poolptr, void *memptr, size_t size, qboolean clear, const char *filename, int fileline )
ALLOC_CHECK( 3 ) WARN_UNUSED_RESULT;
void (*_Mem_Free)( void *data, const char *filename, int fileline );
// library management