Lines Matching refs:address

216 		Allocate(addr_t address, size_t size)
217 : fAddress(address),
259 Free(addr_t address)
260 : fAddress(address)
290 // Find the first return address outside of the allocator code. Note, that
488 kprintf("address: 0x%p; size: %lu bytes\n",
509 kprintf("address: %p; size: %lu bytes\n", (void *)base,
540 addr_t address = 0;
550 else if (strcmp(argv[i], "address") == 0)
551 address = parse_expression(argv[++i]);
601 && (address == 0 || base == address)) {
605 "address: 0x%08lx; size: %lu bytes; "
631 && (address == 0 || base == address)) {
635 " address: 0x%08lx; size: %lu bytes;"
1399 heap_add_leak_check_info(heap_allocator *heap, addr_t address, size_t allocated,
1402 heap_leak_check_info *info = (heap_leak_check_info *)(address + allocated
1427 addr_t address = firstPage->area->base + firstPage->index * heap->page_size;
1429 heap_add_leak_check_info(heap, address, pageCount * heap->page_size, size);
1431 return (void *)address;
1477 void *address = NULL;
1480 address = page->free_list;
1484 address = (void *)(page->area->base + page->index * heap->page_size
1500 heap_add_leak_check_info(heap, (addr_t)address, bin->element_size, size);
1502 return address;
1536 void *address = NULL;
1549 address = heap_allocate_from_bin(heap, i, size);
1556 address = heap_allocate_from_bin(heap, i, size);
1563 if (address == NULL)
1564 address = heap_raw_alloc(heap, size, alignment);
1571 size, address));
1573 T(Allocate((addr_t)address, size));
1574 if (address == NULL)
1575 return address;
1578 memset(address, 0xcc, size);
1584 if (((uint32 *)address)[1] == 0xdeadbeef)
1585 ((uint32 *)address)[1] = 0xcccccccc;
1588 return address;
1593 heap_free(heap_allocator *heap, void *address)
1595 if (address == NULL)
1603 // smaller than our address to become our only candidate for freeing
1604 if (area->base <= (addr_t)address) {
1605 if ((addr_t)address >= area->base + area->size) {
1606 // none of the other areas can contain the address as the list
1619 // this address does not belong to us
1623 TRACE(("free(): asked to free pointer %p\n", address));
1625 heap_page *page = &area->page_table[((addr_t)address - area->base)
1641 if (((uint32 *)address)[1] == 0xdeadbeef) {
1643 // on this page to make sure this address doesn't exist.
1647 if (temp == address) {
1648 panic("free(): address %p already exists in page free "
1649 "list\n", address);
1657 uint32 *dead = (uint32 *)address;
1663 if (((addr_t)address - area->base - page->index
1666 "element size %" B_PRIu32 "\n", address, bin->element_size);
1670 // add the address to the page free list
1671 *(addr_t *)address = (addr_t)page->free_list;
1672 page->free_list = (addr_t *)address;
1728 T(Free((addr_t)address));
1775 heap_realloc(heap_allocator *heap, void *address, void **newAddress,
1783 // smaller than our address to become our only candidate for
1785 if (area->base <= (addr_t)address) {
1786 if ((addr_t)address >= area->base + area->size) {
1787 // none of the other areas can contain the address as the list
1800 // this address does not belong to us
1804 TRACE(("realloc(address = %p, newSize = %lu)\n", address, newSize));
1806 heap_page *page = &area->page_table[((addr_t)address - area->base)
1850 heap_leak_check_info *info = (heap_leak_check_info *)((addr_t)address
1856 T(Reallocate((addr_t)address, (addr_t)address, newSize));
1857 *newAddress = address;
1868 T(Reallocate((addr_t)address, (addr_t)*newAddress, newSize));
1875 memcpy(*newAddress, address, min_c(maxSize, newSize));
1876 heap_free(heap, address);
1943 void *address = NULL;
1944 area_id heapArea = create_area(name, &address,
1952 heap_add_area(heap, heapArea, (addr_t)address, size);
2054 "If <heap> is given, it is interpreted as the address of the heap to\n"
2063 "If a specific heap address is given, only allocations of this\n"
2068 "[(\"team\" | \"thread\") <id>] [\"caller\" <address>] [\"address\" <address>] [\"stats\"]\n"
2070 "If \"team\", \"thread\", \"caller\", and/or \"address\" is specified as the first\n"
2072 "address or allocated address given in the second argument are printed.\n"
2082 "address of the heap for which to print the allocations.\n", 0);
2091 void *address = NULL;
2092 area_id growHeapArea = create_area("dedicated grow heap", &address,
2101 sGrowHeap = heap_create_allocator("grow", (addr_t)address,
2120 area_id vipHeapArea = create_area("VIP heap", &address,
2128 sVIPHeap = heap_create_allocator("VIP heap", (addr_t)address,
2248 void *address = NULL;
2249 area_id allocationArea = create_area("memalign area", &address,
2257 area_allocation_info *info = (area_allocation_info *)address;
2260 info->base = address;
2265 address = (void *)((addr_t)address + sizeof(area_allocation_info));
2267 address = (void *)ROUNDUP((addr_t)address, alignment);
2268 ASSERT((addr_t)address % alignment == 0);
2269 ASSERT((addr_t)address + size - 1 < (addr_t)info + areaSize - 1);
2275 info->allocation_base = address;
2278 memset(address, 0xcc, size);
2280 return address;
2340 free_etc(void *address, uint32 flags)
2343 heap_free(sVIPHeap, address);
2345 free(address);
2357 free(void *address)
2367 if (heap_free(heap, address) == B_OK) {
2376 if (heap_free(sGrowHeap, address) == B_OK)
2380 if (heap_free(sVIPHeap, address) == B_OK)
2385 area_id area = area_for(address);
2387 area_allocation_info *info = (area_allocation_info *)areaInfo.address;
2391 && info->size == areaInfo.size && info->base == areaInfo.address
2400 panic("free(): free failed for address %p\n", address);
2405 realloc_etc(void *address, size_t newSize, uint32 flags)
2412 if (address == NULL)
2416 free_etc(address, flags);
2424 if (heap_realloc(heap, address, &newAddress, newSize, flags) == B_OK) {
2433 if (heap_realloc(sGrowHeap, address, &newAddress, newSize, flags) == B_OK)
2438 area_id area = area_for(address);
2440 area_allocation_info *info = (area_allocation_info *)areaInfo.address;
2444 && info->size == areaInfo.size && info->base == areaInfo.address
2454 return address;
2465 memcpy(newAddress, address, min_c(newSize, info->allocation_size));
2473 panic("realloc(): failed to realloc address %p to size %lu\n", address,
2480 realloc(void *address, size_t newSize)
2482 return realloc_etc(address, newSize, 0);
2495 void *address = malloc(numElements * size);
2496 if (address != NULL)
2497 memset(address, 0, numElements * size);
2499 return address;