Typecasting a void pointer to unsigned long in zsmalloc.c

Alex Hogen alex at edt.com
Thu Jan 23 12:58:10 EST 2025


>> Shouldn't there be a special type for doing this type of conversion?

> That type is "unsigned long" :)

Wouldn't "uintptr_t" be a more explicit type for storing pointer addresses as integers? It seems to me it has the advantage of expressing intent better for us human readers. See <linux/types.h>. Yes, it is currently defined as an "unsigned long."


More information about the Kernelnewbies mailing list