From ac81fe8657119c265edcc2f05b3e5b7c5b17ae9f Mon Sep 17 00:00:00 2001 From: Tamas Berghammer Date: Fri, 26 Aug 2016 15:54:59 +0100 Subject: Enable malloc debug using environment variables Previously malloc debug can be enabled only using global settings accessible to the root user only. This CL adds a new option to enable it using environment variables making it possible to use it with pure native (shell) applications on production builds (from shell user) and prepares it for using it from logwrapper on production devices. Remove the old environment variable and property since they are not necessary. Test: Enable malloc debug using environment variable and verify Test: that it only affects the commands launched from the shell. Test: Enable malloc debug using the property variable and verify Test: that it affects all commands. Test: Run all unit tests in 32 bit and 64 bit. Change-Id: Iecb75a3471552f619f196ad550c5f41fcd9ce8e5 --- libc/malloc_debug/tests/malloc_debug_config_tests.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'libc/malloc_debug/tests/malloc_debug_config_tests.cpp') diff --git a/libc/malloc_debug/tests/malloc_debug_config_tests.cpp b/libc/malloc_debug/tests/malloc_debug_config_tests.cpp index 49edabae6..f988124fe 100644 --- a/libc/malloc_debug/tests/malloc_debug_config_tests.cpp +++ b/libc/malloc_debug/tests/malloc_debug_config_tests.cpp @@ -25,8 +25,6 @@ #include "log_fake.h" -extern "C" int property_set(const char*, const char*); - class MallocDebugConfigTest : public ::testing::Test { protected: void SetUp() override { @@ -38,10 +36,9 @@ class MallocDebugConfigTest : public ::testing::Test { std::unique_ptr config; - bool InitConfig(const char* property_value) { + bool InitConfig(const char* options) { config.reset(new Config); - property_set("libc.debug.malloc.options", property_value); - return config->SetFromProperties(); + return config->Set(options); } }; -- cgit v1.2.3