ObjFW  Check-in [2d4a63cfcb]

Overview
Comment:Move definition of __BIGGEST_ALIGNMENT__ to macros.h.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2d4a63cfcb83c2516a71140b883820b3693f9186ec890eea9378e949799b8396
User & Date: js on 2012-03-17 14:26:12
Other Links: manifest | tags
Context
2012-03-17
15:12
Add of_alloc_object(). check-in: e7d16fea58 user: js tags: trunk
14:26
Move definition of __BIGGEST_ALIGNMENT__ to macros.h. check-in: 2d4a63cfcb user: js tags: trunk
2012-03-16
17:32
OFXMLParser: Don't recreate "attributes" all the time. check-in: 4a080857a2 user: js tags: trunk
Changes

Modified src/OFObject.m from [329e3b32bd] to [ffa19d5312].

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
};

struct pre_mem {
	id owner;
	struct pre_mem *prev, *next;
};

/* Hopefully no arch needs more than 16 bytes padding */
#ifndef __BIGGEST_ALIGNMENT__
# define __BIGGEST_ALIGNMENT__ 16
#endif

#define PRE_IVAR_ALIGN ((sizeof(struct pre_ivar) + \
	(__BIGGEST_ALIGNMENT__ - 1)) & ~(__BIGGEST_ALIGNMENT__ - 1))
#define PRE_IVAR ((struct pre_ivar*)(void*)((char*)self - PRE_IVAR_ALIGN))

#define PRE_MEM_ALIGN ((sizeof(struct pre_mem) + \
	(__BIGGEST_ALIGNMENT__ - 1)) & ~(__BIGGEST_ALIGNMENT__ - 1))
#define PRE_MEM(mem) ((struct pre_mem*)(void*)((char*)mem - PRE_MEM_ALIGN))







<
<
<
<
<







69
70
71
72
73
74
75





76
77
78
79
80
81
82
};

struct pre_mem {
	id owner;
	struct pre_mem *prev, *next;
};






#define PRE_IVAR_ALIGN ((sizeof(struct pre_ivar) + \
	(__BIGGEST_ALIGNMENT__ - 1)) & ~(__BIGGEST_ALIGNMENT__ - 1))
#define PRE_IVAR ((struct pre_ivar*)(void*)((char*)self - PRE_IVAR_ALIGN))

#define PRE_MEM_ALIGN ((sizeof(struct pre_mem) + \
	(__BIGGEST_ALIGNMENT__ - 1)) & ~(__BIGGEST_ALIGNMENT__ - 1))
#define PRE_MEM(mem) ((struct pre_mem*)(void*)((char*)mem - PRE_MEM_ALIGN))

Modified src/macros.h from [422d3d7cb2] to [a584e5dfec].

59
60
61
62
63
64
65





66
67
68
69
70
71
72
#endif

#ifdef OF_BIG_ENDIAN
# define OF_ENDIANESS_NATIVE OF_ENDIANESS_BIG_ENDIAN
#else
# define OF_ENDIANESS_NATIVE OF_ENDIANESS_LITTLE_ENDIAN
#endif






#ifdef __GNUC__
# if defined(__amd64__) || defined(__x86_64__)
#  define OF_AMD64_ASM
# elif defined(__i386__)
#  define OF_X86_ASM
# elif defined(__ppc__) || defined(__PPC__)







>
>
>
>
>







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#endif

#ifdef OF_BIG_ENDIAN
# define OF_ENDIANESS_NATIVE OF_ENDIANESS_BIG_ENDIAN
#else
# define OF_ENDIANESS_NATIVE OF_ENDIANESS_LITTLE_ENDIAN
#endif

/* Hopefully no arch needs more than 16 bytes padding */
#ifndef __BIGGEST_ALIGNMENT__
# define __BIGGEST_ALIGNMENT__ 16
#endif

#ifdef __GNUC__
# if defined(__amd64__) || defined(__x86_64__)
#  define OF_AMD64_ASM
# elif defined(__i386__)
#  define OF_X86_ASM
# elif defined(__ppc__) || defined(__PPC__)