If the speed test gets optimized, the malloc() and free() might be
replaced by stack allocations.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
#include "talloc_testsuite.h"
+#ifndef disable_optimization
+#if __has_attribute(optimize)
+#define disable_optimization __attribute__((optimize("O0")))
+#else /* disable_optimization */
+#define disable_optimization
+#endif
+#endif /* disable_optimization */
+
static struct timeval private_timeval_current(void)
{
struct timeval tv;
/*
measure the speed of talloc versus malloc
*/
+static bool test_speed(void) disable_optimization;
static bool test_speed(void)
{
void *ctx = talloc_new(NULL);