• Home
  • Raw
  • Download

Lines Matching refs:p

72    struct block_allocator_chunk* p;  in allocate_new_chunk()  local
77 p = VG_(malloc)("drd.bitmap.bac", in allocate_new_chunk()
78 sizeof(*p) + NODES_PER_CHUNCK * s_bm2_node_size); in allocate_new_chunk()
79 tl_assert(p); in allocate_new_chunk()
80 p->next = s_first; in allocate_new_chunk()
82 p->next->prev = p; in allocate_new_chunk()
83 s_first = p; in allocate_new_chunk()
84 p->prev = 0; in allocate_new_chunk()
85 p->nallocated = 0; in allocate_new_chunk()
86 p->data = (char*)p + sizeof(*p); in allocate_new_chunk()
87 tl_assert(p->data); in allocate_new_chunk()
88 p->data_end = (char*)(p->data) + NODES_PER_CHUNCK * s_bm2_node_size; in allocate_new_chunk()
89 p->first_free = p->data; in allocate_new_chunk()
92 *(void**)((char*)(p->data) + i * s_bm2_node_size) in allocate_new_chunk()
93 = (char*)(p->data) + (i + 1) * s_bm2_node_size; in allocate_new_chunk()
96 *(void**)((char*)(p->data) + i * s_bm2_node_size) = NULL; in allocate_new_chunk()
98 return p; in allocate_new_chunk()
102 static void free_chunk(struct block_allocator_chunk* const p) in free_chunk() argument
104 tl_assert(p); in free_chunk()
105 tl_assert(p->nallocated == 0); in free_chunk()
107 if (p == s_first) in free_chunk()
108 s_first = p->next; in free_chunk()
109 else if (p->prev) in free_chunk()
110 p->prev->next = p->next; in free_chunk()
111 if (p->next) in free_chunk()
112 p->next->prev = p->prev; in free_chunk()
113 VG_(free)(p); in free_chunk()
131 struct block_allocator_chunk* p; in DRD_() local
138 for (p = s_first; p; p = p->next) in DRD_()
140 if (p->first_free) in DRD_()
144 p->nallocated++; in DRD_()
145 result = p->first_free; in DRD_()
146 p->first_free = *(void**)(p->first_free); in DRD_()
158 struct block_allocator_chunk* p; in DRD_() local
163 for (p = s_first; p; p = p->next) { in DRD_()
164 if (p->data <= bm2 && bm2 < p->data_end) { in DRD_()
166 tl_assert(((char*)bm2 - (char*)(p->data)) % s_bm2_node_size == 0); in DRD_()
167 *(void**)bm2 = p->first_free; in DRD_()
168 p->first_free = bm2; in DRD_()
169 tl_assert(p->nallocated >= 1); in DRD_()
170 if (--(p->nallocated) == 0) in DRD_()
171 free_chunk(p); in DRD_()