diff options
author | Jani Monoses <jani@ubuntu.com> | 2012-04-06 12:51:27 +0300 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2012-04-06 12:49:18 -0400 |
commit | 53dda3d5aa72ef9e2d0bf21619e87179db4b5d01 (patch) | |
tree | 12f70c9318e34b76f358dddd49d65163d955dd9b /src/mongo/bson/inline_decls.h | |
parent | be60d3bfb386b30c96aba1b2a30eab8909379413 (diff) | |
download | mongo-53dda3d5aa72ef9e2d0bf21619e87179db4b5d01.tar.gz |
Fix all cases of alignment trap on ARMv7.
Access doubles via a packed struct so the generated code
works with unaligned pointers too. The code generated by gcc for
i386 and amd64 for such an access is identical to the code
generated by a direct reference.
Signed-off-by: Eric Milkie <milkie@10gen.com>
Diffstat (limited to 'src/mongo/bson/inline_decls.h')
-rw-r--r-- | src/mongo/bson/inline_decls.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/bson/inline_decls.h b/src/mongo/bson/inline_decls.h index 30da9b4560d..9be55e74798 100644 --- a/src/mongo/bson/inline_decls.h +++ b/src/mongo/bson/inline_decls.h @@ -20,14 +20,17 @@ #if defined(__GNUC__) #define NOINLINE_DECL __attribute__((noinline)) +#define PACKED_DECL __attribute__((packed)) #elif defined(_MSC_VER) #define NOINLINE_DECL __declspec(noinline) +#define PACKED_DECL #else #define NOINLINE_DECL +#define PACKED_DECL #endif |