[nnkit] Throw bad_alloc on malloc failure (#1624)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Fri, 21 Sep 2018 07:42:10 +0000 (16:42 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Fri, 21 Sep 2018 07:42:10 +0000 (16:42 +0900)
commit493faa1d38f8ecb739dd05c62f29995a0140a8eb
treebadde1062ddbb38a1b024f6ea761ca9caaee47e0
parentbcbe029519158a32d9639d98c02e23ef54fc1e66
[nnkit] Throw bad_alloc on malloc failure (#1624)

tflite backend (for nnsuite conv case) internally uses typed_malloc
method, which wraps std::malloc, which may return nullptr on memory
allocation failure.

This commit revises this method to throw std::bad_alloc on memory
allocation failure (similarly as C++ new) to make it easy to detect
memory allocation failure.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
contrib/nnkit/contrib/nnsuite/conv/tflite/ConvBackend.cpp