Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 101

For questions about the implementation or design of data structures as specifically relevant to programming language design or implementation. Generic data structure questions are off-topic.

3 votes

Would a structure ever require padding beyond what is required to align the members?

Consider: typedef struct { double d; char c; } S; static S a[2]; The address of a[1] must be on a double boundary. &a[1] is &a + sizeof(S). Therefore sizeof(a[0]) must be a multiple of a dou …
Ray Butterworth's user avatar
5 votes

What are the implications of a 'packed' keyword/feature?

There's not really any need for this feature, and using it could cause performance issues (e.g. requiring extra memory fetches and realignment for each item, or even a memory fault). In situations whe …
Ray Butterworth's user avatar