1
2
3
4
5
6
7
8
9
10
11
12
13
14 #ifndef MCA_MEMHEAP_PTMALLOC_H
15 #define MCA_MEMHEAP_PTMALLOC_H
16
17 #include "oshmem_config.h"
18 #include "oshmem/mca/mca.h"
19 #include "opal/class/opal_list.h"
20 #include "opal/threads/mutex.h"
21 #include "oshmem/mca/memheap/memheap.h"
22 #include "oshmem/mca/memheap/base/base.h"
23 #include "oshmem/mca/spml/spml.h"
24 #include "oshmem/util/oshmem_util.h"
25 #include "opal/class/opal_hash_table.h"
26 #include "opal/mca/btl/btl.h"
27 #include <string.h>
28 #include <sys/types.h>
29 #include <math.h>
30
31 BEGIN_C_DECLS
32
33 #include "malloc_defs.h"
34
35
36
37
38
39
40
41
42
43
44
45
46 struct mca_memheap_ptmalloc_module_t {
47 mca_memheap_base_module_t super;
48 int priority;
49 void *base;
50 size_t cur_size;
51 size_t max_size;
52 size_t max_alloc_size;
53 opal_mutex_t lock;
54 };
55
56 typedef struct mca_memheap_ptmalloc_module_t mca_memheap_ptmalloc_module_t;
57 OSHMEM_DECLSPEC extern mca_memheap_ptmalloc_module_t memheap_ptmalloc;
58
59
60
61
62
63 OSHMEM_DECLSPEC extern int mca_memheap_ptmalloc_module_init(memheap_context_t *);
64 OSHMEM_DECLSPEC extern int mca_memheap_ptmalloc_alloc(size_t, void**);
65 OSHMEM_DECLSPEC extern int mca_memheap_ptmalloc_realloc(size_t, void*, void **);
66 OSHMEM_DECLSPEC extern int mca_memheap_ptmalloc_align(size_t, size_t, void**);
67 OSHMEM_DECLSPEC extern int mca_memheap_ptmalloc_free(void*);
68 OSHMEM_DECLSPEC extern int mca_memheap_ptmalloc_finalize(void);
69
70 END_C_DECLS
71
72 #endif