If NewSize is 0, then a valid buffer of 0 size is returned. If there is not \r
enough memory remaining to satisfy the request, then NULL is returned.\r
\r
- If the smaller of NewSize and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1),\r
- then ASSERT(). \r
+ If the allocation of the new buffer is successful and the smaller of NewSize and OldSize\r
+ is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().\r
\r
@param PoolType The type of pool to allocate.\r
@param OldSize The size, in bytes, of OldBuffer.\r
{\r
VOID *NewBuffer;\r
\r
- //\r
- // Check the boundary for OldBuffer even if the allocation failure.\r
- //\r
- ASSERT (OldBuffer == NULL || MIN (OldSize, NewSize) <= MAX_ADDRESS - (UINTN) OldBuffer + 1);\r
NewBuffer = InternalAllocateZeroPool (PoolType, NewSize);\r
if (NewBuffer != NULL && OldBuffer != NULL) {\r
CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize));\r
If NewSize is 0, then a valid buffer of 0 size is returned. If there is not \r
enough memory remaining to satisfy the request, then NULL is returned.\r
\r
- If the smaller of NewSize and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1),\r
- then ASSERT(). \r
+ If the allocation of the new buffer is successful and the smaller of NewSize and OldSize\r
+ is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().\r
\r
@param OldSize The size, in bytes, of OldBuffer.\r
@param NewSize The size, in bytes, of the buffer to reallocate.\r
If NewSize is 0, then a valid buffer of 0 size is returned. If there is not \r
enough memory remaining to satisfy the request, then NULL is returned.\r
\r
- If the smaller of NewSize and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1),\r
- then ASSERT(). \r
+ If the allocation of the new buffer is successful and the smaller of NewSize and OldSize\r
+ is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().\r
\r
@param OldSize The size, in bytes, of OldBuffer.\r
@param NewSize The size, in bytes, of the buffer to reallocate.\r
If NewSize is 0, then a valid buffer of 0 size is returned. If there is not \r
enough memory remaining to satisfy the request, then NULL is returned.\r
\r
- If the smaller of NewSize and OldSize is greater than (MAX_ADDRESS - OldBuffer + 1),\r
- then ASSERT(). \r
+ If the allocation of the new buffer is successful and the smaller of NewSize and OldSize\r
+ is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().\r
\r
@param OldSize The size, in bytes, of OldBuffer.\r
@param NewSize The size, in bytes, of the buffer to reallocate.\r