chsvlib
chsv helper source code

◆ DataSize()

std:: size_t Chusov::Memory::DataSize ( const void *  pData)
noexcept

Returns a size of memory pointed by the specified parameter, in bytes.

Parameters
[in]pDatais a pointer to the buffer of byte size to be retrieved. The buffer must be allocated using the functions of the Chusov::Memory namespace.
Returns
On success the function returns a byte size of the buffer pointed by the parameter. On failure the function returns (size_t) -1. Use the GetLastChsvError to get extended error information.
Remarks
The structure of the memory allocated by the functions of the Chusov::Memory is defined with a header lied just before the pointer returned to the user. This header includes type and size information.