Skip to content

Commit

Permalink
core: add some more memory logging helper defines to mem.h
Browse files Browse the repository at this point in the history
- add some more memory logging helper defines to mem.h
- PKG_MEM_CRITICAL: output a generic pkg error message with log level critical
- SHM_MEM_CRITICAL: output a generic shm error message with log level critical
- SYS_MEM_ERROR/SYS_MEM_CRITICAL: generic error message for system allocation
  • Loading branch information
henningw committed Dec 23, 2018
1 parent 5667377 commit 753bc81
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/mem/mem.h
Expand Up @@ -195,10 +195,18 @@ int init_shm_mallocs(int force_alloc);
/** generic logging helper for allocation errors in private memory pool/ system */
#ifdef SYS_MALLOC
#define PKG_MEM_ERROR LM_ERR("could not allocate private memory from sys pool\n")
#define PKG_MEM_CRITICAL LM_CRIT("could not allocate private memory from sys pool\n")
#else
#define PKG_MEM_ERROR LM_ERR("could not allocate private memory from pkg pool\n")
#define PKG_MEM_CRITICAL LM_CRIT("could not allocate private memory from pkg pool\n")
#endif

/** generic logging helper for allocation errors in system memory */
#define SYS_MEM_ERROR LM_ERR("could not allocate memory from system\n")
#define SYS_MEM_CRITICAL LM_CRIT("could not allocate memory from system\n")

/** generic logging helper for allocation errors in shared memory pool */
#define SHM_MEM_ERROR LM_ERR("could not allocate shared memory from shm pool\n")
#define SHM_MEM_CRITICAL LM_CRIT("could not allocate shared memory from shm pool\n")

#endif

0 comments on commit 753bc81

Please sign in to comment.