MCPcopy Create free account
hub / github.com/coreboot/coreboot / free

Function free

src/lib/malloc.c:72–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72void free(void *ptr)
73{
74 if (ptr == NULL)
75 return;
76
77 if (ptr < (void *)&_heap || ptr >= free_mem_end_ptr) {
78 printk(BIOS_WARNING, "Pointer passed to %s is not "
79 "pointing to the heap\n", __func__);
80 return;
81 }
82
83 /*
84 * Rewind the heap pointer to the end of heap
85 * before the last successful malloc().
86 */
87 if (ptr == free_last_alloc_ptr) {
88 free_mem_ptr = free_last_alloc_ptr;
89 free_last_alloc_ptr = NULL;
90 }
91}

Callers 15

fill_blt_bufferFunction · 0.70
append_specific_configFunction · 0.70
nhlt_free_resourcesFunction · 0.70
free_fn_dataFunction · 0.70
gcov_closeFunction · 0.70
mainboard_earlyFunction · 0.50
variant_configure_padsFunction · 0.50
variant_configure_padsFunction · 0.50
variant_configure_padsFunction · 0.50
mainboard_earlyFunction · 0.50
mainboard_initFunction · 0.50

Calls 1

printkFunction · 0.50

Tested by 15

teardown_acpigenFunction · 0.40
test_imd_create_emptyFunction · 0.40
test_imd_recoverFunction · 0.40
test_imd_limit_sizeFunction · 0.40
test_imd_lockdownFunction · 0.40
test_imd_region_usedFunction · 0.40
test_imd_entry_addFunction · 0.40
test_imd_entry_findFunction · 0.40
test_imd_entry_atFunction · 0.40