From 14f2411e9bdf5e9cd3f37036b7b6d62a4ee01437 Mon Sep 17 00:00:00 2001 From: Michael Barker Date: Sat, 23 Apr 2016 19:19:50 +1200 Subject: [PATCH] [C++]: Disable bounds checks for release builds of media driver. --- aeron-driver/src/main/cpp/CMakeLists.txt | 2 ++ aeron-driver/src/main/cpp/status/SystemCounters.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/aeron-driver/src/main/cpp/CMakeLists.txt b/aeron-driver/src/main/cpp/CMakeLists.txt index 21864a4b5b..57e7ce86e2 100644 --- a/aeron-driver/src/main/cpp/CMakeLists.txt +++ b/aeron-driver/src/main/cpp/CMakeLists.txt @@ -50,6 +50,8 @@ SET(HEADERS add_library(aeron_driver ${SOURCE} ${HEADERS}) add_executable(MediaDriver MediaDriverMain.cpp) +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDISABLE_BOUNDS_CHECKS") + target_link_libraries( aeron_driver aeron_client diff --git a/aeron-driver/src/main/cpp/status/SystemCounters.h b/aeron-driver/src/main/cpp/status/SystemCounters.h index ae73df65cc..196ed6699b 100644 --- a/aeron-driver/src/main/cpp/status/SystemCounters.h +++ b/aeron-driver/src/main/cpp/status/SystemCounters.h @@ -17,6 +17,8 @@ #ifndef AERON_SYSTEMCOUNTERS_H #define AERON_SYSTEMCOUNTERS_H +#include + #include #include #include @@ -43,7 +45,7 @@ class SystemCounters SOURCEINFO); } - counts[i++] = descriptor.newCounter(counterManager); + counts[descriptor.id()] = descriptor.newCounter(counterManager); } }