[sr-dev] git:master:9ea86b94: core: mem - new functions for pkg/shm - mallocxz() and reallocxf()

Daniel-Constantin Mierla miconda at gmail.com
Tue Aug 8 12:08:11 CEST 2017


Module: kamailio
Branch: master
Commit: 9ea86b94b2e26b21f4e3041e6298fd475797ceb3
URL: https://github.com/kamailio/kamailio/commit/9ea86b94b2e26b21f4e3041e6298fd475797ceb3

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-08-08T10:42:59+02:00

core: mem - new functions for pkg/shm - mallocxz() and reallocxf()

- pkg_mallocxz(size) / shm_mallocxz(size) - same as the corresponding
  malloc function, but the allocated buffer is filled with 0. It is
  equivalent of { p=malloc(size); if(p) memset(p, 0, size); }
- pkg_reallocxf(p, size)/shm_reallocxf(p, size) - same as the
  corresponding realloc functions, but the old pointer is always freed,
  even if the realloc operation fails. The BSDs have reallocf()

---

Modified: src/core/mem/memapi.h
Modified: src/core/mem/pkg.h
Modified: src/core/mem/shm.h

---

Diff:  https://github.com/kamailio/kamailio/commit/9ea86b94b2e26b21f4e3041e6298fd475797ceb3.diff
Patch: https://github.com/kamailio/kamailio/commit/9ea86b94b2e26b21f4e3041e6298fd475797ceb3.patch




More information about the sr-dev mailing list