forked from AuroraMiddleware/gtk
8e74eb382f
The code is mostly stolen from graphene. Allocators support any alignment, but their implementation only calls system aligned allocator functions if malloc() is not aligned to 16-byte boundaries. If it is aligned, the implementation just calls malloc() regardless of which alignment is requested by the caller. This can be fixed by saving the result of meson malloc() alignment check and adding a few conditions to the implementation, but right now GSK and GTK only need 16-byte alignment either way.
19 lines
474 B
C
19 lines
474 B
C
#ifndef __GSK_ALLOC_PRIVATE_H__
|
|
#define __GSK_ALLOC_PRIVATE_H__
|
|
|
|
#include <glib.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
gpointer gsk_aligned_alloc (gsize size,
|
|
gsize number,
|
|
gsize alignment);
|
|
gpointer gsk_aligned_alloc0 (gsize size,
|
|
gsize number,
|
|
gsize alignment);
|
|
void gsk_aligned_free (gpointer mem);
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __GSK_ALLOC_PRIVATE_H__ */
|