lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0711291859330.13075@fbirervta.pbzchgretzou.qr>
Date:	Thu, 29 Nov 2007 19:00:52 +0100 (CET)
From:	Jan Engelhardt <jengelh@...putergmbh.de>
To:	Kyle McMartin <kyle@...artin.ca>
cc:	Daniel Drake <dsd@...too.org>, linux-kernel@...r.kernel.org,
	avuton@...il.com, hancockr@...w.ca, alan@...rguk.ukuu.org.uk,
	andi@...stfloor.org, mrmacman_g4@....com, dean@...tic.org,
	argggh@...phinics.no, shdl@...alwe.fi, vlobanov@...akeasy.net,
	drzeus-list@...eus.cx, strange@....no-ip.org, dm.n9107@...il.com,
	johannes@...solutions.net
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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ