Results 1 to 1 of 1
Hello,
I made a program for Windows and I'm currently porting it to Linux. In that program, I have a Win32 API function called HeapSize. This function returns the size ...
- 07-11-2008 #1Just Joined!
- Join Date
- Jul 2008
- Posts
- 1
The size of a memory block
Hello,
I made a program for Windows and I'm currently porting it to Linux. In that program, I have a Win32 API function called HeapSize. This function returns the size of a block of memory when passed a pointer. So:
Would give as output:Code:... char *ptr = (char *)malloc(500); printf("%u\n", HeapSize(GetProcessHeap(), 0, ptr)); ptr = (char *)realloc(ptr, 200); printf("%u\n", HeapSize(GetProcessHeap(), 0, ptr)); ...
500
200
Does a function exist in the Linux API which does the same thing?
Thanks


Reply With Quote