Make HeapFree(NULL) case faster by retrieving heap pointer after the

memory block pointer test.
This commit is contained in:
Dmitry Timoshkov 2005-01-24 11:27:27 +00:00 committed by Alexandre Julliard
parent b0d74e6bf3
commit a27be2db55
1 changed files with 3 additions and 1 deletions

View File

@ -1166,11 +1166,13 @@ BOOLEAN WINAPI RtlFreeHeap( HANDLE heap, ULONG flags, PVOID ptr )
{
ARENA_INUSE *pInUse;
SUBHEAP *subheap;
HEAP *heapPtr = HEAP_GetPtr( heap );
HEAP *heapPtr;
/* Validate the parameters */
if (!ptr) return TRUE; /* freeing a NULL ptr isn't an error in Win2k */
heapPtr = HEAP_GetPtr( heap );
if (!heapPtr)
{
RtlSetLastWin32ErrorAndNtStatusFromNtStatus( STATUS_INVALID_HANDLE );