| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Program Files (x86)/Windows Kits/10/Source/10.0.19041.0/ucrt/heap/ |
Upload File : |
//
// msize.cpp
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Implementation of msize().
//
#include <corecrt_internal.h>
#include <malloc.h>
// This function implements the logic of _msize(). It is called only in the
// Release CRT. The Debug CRT has its own implementation of this function.
//
// This function must be marked noinline, otherwise _msize and
// _msize_base will have identical COMDATs, and the linker will fold
// them when calling one from the CRT. This is necessary because _msize
// needs to support users patching in custom implementations.
extern "C" __declspec(noinline) size_t __cdecl _msize_base(void* const block) throw()
{
// Validation section
_VALIDATE_RETURN(block != nullptr, EINVAL, static_cast<size_t>(-1));
return static_cast<size_t>(HeapSize(__acrt_heap, 0, block));
}
// Calculates the size of the specified block in the heap. 'block' must be a
// pointer to a valid block of heap-allocated memory (it must not be nullptr).
//
// This function supports patching and therefore must be marked noinline.
// Both _msize_dbg and _msize_base must also be marked noinline
// to prevent identical COMDAT folding from substituting calls to _msize
// with either other function or vice versa.
extern "C" _CRT_HYBRIDPATCHABLE __declspec(noinline) size_t __cdecl _msize(void* const block)
{
#ifdef _DEBUG
return _msize_dbg(block, _NORMAL_BLOCK);
#else
return _msize_base(block);
#endif
}