Commit a27be2db authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

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

memory block pointer test.
parent b0d74e6b
...@@ -1166,11 +1166,13 @@ BOOLEAN WINAPI RtlFreeHeap( HANDLE heap, ULONG flags, PVOID ptr ) ...@@ -1166,11 +1166,13 @@ BOOLEAN WINAPI RtlFreeHeap( HANDLE heap, ULONG flags, PVOID ptr )
{ {
ARENA_INUSE *pInUse; ARENA_INUSE *pInUse;
SUBHEAP *subheap; SUBHEAP *subheap;
HEAP *heapPtr = HEAP_GetPtr( heap ); HEAP *heapPtr;
/* Validate the parameters */ /* Validate the parameters */
if (!ptr) return TRUE; /* freeing a NULL ptr isn't an error in Win2k */ if (!ptr) return TRUE; /* freeing a NULL ptr isn't an error in Win2k */
heapPtr = HEAP_GetPtr( heap );
if (!heapPtr) if (!heapPtr)
{ {
RtlSetLastWin32ErrorAndNtStatusFromNtStatus( STATUS_INVALID_HANDLE ); RtlSetLastWin32ErrorAndNtStatusFromNtStatus( STATUS_INVALID_HANDLE );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment