#include <rosrt/malloc_wrappers.h>
#include <ros/assert.h>
#include <ros/atomic.h>
#include <boost/thread.hpp>
#include <iostream>
#include <dlfcn.h>
Go to the source code of this file.
Namespaces | |
namespace | rosrt |
namespace | rosrt::detail |
Defines | |
#define | HAS_TLS_KW 1 |
#define | STATIC_TLS_KW __thread |
#define | UPDATE_ALLOC_INFO(result, size, type) |
Typedefs | |
typedef void *(* | CallocType )(size_t nmemb, size_t size) |
typedef void(* | FreeType )(void *ptr) |
typedef void *(* | MallocType )(size_t size) |
typedef void *(* | MemalignType )(size_t boundary, size_t size) |
typedef int(* | PosixMemalignType )(void **memptr, size_t alignment, size_t size) |
typedef void *(* | ReallocType )(void *ptr, size_t size) |
Functions | |
void * | __libc_calloc (size_t nmemb, size_t size) |
void | __libc_free (void *ptr) |
void * | __libc_malloc (size_t size) |
void * | __libc_memalign (size_t boundary, size_t size) |
void * | __libc_realloc (void *ptr, size_t size) |
void * | calloc (size_t nmemb, size_t size) |
void | free (void *ptr) |
AllocInfo | rosrt::getThreadAllocInfo () |
void * | malloc (size_t size) |
void * | memalign (size_t boundary, size_t size) |
static void * | nullCalloc (size_t nmemb, size_t size) |
int | posix_memalign (void **ptr, size_t alignment, size_t size) |
void * | realloc (void *ptr, size_t size) |
void | rosrt::resetThreadAllocInfo () |
void | rosrt::setThreadBreakOnAllocOrFree (bool b) |
Variables | |
STATIC_TLS_KW bool | rosrt::detail::g_break_on_alloc_or_free = false |
STATIC_TLS_KW uint64_t | rosrt::detail::g_callocs = 0 |
STATIC_TLS_KW uint64_t | rosrt::detail::g_frees = 0 |
STATIC_TLS_KW uint64_t | rosrt::detail::g_mallocs = 0 |
STATIC_TLS_KW uint64_t | rosrt::detail::g_memaligns = 0 |
STATIC_TLS_KW uint64_t | rosrt::detail::g_reallocs = 0 |
STATIC_TLS_KW uint64_t | rosrt::detail::g_total_memory_allocated = 0 |
STATIC_TLS_KW uint64_t | rosrt::detail::g_total_ops = 0 |
#define HAS_TLS_KW 1 |
Definition at line 52 of file malloc.cpp.
#define STATIC_TLS_KW __thread |
Definition at line 51 of file malloc.cpp.
#define UPDATE_ALLOC_INFO | ( | result, | |
size, | |||
type | |||
) |
if (result) \ { \ rosrt::detail::g_total_memory_allocated += size; \ } \ \ ++rosrt::detail::g_##type; \ ++rosrt::detail::g_total_ops; \ \ if (rosrt::detail::g_break_on_alloc_or_free) \ { \ std::cerr << "Issuing break due to break_on_alloc_or_free being set" << std::endl; \ ROS_ISSUE_BREAK(); \ }
Definition at line 210 of file malloc.cpp.
typedef void*(* CallocType)(size_t nmemb, size_t size) |
Definition at line 203 of file malloc.cpp.
typedef void(* FreeType)(void *ptr) |
Definition at line 207 of file malloc.cpp.
typedef void*(* MallocType)(size_t size) |
Definition at line 202 of file malloc.cpp.
typedef void*(* MemalignType)(size_t boundary, size_t size) |
Definition at line 205 of file malloc.cpp.
typedef int(* PosixMemalignType)(void **memptr, size_t alignment, size_t size) |
Definition at line 206 of file malloc.cpp.
typedef void*(* ReallocType)(void *ptr, size_t size) |
Definition at line 204 of file malloc.cpp.
void* __libc_calloc | ( | size_t | nmemb, |
size_t | size | ||
) |
Definition at line 331 of file malloc.cpp.
void __libc_free | ( | void * | ptr | ) |
Definition at line 304 of file malloc.cpp.
void* __libc_malloc | ( | size_t | size | ) |
Definition at line 256 of file malloc.cpp.
void* __libc_memalign | ( | size_t | boundary, |
size_t | size | ||
) |
Definition at line 288 of file malloc.cpp.
void* __libc_realloc | ( | void * | ptr, |
size_t | size | ||
) |
Definition at line 272 of file malloc.cpp.
void* calloc | ( | size_t | nmemb, |
size_t | size | ||
) |
Definition at line 315 of file malloc.cpp.
void free | ( | void * | ptr | ) |
Definition at line 293 of file malloc.cpp.
void* malloc | ( | size_t | size | ) |
Definition at line 245 of file malloc.cpp.
void* memalign | ( | size_t | boundary, |
size_t | size | ||
) |
Definition at line 277 of file malloc.cpp.
static void* nullCalloc | ( | size_t | nmemb, |
size_t | size | ||
) | [static] |
Definition at line 310 of file malloc.cpp.
int posix_memalign | ( | void ** | ptr, |
size_t | alignment, | ||
size_t | size | ||
) |
Definition at line 336 of file malloc.cpp.
void* realloc | ( | void * | ptr, |
size_t | size | ||
) |
Definition at line 261 of file malloc.cpp.