v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "User talk:Belal/Memory research"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(Created page with '==Notes, string alignment== "the ints are two bytes each, yet the string starts at offset 0x8, implying something in it requires four-byte alignment" - in almost all cases, point…')
 
m
 
Line 1: Line 1:
 
==Notes, string alignment==
 
==Notes, string alignment==
"the ints are two bytes each, yet the string starts at offset 0x8, implying something in it requires four-byte alignment" - in almost all cases, pointers are aligned to 32-bit boundaries; failure to align a pointer could result in either significant performance degradation or an outright crash (depending on the CPU in question), so all sane compilers force them to be DWORD-aligned. --[[User:Quietust|Quietust]] 22:46, 22 February 2010 (UTC)
+
"the ints are two bytes each, yet the string starts at offset 0x8, implying something in it requires four-byte alignment" - in almost all cases, pointers are aligned to 32-bit boundaries; failure to align a pointer could result in either significant performance degradation or an outright crash (depending on the CPU in question), so all sane compilers force them to be DWORD-aligned. Also, the integer types are almost certainly "short", as "int" is almost always 32 bits wide. --[[User:Quietust|Quietust]] 22:46, 22 February 2010 (UTC)

Latest revision as of 22:49, 22 February 2010

Notes, string alignment[edit]

"the ints are two bytes each, yet the string starts at offset 0x8, implying something in it requires four-byte alignment" - in almost all cases, pointers are aligned to 32-bit boundaries; failure to align a pointer could result in either significant performance degradation or an outright crash (depending on the CPU in question), so all sane compilers force them to be DWORD-aligned. Also, the integer types are almost certainly "short", as "int" is almost always 32 bits wide. --Quietust 22:46, 22 February 2010 (UTC)