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

Function try_free_region

payloads/libpayload/libc/malloc.c:444–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442}
443
444static void try_free_region(struct align_region_t **prev_link)
445{
446 struct align_region_t *r = *prev_link;
447
448 /* All large regions are immediately free-able. Non-large regions
449 * need to be checked for the fully freed state. */
450 if (!region_is_large(r)) {
451 if (r->free != r->size / r->alignment)
452 return;
453 }
454
455 /* Unlink region from link list. */
456 *prev_link = r->next;
457
458 /* Free the data and metadata. */
459 free(r->start);
460 free(r);
461}
462
463static int free_aligned(void* addr, struct memory_type *type)
464{

Callers 1

free_alignedFunction · 0.85

Calls 2

region_is_largeFunction · 0.85
freeFunction · 0.70

Tested by

no test coverage detected