mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Change the order of the retain count and the padding, so the retain count is
always the word before isa. Switch to using the correct kind of alignof (the ABI alignment in structures, not the preferred alignment of the type - this stops us from allocating 4 bytes of padding on x86-32 where there is no need for any) git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33642 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7698b8d176
commit
48e1b94ef8
1 changed files with 3 additions and 3 deletions
|
@ -398,11 +398,11 @@ static inline NSLock *GSAllocationLockForObject(id p)
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef ALIGN
|
||||
#undef ALIGN
|
||||
#endif
|
||||
#define ALIGN __alignof__(double)
|
||||
#define alignof(type) __builtin_offsetof(struct { const char c; type member; }, member)
|
||||
#define ALIGN alignof(double)
|
||||
|
||||
/*
|
||||
* Define a structure to hold information that is held locally
|
||||
|
@ -419,8 +419,8 @@ typedef struct obj_layout_unpadded {
|
|||
* structure correct.
|
||||
*/
|
||||
struct obj_layout {
|
||||
NSUInteger retained;
|
||||
char padding[ALIGN - ((UNP % ALIGN) ? (UNP % ALIGN) : ALIGN)];
|
||||
NSUInteger retained;
|
||||
};
|
||||
typedef struct obj_layout *obj;
|
||||
|
||||
|
|
Loading…
Reference in a new issue