Lines Matching full:allocation

4  * Module Name: uttrack - Memory allocation tracking routines (debug only)
14 * Each memory allocation is tracked via a doubly linked list. Each
32 *allocation);
80 * PARAMETERS: size - Size of the allocation
94 struct acpi_debug_mem_block *allocation; in acpi_ut_allocate_and_track() local
105 allocation = in acpi_ut_allocate_and_track()
107 if (!allocation) { in acpi_ut_allocate_and_track()
109 /* Report allocation error */ in acpi_ut_allocate_and_track()
118 acpi_ut_track_allocation(allocation, size, ACPI_MEM_MALLOC, in acpi_ut_allocate_and_track()
121 acpi_os_free(allocation); in acpi_ut_allocate_and_track()
135 return ((void *)&allocation->user_space); in acpi_ut_allocate_and_track()
142 * PARAMETERS: size - Size of the allocation
157 struct acpi_debug_mem_block *allocation; in acpi_ut_allocate_zeroed_and_track() local
168 allocation = in acpi_ut_allocate_zeroed_and_track()
171 if (!allocation) { in acpi_ut_allocate_zeroed_and_track()
173 /* Report allocation error */ in acpi_ut_allocate_zeroed_and_track()
180 status = acpi_ut_track_allocation(allocation, size, in acpi_ut_allocate_zeroed_and_track()
184 acpi_os_free(allocation); in acpi_ut_allocate_zeroed_and_track()
198 return ((void *)&allocation->user_space); in acpi_ut_allocate_zeroed_and_track()
205 * PARAMETERS: allocation - Address of the memory to deallocate
212 * DESCRIPTION: Frees the memory at Allocation
217 acpi_ut_free_and_track(void *allocation, in acpi_ut_free_and_track() argument
223 ACPI_FUNCTION_TRACE_PTR(ut_free, allocation); in acpi_ut_free_and_track()
225 if (NULL == allocation) { in acpi_ut_free_and_track()
232 (((char *)allocation) - in acpi_ut_free_and_track()
246 allocation, debug_block)); in acpi_ut_free_and_track()
254 * PARAMETERS: allocation - Address of allocated memory
258 * 2) Element was found. Returns Allocation parameter.
262 * DESCRIPTION: Searches for an element in the global allocation tracking list.
279 *allocation) in acpi_ut_find_allocation()
292 * assumption that a new allocation usually has a larger address in acpi_ut_find_allocation()
295 while (element > allocation) { in acpi_ut_find_allocation()
306 if (element == allocation) { in acpi_ut_find_allocation()
317 * PARAMETERS: allocation - Address of allocated memory
318 * size - Size of the allocation
326 * DESCRIPTION: Inserts an element into the global allocation tracking list.
331 acpi_ut_track_allocation(struct acpi_debug_mem_block *allocation, in acpi_ut_track_allocation() argument
340 ACPI_FUNCTION_TRACE_PTR(ut_track_allocation, allocation); in acpi_ut_track_allocation()
356 element = acpi_ut_find_allocation(allocation); in acpi_ut_track_allocation()
357 if (element == allocation) { in acpi_ut_track_allocation()
359 "UtTrackAllocation: Allocation (%p) already present in global list!", in acpi_ut_track_allocation()
360 allocation)); in acpi_ut_track_allocation()
366 allocation->size = (u32)size; in acpi_ut_track_allocation()
367 allocation->alloc_type = alloc_type; in acpi_ut_track_allocation()
368 allocation->component = component; in acpi_ut_track_allocation()
369 allocation->line = line; in acpi_ut_track_allocation()
371 acpi_ut_safe_strncpy(allocation->module, (char *)module, in acpi_ut_track_allocation()
380 previous = allocation; in acpi_ut_track_allocation()
383 allocation->next = mem_list->list_head; in acpi_ut_track_allocation()
384 allocation->previous = NULL; in acpi_ut_track_allocation()
386 mem_list->list_head = allocation; in acpi_ut_track_allocation()
390 allocation->next = element->next; in acpi_ut_track_allocation()
391 allocation->previous = element; in acpi_ut_track_allocation()
394 (element->next)->previous = allocation; in acpi_ut_track_allocation()
397 element->next = allocation; in acpi_ut_track_allocation()
409 * PARAMETERS: allocation - Address of allocated memory
416 * DESCRIPTION: Deletes an element from the global allocation tracking list.
421 acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation, in acpi_ut_remove_allocation() argument
439 "Empty allocation list, nothing to free!")); in acpi_ut_remove_allocation()
451 if (allocation->previous) { in acpi_ut_remove_allocation()
452 (allocation->previous)->next = allocation->next; in acpi_ut_remove_allocation()
454 mem_list->list_head = allocation->next; in acpi_ut_remove_allocation()
457 if (allocation->next) { in acpi_ut_remove_allocation()
458 (allocation->next)->previous = allocation->previous; in acpi_ut_remove_allocation()
462 &allocation->user_space, allocation->size)); in acpi_ut_remove_allocation()
466 memset(&allocation->user_space, 0xEA, allocation->size); in acpi_ut_remove_allocation()
554 * Walk the allocation list. in acpi_ut_dump_allocations()