Module: kamailio
Branch: master
Commit: 0f4058a7ff0abb59785d2d1dd3e65517ab4ceaa4
URL:
https://github.com/kamailio/kamailio/commit/0f4058a7ff0abb59785d2d1dd3e6551…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-10-02T11:01:44+02:00
core: check if status with filter is implemented by memory manager
---
Modified: src/core/mem/pkg.h
Modified: src/core/mem/shm.h
---
Diff:
https://github.com/kamailio/kamailio/commit/0f4058a7ff0abb59785d2d1dd3e6551…
Patch:
https://github.com/kamailio/kamailio/commit/0f4058a7ff0abb59785d2d1dd3e6551…
---
diff --git a/src/core/mem/pkg.h b/src/core/mem/pkg.h
index 9a6b9dac2b1..540ac22ceb0 100644
--- a/src/core/mem/pkg.h
+++ b/src/core/mem/pkg.h
@@ -65,8 +65,14 @@ void pkg_print_manager(void);
#endif
#define pkg_status() _pkg_root.xstatus(_pkg_root.mem_block)
-#define pkg_status_filter(fmatch, fp) \
- _pkg_root.xstatus_filter(_pkg_root.mem_block, fmatch, fp)
+#define pkg_status_filter(fmatch, fp) \
+ do { \
+ if(_pkg_root.xstatus_filter) { \
+ _pkg_root.xstatus_filter(_pkg_root.mem_block, fmatch, fp); \
+ } else { \
+ LM_ERR("pkg status with filter not implemented\n"); \
+ } \
+ while(0)
#define pkg_info(mi) _pkg_root.xinfo(_pkg_root.mem_block, mi)
#define pkg_report(mr) _pkg_root.xreport(_pkg_root.mem_block, mr)
#define pkg_available() _pkg_root.xavailable(_pkg_root.mem_block)
diff --git a/src/core/mem/shm.h b/src/core/mem/shm.h
index 9cdadc10618..6d3a855fa7c 100644
--- a/src/core/mem/shm.h
+++ b/src/core/mem/shm.h
@@ -87,8 +87,14 @@ extern sr_shm_api_t _shm_root;
#endif
#define shm_status() _shm_root.xstatus(_shm_root.mem_block)
-#define shm_status_filter(fmatch, fp) \
- _shm_root.xstatus_filter(_shm_root.mem_block, fmatch, fp)
+#define shm_status_filter(fmatch, fp) \
+ do { \
+ if(_shm_root.xstatus_filter) { \
+ _shm_root.xstatus_filter(_shm_root.mem_block, fmatch, fp); \
+ } else { \
+ LM_ERR("shm status with filter not implemented\n"); \
+ } \
+ while(0)
#define shm_info(mi) _shm_root.xinfo(_shm_root.mem_block, mi)
#define shm_report(mr) _shm_root.xreport(_shm_root.mem_block, mr)
#define shm_available() _shm_root.xavailable(_shm_root.mem_block)