Evince
Evince is a document viewer capable of displaying multiple and single page document formats like PDF and Postscript.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
allocator.h
Go to the documentation of this file.
1 /* Copyright 2015 the unarr project authors (see AUTHORS file).
2  License: LGPLv3 */
3 
4 #ifndef common_allocator_h
5 #define common_allocator_h
6 
7 #ifdef USE_CUSTOM_ALLOCATOR
8 
9 #include <stddef.h>
10 
11 typedef void *(* custom_malloc_fn)(void *opaque, size_t size);
12 typedef void (* custom_free_fn)(void *opaque, void *ptr);
13 
14 void ar_set_custom_allocator(custom_malloc_fn custom_malloc, custom_free_fn custom_free, void *opaque);
15 
16 #define malloc(size) ar_malloc(size)
17 #define calloc(count, size) ar_calloc(count, size)
18 #define free(ptr) ar_free(ptr)
19 
20 #define realloc(ptr, size) _use_malloc_memcpy_free_instead(ptr, size)
21 #define strdup(str) _use_malloc_memcpy_instead(str)
22 
23 #elif !defined(NDEBUG) && defined(_MSC_VER)
24 
25 #include <crtdbg.h>
26 
27 #endif
28 
29 #endif