Lines Matching refs:malloc_mem_chunk_t
30 typedef struct malloc_mem_chunk_t struct
33 struct malloc_mem_chunk_t *prev; // 上一个结点的指针 argument
34 struct malloc_mem_chunk_t *next; // 下一个结点的指针 argument
35 } malloc_mem_chunk_t; typedef
43 static malloc_mem_chunk_t *malloc_free_list = NULL;
44 static malloc_mem_chunk_t *malloc_free_list_end = NULL; // 空闲链表的末尾结点
53 static void malloc_insert_free_list(malloc_mem_chunk_t *ck);
67 static malloc_mem_chunk_t *malloc_query_free_chunk_bf(uint64_t size) in malloc_query_free_chunk_bf()
76 malloc_mem_chunk_t *ptr = malloc_free_list; in malloc_query_free_chunk_bf()
77 malloc_mem_chunk_t *best = NULL; in malloc_query_free_chunk_bf()
107 static malloc_mem_chunk_t *malloc_query_free_chunk_ff(uint64_t size) in malloc_query_free_chunk_ff()
111 malloc_mem_chunk_t *ptr = malloc_free_list; in malloc_query_free_chunk_ff()
158 malloc_mem_chunk_t *new_ck = (malloc_mem_chunk_t *)brk_managed_addr; in malloc_enlarge()
159 memset(new_ck, 0, sizeof(malloc_mem_chunk_t)); in malloc_enlarge()
179 malloc_mem_chunk_t *ptr = malloc_free_list->next; in malloc_merge_free_chunk()
205 static void malloc_insert_free_list(malloc_mem_chunk_t *ck) in malloc_insert_free_list()
217 malloc_mem_chunk_t *ptr = malloc_free_list; in malloc_insert_free_list()
276 if (size + sizeof(uint64_t) <= sizeof(malloc_mem_chunk_t)) in malloc()
277 size = sizeof(malloc_mem_chunk_t); in malloc()
282 malloc_mem_chunk_t *ck = malloc_query_free_chunk_bf(size); in malloc()
329 if ((int64_t)(ck->length) - size > sizeof(malloc_mem_chunk_t)) in malloc()
332 malloc_mem_chunk_t *new_ck = (malloc_mem_chunk_t *)(((uint64_t)ck) + size); in malloc()
381 malloc_mem_chunk_t *ck = (malloc_mem_chunk_t *)((uint64_t)ptr - sizeof(uint64_t)); in free()