syslog-ng source
nondumpable-allocator.c File Reference
#include <sys/mman.h>
#include <stddef.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include "nondumpable-allocator.h"
Include dependency graph for nondumpable-allocator.c:

Classes

struct  Allocation
 

Macros

#define ALLOCATION_HEADER_SIZE   offsetof(Allocation, user_data)
 
#define BUFFER_TO_ALLOCATION(buffer)   ((Allocation *) ((guint8 *) buffer - ALLOCATION_HEADER_SIZE))
 
#define logger_debug(summary, fmt, ...)
 
#define logger_fatal(summary, fmt, ...)
 

Functions

void nondumpable_setlogger (NonDumpableLogger _debug, NonDumpableLogger _fatal)
 
gpointer nondumpable_buffer_alloc (gsize len)
 
void nondumpable_mem_zero (gpointer s, gsize len)
 
void nondumpable_buffer_free (gpointer buffer)
 
gpointer nondumpable_buffer_realloc (gpointer buffer, gsize len)
 
gpointer nondumpable_memcpy (gpointer dest, gpointer src, gsize len)
 

Variables

NonDumpableLogger logger_debug_fn INTERNAL = _silent
 

Macro Definition Documentation

◆ ALLOCATION_HEADER_SIZE

#define ALLOCATION_HEADER_SIZE   offsetof(Allocation, user_data)

◆ BUFFER_TO_ALLOCATION

#define BUFFER_TO_ALLOCATION (   buffer)    ((Allocation *) ((guint8 *) buffer - ALLOCATION_HEADER_SIZE))

◆ logger_debug

#define logger_debug (   summary,
  fmt,
  ... 
)
Value:
{ \
gchar *reason = g_strdup_printf(fmt, __VA_ARGS__); \
logger_debug_fn(summary, reason); \
g_free(reason); \
}

◆ logger_fatal

#define logger_fatal (   summary,
  fmt,
  ... 
)
Value:
{ \
gchar *reason = g_strdup_printf(fmt, __VA_ARGS__); \
logger_fatal_fn(summary, reason); \
g_free(reason); \
}

Function Documentation

◆ nondumpable_buffer_alloc()

gpointer nondumpable_buffer_alloc ( gsize  len)

◆ nondumpable_buffer_free()

void nondumpable_buffer_free ( gpointer  buffer)

◆ nondumpable_buffer_realloc()

gpointer nondumpable_buffer_realloc ( gpointer  buffer,
gsize  len 
)

◆ nondumpable_mem_zero()

void nondumpable_mem_zero ( gpointer  s,
gsize  len 
)

◆ nondumpable_memcpy()

gpointer nondumpable_memcpy ( gpointer  dest,
gpointer  src,
gsize  len 
)

◆ nondumpable_setlogger()

void nondumpable_setlogger ( NonDumpableLogger  _debug,
NonDumpableLogger  _fatal 
)

Variable Documentation

◆ INTERNAL

NonDumpableLogger logger_fatal_fn INTERNAL = _silent