This source file includes following definitions.
- ompi_osc_pt2pt_pending_frag_create
- ompi_osc_pt2pt_pending_frag_destroy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #ifndef OSC_PT2PT_PENDING_FRAG_H
21 #define OSC_PT2PT_PENDING_FRAG_H
22
23
24 struct ompi_osc_pt2pt_pending_frag_t {
25 opal_list_item_t super;
26
27
28
29
30 ompi_osc_pt2pt_frag_header_t *header;
31 };
32 typedef struct ompi_osc_pt2pt_pending_frag_t ompi_osc_pt2pt_pending_frag_t;
33 OBJ_CLASS_DECLARATION(ompi_osc_pt2pt_pending_frag_t);
34
35
36
37
38 static inline ompi_osc_pt2pt_pending_frag_t*
39 ompi_osc_pt2pt_pending_frag_create(ompi_osc_pt2pt_module_t *module,
40 void *ptr,
41 size_t size)
42 {
43 size_t total_size = sizeof(ompi_osc_pt2pt_pending_frag_t) + size;
44 ompi_osc_pt2pt_pending_frag_t *ret =
45 (ompi_osc_pt2pt_pending_frag_t*) malloc(total_size);
46 if (NULL == ret) return NULL;
47
48 OBJ_CONSTRUCT(&ret, ompi_osc_pt2pt_pending_frag_t);
49 memcpy(ret->header, ptr, size);
50
51 return ret;
52 }
53
54
55
56
57
58 static inline int
59 ompi_osc_pt2pt_pending_frag_destroy(ompi_osc_pt2pt_module_t *module,
60 ompi_osc_pt2pt_pending_frag_t* frag)
61 {
62 OBJ_DESTRUCT(&frag);
63 free(frag);
64
65 return OMPI_SUCCESS;
66 }
67
68 #endif