Commit: 60ee57f899bfe75b7bd2db7f4b0b4b2f8a83441f
Parent: 39681eaf8c3598d9e6cdc12824e8068e87e30543
Author: Szymon Janc <szymon.janc@codecoup.pl>
Committer: Szymon Janc <szymon.janc@codecoup.pl>
Date: 2015-10-30 12:44:19
Tree: 88f710cca3817738b551049218d1cc684362b144

shared: Make new0 abort on failure New is used to allocate small (typically much less than 1 page) chunks and if such allocation fails system is most likely in state where recovery is unlikely. Also by default Linux follows an optimistic memory allocation strategy with OOM killer. Aborting on allocationg failure allows to significantly simplify error paths (which were most likely never tested anyway) and thus makes code easier to understand. btd_malloc name is used as malloc wrapper so that it can be exported by bluetoothd and used also in external plugins.

Diffstat

M src/shared/util.c | 16 ++++++++++++++++
M src/shared/util.h | 14 +++++++++++++-

2 files changed, 29 insertions(+), 1 deletions(-)

View Full Diff | Patch