2 * SPDX-License-Identifier: LGPL-2.1-only
4 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 #ifndef _LTTNG_UST_HELPER_H
8 #define _LTTNG_UST_HELPER_H
12 #include <lttng/ust-arch.h>
15 void *zmalloc(size_t len
)
16 __attribute__((always_inline
));
18 void *zmalloc(size_t len
)
20 return calloc(len
, 1);
23 #define max_t(type, x, y) \
27 __max1 > __max2 ? __max1: __max2; \
30 #define min_t(type, x, y) \
34 __min1 <= __min2 ? __min1: __min2; \
37 #define LTTNG_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
40 * Use of __builtin_return_address(0) sometimes seems to cause stack
41 * corruption on 32-bit PowerPC. Disable this feature on that
42 * architecture for now by always using the NULL value for the ip
45 #if defined(LTTNG_UST_ARCH_PPC) && !defined(LTTNG_UST_ARCH_PPC64)
46 #define LTTNG_UST_CALLER_IP() NULL
48 #define LTTNG_UST_CALLER_IP() __builtin_return_address(0)
51 #endif /* _LTTNG_UST_HELPER_H */
This page took 0.03858 seconds and 4 git commands to generate.