malloc_usable_size(3) - wariua/manpages-ko GitHub Wiki
malloc_usable_size - ํ์์ ํ ๋นํ ๋ฉ๋ชจ๋ฆฌ ๋ธ๋ก์ ํฌ๊ธฐ ์ป๊ธฐ
#include <malloc.h>
size_t malloc_usable_size(void *ptr);
malloc_usable_size()
ํจ์๋ ptr
์ด ๊ฐ๋ฆฌํค๋ ๋ธ๋ก ๋ด์์ ์ฌ์ฉ ๊ฐ๋ฅํ ๋ฐ์ดํธ ์๋ฅผ ๋ฐํํ๋ค. ptr
์ malloc(3)์ด๋ ๊ด๋ จ ํจ์๋ก ํ ๋นํ ๋ฉ๋ชจ๋ฆฌ ๋ธ๋ก์ ๋ํ ํฌ์ธํฐ์ด๋ค.
malloc_usable_size()
๋ ptr
์ด ๊ฐ๋ฆฌํค๋ ํ ๋น ๋ฉ๋ชจ๋ฆฌ ๋ธ๋ก์์ ์ฌ์ฉ ๊ฐ๋ฅํ ๋ฐ์ดํธ ์๋ฅผ ๋ฐํํ๋ค. ptr
์ด NULL์ด๋ฉด 0์ ๋ฐํํ๋ค.
์ด ์ ์์ ์ฌ์ฉํ๋ ์ฉ์ด๋ค์ ๋ํ ์ค๋ช ์ attributes(7)๋ฅผ ๋ณด๋ผ.
์ธํฐํ์ด์ค | ์์ฑ | ๊ฐ |
---|---|---|
malloc_usable_size() |
์ค๋ ๋ ์์ ์ฑ | MT-Safe |
์ด ํจ์๋ GNU ํ์ฅ์ด๋ค.
์ ๋ ฌ๊ณผ ์ต์ ํฌ๊ธฐ ์ ํ ๋๋ฌธ์ malloc_usable_size()
๊ฐ ๋ฐํํ๋ ๊ฐ์ด ํ ๋น ์์ฒญ ํฌ๊ธฐ๋ณด๋ค ํด ์๋ ์๋ค. ์์ฉ์ด ์ด๊ณผ ๋ฐ์ดํธ๋ค์ ์ฐ๊ธฐ๋ฅผ ํด๋ ๋ถ์์ฉ์ด ์๊ธฐ๋ ํ์ง๋ง ์ข์ ํ๋ก๊ทธ๋๋ฐ ๋ฐฉ์์ด ์๋๋ค. ํ ๋น์์ ์ด๊ณผ ๋ฐ์ดํธ์ ์๋ ๊ธฐ๋ฐ ๊ตฌํ์ ๋ฐ๋ผ ๋ฌ๋ผ์ง๋ค.
์ด ํจ์์ ์ฃผ๋ ์ฉ๋๋ ๋๋ฒ๊น ๊ณผ ๋ด์ฑ(introspection)์ด๋ค.
2017-09-15