mirror of
https://github.com/samba-team/samba.git
synced 2025-01-24 02:04:21 +03:00
lib:talloc: Don't optimize the speed test
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>
This commit is contained in:
parent
b6bf9cba80
commit
00d5982da2
@ -42,6 +42,14 @@
|
||||
|
||||
#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;
|
||||
@ -854,6 +862,7 @@ static bool test_unref_reparent(void)
|
||||
/*
|
||||
measure the speed of talloc versus malloc
|
||||
*/
|
||||
static bool test_speed(void) disable_optimization;
|
||||
static bool test_speed(void)
|
||||
{
|
||||
void *ctx = talloc_new(NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user