Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix alignment of 64bit platforms #328

Merged
merged 1 commit into from
May 6, 2015
Merged

Fix alignment of 64bit platforms #328

merged 1 commit into from
May 6, 2015

Conversation

isanych
Copy link
Contributor

@isanych isanych commented May 5, 2015

gcc 5 sanitizer was complaining about alignment on 64bit platform:

pbjson/rapidjson/document.h:1248:9: runtime error: member call on misaligned address 0x631000028b6c for type 'struct GenericValue', which requires 8 byte alignment
0x631000028b6c: note: pointer points here
74 00 be be be be be be be be be be be be be be be be be be be be be be be be be be be be be be

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.82% when pulling 1576cde on isanych:master into ba76475 on miloyip:master.

@miloyip
Copy link
Collaborator

miloyip commented May 6, 2015

Note that, this will increase the sizeof(Value) from 20 bytes to 24 bytes on 64-bit platform.
But I think this would be safer in unknown/future 64-bit architecture.
I will also try to optimize it to 16 bytes on some platforms later, where only 48 bits address space is actually used.

@miloyip miloyip closed this May 6, 2015
@miloyip miloyip reopened this May 6, 2015
miloyip added a commit that referenced this pull request May 6, 2015
Fix alignment of 64bit platforms
@miloyip miloyip merged commit 286aa8a into Tencent:master May 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants