qom/object: Remove pre-C11 check
We mandate a compiler supporting C11 since 2021-06-15 in
commit d22797ce36 ("configure: Use -std=gnu11"), thus the
max_align_t type definition exists. Remove what is now dead
code.
Note, C11 provides aligned_alloc(). Using it is left as a
future cleanup step.
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260615091308.4458-3-philmd@oss.qualcomm.com>
This commit is contained in:
14
qom/object.c
14
qom/object.c
@@ -675,18 +675,6 @@ static void object_finalize(void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the minimum alignment guaranteed by the system malloc. */
|
|
||||||
#if __STDC_VERSION__ >= 201112L
|
|
||||||
typedef max_align_t qemu_max_align_t;
|
|
||||||
#else
|
|
||||||
typedef union {
|
|
||||||
long l;
|
|
||||||
void *p;
|
|
||||||
double d;
|
|
||||||
long double ld;
|
|
||||||
} qemu_max_align_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static Object *object_new_with_type(Type type)
|
static Object *object_new_with_type(Type type)
|
||||||
{
|
{
|
||||||
Object *obj;
|
Object *obj;
|
||||||
@@ -703,7 +691,7 @@ static Object *object_new_with_type(Type type)
|
|||||||
* Do not use qemu_memalign unless required. Depending on the
|
* Do not use qemu_memalign unless required. Depending on the
|
||||||
* implementation, extra alignment implies extra overhead.
|
* implementation, extra alignment implies extra overhead.
|
||||||
*/
|
*/
|
||||||
if (likely(align <= __alignof__(qemu_max_align_t))) {
|
if (likely(align <= __alignof__(max_align_t))) {
|
||||||
obj = g_malloc(size);
|
obj = g_malloc(size);
|
||||||
obj_free = g_free;
|
obj_free = g_free;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user