| title | _msize | Microsoft Docs | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ms.custom | ||||||||||||||
| ms.date | 11/04/2016 | |||||||||||||
| ms.reviewer | ||||||||||||||
| ms.suite | ||||||||||||||
| ms.technology |
|
|||||||||||||
| ms.tgt_pltfrm | ||||||||||||||
| ms.topic | article | |||||||||||||
| apiname |
|
|||||||||||||
| apilocation |
|
|||||||||||||
| apitype | DLLExport | |||||||||||||
| f1_keywords |
|
|||||||||||||
| dev_langs |
|
|||||||||||||
| helpviewer_keywords |
|
|||||||||||||
| ms.assetid | 02b1f89e-d0d7-4f12-938a-9eeba48a0f88 | |||||||||||||
| caps.latest.revision | 12 | |||||||||||||
| author | corob-msft | |||||||||||||
| ms.author | corob | |||||||||||||
| manager | ghogen | |||||||||||||
| translation.priority.ht |
|
Returns the size of a memory block allocated in the heap.
size_t _msize(
void *memblock
);
memblock
Pointer to the memory block.
_msize returns the size (in bytes) as an unsigned integer.
The _msize function returns the size, in bytes, of the memory block allocated by a call to calloc, malloc, or realloc.
When the application is linked with a debug version of the C run-time libraries, _msize resolves to _msize_dbg. For more information about how the heap is managed during the debugging process, see The CRT Debug Heap.
This function validates its parameter. If memblock is a null pointer, _msize invokes an invalid parameter handler, as described in Parameter Validation. If the error is handled, the function sets errno to EINVAL and returns -1.
| Routine | Required header |
|---|---|
_msize |
<malloc.h> |
For more compatibility information, see Compatibility in the Introduction.
All versions of the C run-time libraries.
See the example for realloc.