malloc_usable_size

Section: C Library Functions (3)
Updated: 2026-02-08
Index JM Home Page roff page
 

名前

malloc_usable_size - ヒープから確保したメモリーブロックのサイズを取得する  

ライブラリ

標準 C ライブラリ (libc,~-lc)  

書式

#include <malloc.h>

size_t malloc_usable_size(void *_Nullable ptr);
 

説明

This function can be used for diagnostics or statistics about allocations from malloc(3) or a related function.  

返り値

malloc_usable_size() returns a value no less than the size of the block of allocated memory pointed to by ptr. If ptr is NULL, 0 is returned.  

属性

この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース属性値
malloc_usable_size() Thread safetyMT-Safe
 

標準規格

GNU.  

警告

The value returned by malloc_usable_size() may be greater than the requested size of the allocation because of various internal implementation details, none of which the programmer should rely on. This function is intended to only be used for diagnostics and statistics; writing to the excess memory without first calling realloc(3) to resize the allocation is not supported. The returned value is only valid at the time of the call.  

関連項目

malloc(3)


 

Index

名前
ライブラリ
書式
説明
返り値
属性
標準規格
警告
関連項目

This document was created by man2html, using the manual pages.