uttrack.c (250838) | uttrack.c (272444) |
---|---|
1/****************************************************************************** 2 * 3 * Module Name: uttrack - Memory allocation tracking routines (debug only) 4 * 5 *****************************************************************************/ 6 7/* | 1/****************************************************************************** 2 * 3 * Module Name: uttrack - Memory allocation tracking routines (debug only) 4 * 5 *****************************************************************************/ 6 7/* |
8 * Copyright (C) 2000 - 2013, Intel Corp. | 8 * Copyright (C) 2000 - 2014, Intel Corp. |
9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions, and the following disclaimer, 16 * without modification. --- 129 unchanged lines hidden (view full) --- 146 UINT32 Component, 147 const char *Module, 148 UINT32 Line) 149{ 150 ACPI_DEBUG_MEM_BLOCK *Allocation; 151 ACPI_STATUS Status; 152 153 | 9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions, and the following disclaimer, 16 * without modification. --- 129 unchanged lines hidden (view full) --- 146 UINT32 Component, 147 const char *Module, 148 UINT32 Line) 149{ 150 ACPI_DEBUG_MEM_BLOCK *Allocation; 151 ACPI_STATUS Status; 152 153 |
154 Allocation = AcpiUtAllocate (Size + sizeof (ACPI_DEBUG_MEM_HEADER), 155 Component, Module, Line); | 154 /* Check for an inadvertent size of zero bytes */ 155 156 if (!Size) 157 { 158 ACPI_WARNING ((Module, Line, 159 "Attempt to allocate zero bytes, allocating 1 byte")); 160 Size = 1; 161 } 162 163 Allocation = AcpiOsAllocate (Size + sizeof (ACPI_DEBUG_MEM_HEADER)); |
156 if (!Allocation) 157 { | 164 if (!Allocation) 165 { |
166 /* Report allocation error */ 167 168 ACPI_WARNING ((Module, Line, 169 "Could not allocate size %u", (UINT32) Size)); 170 |
|
158 return (NULL); 159 } 160 161 Status = AcpiUtTrackAllocation (Allocation, Size, 162 ACPI_MEM_MALLOC, Component, Module, Line); 163 if (ACPI_FAILURE (Status)) 164 { 165 AcpiOsFree (Allocation); --- 33 unchanged lines hidden (view full) --- 199 UINT32 Component, 200 const char *Module, 201 UINT32 Line) 202{ 203 ACPI_DEBUG_MEM_BLOCK *Allocation; 204 ACPI_STATUS Status; 205 206 | 171 return (NULL); 172 } 173 174 Status = AcpiUtTrackAllocation (Allocation, Size, 175 ACPI_MEM_MALLOC, Component, Module, Line); 176 if (ACPI_FAILURE (Status)) 177 { 178 AcpiOsFree (Allocation); --- 33 unchanged lines hidden (view full) --- 212 UINT32 Component, 213 const char *Module, 214 UINT32 Line) 215{ 216 ACPI_DEBUG_MEM_BLOCK *Allocation; 217 ACPI_STATUS Status; 218 219 |
207 Allocation = AcpiUtAllocateZeroed (Size + sizeof (ACPI_DEBUG_MEM_HEADER), 208 Component, Module, Line); | 220 /* Check for an inadvertent size of zero bytes */ 221 222 if (!Size) 223 { 224 ACPI_WARNING ((Module, Line, 225 "Attempt to allocate zero bytes, allocating 1 byte")); 226 Size = 1; 227 } 228 229 Allocation = AcpiOsAllocateZeroed (Size + sizeof (ACPI_DEBUG_MEM_HEADER)); |
209 if (!Allocation) 210 { 211 /* Report allocation error */ 212 213 ACPI_ERROR ((Module, Line, 214 "Could not allocate size %u", (UINT32) Size)); 215 return (NULL); 216 } --- 64 unchanged lines hidden (view full) --- 281 Status = AcpiUtRemoveAllocation (DebugBlock, 282 Component, Module, Line); 283 if (ACPI_FAILURE (Status)) 284 { 285 ACPI_EXCEPTION ((AE_INFO, Status, "Could not free memory")); 286 } 287 288 AcpiOsFree (DebugBlock); | 230 if (!Allocation) 231 { 232 /* Report allocation error */ 233 234 ACPI_ERROR ((Module, Line, 235 "Could not allocate size %u", (UINT32) Size)); 236 return (NULL); 237 } --- 64 unchanged lines hidden (view full) --- 302 Status = AcpiUtRemoveAllocation (DebugBlock, 303 Component, Module, Line); 304 if (ACPI_FAILURE (Status)) 305 { 306 ACPI_EXCEPTION ((AE_INFO, Status, "Could not free memory")); 307 } 308 309 AcpiOsFree (DebugBlock); |
289 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p freed\n", Allocation)); | 310 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p freed (block %p)\n", 311 Allocation, DebugBlock)); |
290 return_VOID; 291} 292 293 294/******************************************************************************* 295 * 296 * FUNCTION: AcpiUtFindAllocation 297 * --- 463 unchanged lines hidden --- | 312 return_VOID; 313} 314 315 316/******************************************************************************* 317 * 318 * FUNCTION: AcpiUtFindAllocation 319 * --- 463 unchanged lines hidden --- |