Data Structures

In C, the void* data type is used to specify a pointer to any byte positions in memory. The number of bits required differs according to architecture. All common processors (including all those on which Linux runs) use either 32 or 64 bits.

The kernel sources assume that void* and unsigned long have the same number of bits so that they can be mutually converted by means of typecasts without loss of information. This assumption — expressed formally as sizeof(void*) == sizeof(unsigned long) — is, of course, true on all architectures supported by Linux.

Memory management prefers to use variables of type unsigned long instead of void pointers because they are easier to handle and manipulate. Technically, they are both equally valid.

Continue reading here: Breakdown of Addresses in Memory

Was this article helpful?

0 0