Messages in this thread | | | Date | Thu, 29 Nov 2007 19:00:52 +0100 (CET) | From | Jan Engelhardt <> | Subject | Re: [RFC v2] Documentation about unaligned memory access |
| |
On Nov 29 2007 12:04, Kyle McMartin wrote: > >For example, if you had 4GB of virtual memory, picture it as an >array of bytes, > u8 memory[4096 * (1024 * 1024)]; /* 4G bytes */
uint8_t memory[4096UL * 1024 * 1024];
>Aligned accesses would be accessing this array in this manner, > u16 memory[(4096 * (1024 * 1024)) / sizeof(u16)] /* 2G bytes */ > u32 memory[(4096 * (1024 * 1024)) / sizeof(u32)] /* 1G bytes */ > u64 memory[(4096 * (1024 * 1024)) / sizeof(u64)] /* 512M bytes */
u64 memory[4096UL * 1024 * 1024 / sizeof(u64)] /* 4G too */ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |