Lines Matching refs:ptr
383 static void free_to_os(void* ptr, size_t size) { in free_to_os() argument
384 DEBUG_ASSERT(IS_PAGE_ALIGNED(ptr)); in free_to_os()
386 heap_page_free(ptr, size >> PAGE_SIZE_SHIFT); in free_to_os()
468 static void check_free_fill(void* ptr, size_t size) { in check_free_fill() argument
473 uint8_t byte = ((uint8_t*)ptr)[i]; in check_free_fill()
477 hexdump8(ptr, size); in check_free_fill()
751 void* ptr[16]; in cmpct_test() local
753 ptr[0] = cmpct_alloc(8); in cmpct_test()
754 ptr[1] = cmpct_alloc(32); in cmpct_test()
755 ptr[2] = cmpct_alloc(7); in cmpct_test()
757 ptr[3] = cmpct_alloc(0); in cmpct_test()
758 ptr[4] = cmpct_alloc(98713); in cmpct_test()
759 ptr[5] = cmpct_alloc(16); in cmpct_test()
761 cmpct_free(ptr[5]); in cmpct_test()
762 cmpct_free(ptr[1]); in cmpct_test()
763 cmpct_free(ptr[3]); in cmpct_test()
764 cmpct_free(ptr[0]); in cmpct_test()
765 cmpct_free(ptr[4]); in cmpct_test()
766 cmpct_free(ptr[2]); in cmpct_test()
774 ptr[i] = 0; in cmpct_test()
784 if (ptr[index]) { in cmpct_test()
786 cmpct_free(ptr[index]); in cmpct_test()
787 ptr[index] = 0; in cmpct_test()
790 ptr[index] = cmpct_memalign((unsigned int)rand() % 32768, align); in cmpct_test()
793 DEBUG_ASSERT(((addr_t)ptr[index] % align) == 0); in cmpct_test()
798 if (ptr[i]) { in cmpct_test()
799 cmpct_free(ptr[i]); in cmpct_test()
1085 void* ptr = NULL; in heap_grow() local
1092 ptr = os_alloc; in heap_grow()
1094 DEBUG_ASSERT_MSG(IS_PAGE_ALIGNED(ptr), in heap_grow()
1095 "0x%zx bytes @%p", size, ptr); in heap_grow()
1097 "0x%zx bytes @%p", size, ptr); in heap_grow()
1109 if (ptr == NULL) { in heap_grow()
1110 ptr = heap_page_alloc(size >> PAGE_SIZE_SHIFT); in heap_grow()
1111 if (ptr == NULL) { in heap_grow()
1114 LTRACEF("Growing heap by 0x%zx bytes, new ptr %p\n", size, ptr); in heap_grow()
1118 add_to_heap(ptr, size); in heap_grow()