OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [conts/] [libmem/] [tests/] [test_alloc_generic.h] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
#ifndef __TEST_ALLOC_GENERIC_H__
2
#define __TEST_ALLOC_GENERIC_H__
3
 
4
enum test_state_title {
5
        TEST_STATE_BEGIN = 0,
6
        TEST_STATE_MIDDLE,
7
        TEST_STATE_END,
8
        TEST_STATE_ERROR
9
};
10
 
11
typedef void (*print_alloc_state_t)(void);
12
typedef void *(*alloc_func_t)(int size);
13
typedef int (*free_func_t)(void *addr);
14
 
15
enum alloc_action {
16
        FREE = 0,
17
        ALLOCATE = 1,
18
};
19
 
20
void get_output_filepaths(FILE **out1, FILE **out2,
21
                          char *alloc_func_name);
22
 
23
int test_alloc_free_random_order(const int MAX_ALLOCATIONS,
24
                                 const int ALLOC_SIZE_MAX,
25
                                 alloc_func_t alloc, free_func_t free,
26
                                 print_alloc_state_t print_allocator_state,
27
                                 FILE *init_state, FILE *exit_state);
28
 
29
#endif /* __TEST_ALLOC_GENERIC_H__ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.