I have this piece of code
#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> int main(){ void *a, *b; a=malloc(16); b=malloc(16); printf("\n block size (for a): %p-%p : %li",b,a,b-a); a=malloc(1024); b=malloc(1024); printf("\n block size (for a): %p-%p : %li",b,a,b-a); ...
Or do you just have to do it and check errno and/or the pointer to see if you succeeded?