diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2018-11-30 16:30:43 +0000 |
---|---|---|
committer | Michalis Spyrou <michalis.spyrou@arm.com> | 2018-12-03 13:47:53 +0000 |
commit | 323ce0f0b06bca785959913e75e1f51d383c351a (patch) | |
tree | dc3729e19a43d8290285987c51d9799581412c33 /src/runtime/MEMUtils.cpp | |
parent | 08a4517905da959b6e3401cc24f5e2018f9b51ac (diff) | |
download | ComputeLibrary-323ce0f0b06bca785959913e75e1f51d383c351a.tar.gz |
COMPMID-1819 Add option to build library with -fno-exceptions
Change-Id: I3de6bb33746d52f8d8c337ab7776eccee8c205fb
Reviewed-on: https://review.mlplatform.org/328
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-by: Pablo Marquez <pablo.tello@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/MEMUtils.cpp')
-rw-r--r-- | src/runtime/MEMUtils.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/MEMUtils.cpp b/src/runtime/MEMUtils.cpp index a45f9c80c1..be6a3b690d 100644 --- a/src/runtime/MEMUtils.cpp +++ b/src/runtime/MEMUtils.cpp @@ -48,8 +48,10 @@ void parse_mem_info(size_t &total, size_t &free, size_t &buffer) std::stringstream str_stream; str_stream << meminfo_f.rdbuf(); const std::string str = str_stream.str(); +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED try { +#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ std::smatch match; if(std::regex_search(str, match, std::regex("MemTotal: (.*)kB")) && match.size() > 1) { @@ -72,12 +74,14 @@ void parse_mem_info(size_t &total, size_t &free, size_t &buffer) memcache = arm_compute::support::cpp11::stoul(result, nullptr); } free = memfree + (buffer + memcache); +#ifndef ARM_COMPUTE_EXCEPTIONS_DISABLED } catch(std::regex_error &e) { // failed parsing /proc/meminfo // return 0s on all fields } +#endif /* ARM_COMPUTE_EXCEPTIONS_DISABLED */ } #endif // ifndef BARE_METAL } |