Performance: mark ring buffer do_copy callers always inline
[lttng-ust.git] / liblttng-ust / lttng-ust-elf.c
index c9d2b6b3c406dcb33a8a39dfaab51af7dbe39917..663699b7ce91a5d9febf0d9903b64d042a580782 100644 (file)
@@ -17,6 +17,7 @@
  */
 
 #define _GNU_SOURCE
+#define _LGPL_SOURCE
 #include <helper.h>
 #include <string.h>
 #include <lttng/align.h>
@@ -25,6 +26,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <stdbool.h>
 #include "lttng-tracer-core.h"
 
 #define BUF_LEN        4096
@@ -376,9 +378,9 @@ int lttng_ust_elf_get_memsz(struct lttng_ust_elf *elf, uint64_t *memsz)
                        goto next_loop;
                }
 
-               low_addr = phdr->p_vaddr < low_addr ? phdr->p_vaddr : low_addr;
-               high_addr = phdr->p_vaddr + phdr->p_memsz > high_addr ?
-                               phdr->p_vaddr + phdr->p_memsz : high_addr;
+               low_addr = min_t(uint64_t, low_addr, phdr->p_vaddr);
+               high_addr = max_t(uint64_t, high_addr,
+                               phdr->p_vaddr + phdr->p_memsz);
        next_loop:
                free(phdr);
        }
This page took 0.023599 seconds and 4 git commands to generate.