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:
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));
...
Would give as output:
500
200

Does a function exist in the Linux API which does the same thing?

Thanks