typedef int thing_t; ... thing_t *foo; // code foo = malloc(sizeof(thing_t));
typedef int thing_t; ... thing_t *foo_internal; thing_wrapper_t *foo; // code foo = malloc(sizeof(thing_t));
foo = malloc(sizeof(*foo));
This, on the other hand, always allocates one object of foo's pointed-to-size, whatever its type:
typedef struct { int value; } thing_t;
int *foo; foo = malloc(sizeof(*foo));