• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef TEST_OOM_LIB_H
2 #define TEST_OOM_LIB_H
3 
4 #include <stddef.h>
5 
6 void* test_malloc  (size_t      bytes);
7 void* test_realloc (void       *memory,
8                     size_t      bytes);
9 void  test_free    (void       *memory);
10 char* test_strdup  (const char *str);
11 
12 /* returns true on success */
13 typedef int (* TestMemoryFunction)  (void *data);
14 
15 /* returns true on success */
16 int test_oom_handling (TestMemoryFunction  func,
17                        void               *data);
18 
19 /* get number of blocks leaked */
20 int test_get_malloc_blocks_outstanding (void);
21 
22 #endif
23