C Server-Side SDK
LaunchDarkly SDK
memory.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <stddef.h>
9 
10 #include <launchdarkly/export.h>
11 
13 LD_EXPORT(void *) LDAlloc(const size_t bytes);
15 LD_EXPORT(void) LDFree(void *const buffer);
17 LD_EXPORT(char *) LDStrDup(const char *const string);
19 LD_EXPORT(void *) LDRealloc(void *const buffer, const size_t bytes);
21 LD_EXPORT(void *) LDCalloc(const size_t nmemb, const size_t size);
23 LD_EXPORT(char *) LDStrNDup(const char *const str, const size_t n);
24 
26 LD_EXPORT(void)
28  void *(*const newMalloc)(const size_t),
29  void (*const newFree)(void *const),
30  void *(*const newRealloc)(void *const, const size_t),
31  char *(*const newStrDup)(const char *const),
32  void *(*const newCalloc)(const size_t, const size_t),
33  char *(*const newStrNDup)(const char *const, const size_t));
34 
36 LD_EXPORT(void) LDGlobalInit(void);
LDStrNDup
char * LDStrNDup(const char *const str, const size_t n)
Equivalent to strndup
LDRealloc
void * LDRealloc(void *const buffer, const size_t bytes)
Equivalent to realloc
LDAlloc
void * LDAlloc(const size_t bytes)
Equivalent to malloc
LD_EXPORT
#define LD_EXPORT(x)
Used to ensure only intended symbols are exported in the binaries.
Definition: export.h:10
LDFree
void LDFree(void *const buffer)
Equivalent to free
LDSetMemoryRoutines
void LDSetMemoryRoutines(void *(*const newMalloc)(const size_t), void(*const newFree)(void *const), void *(*const newRealloc)(void *const, const size_t), char *(*const newStrDup)(const char *const), void *(*const newCalloc)(const size_t, const size_t), char *(*const newStrNDup)(const char *const, const size_t))
Set all the memory related functions to be used by the SDK.
LDGlobalInit
void LDGlobalInit(void)
Must be called once before any other API function.
LDCalloc
void * LDCalloc(const size_t nmemb, const size_t size)
Equivalent to calloc
LDStrDup
char * LDStrDup(const char *const string)
Equivalent to strdup
export.h
Public. Configuration of exported symbols.