summaryrefslogtreecommitdiff
path: root/testOOMlib.h
blob: fff148f76f8c6491688401cd311b45ebe8f480aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef TEST_OOM_LIB_H
#define TEST_OOM_LIB_H

#include <stddef.h>

void* test_malloc  (size_t      bytes);
void* test_realloc (void       *memory,
                    size_t      bytes);
void  test_free    (void       *memory);
char* test_strdup  (const char *str);

/* returns true on success */
typedef int (* TestMemoryFunction)  (void *data);

/* returns true on success */
int test_oom_handling (TestMemoryFunction  func,
                       void               *data);

/* get number of blocks leaked */
int test_get_malloc_blocks_outstanding (void);

#endif