Skip to contentSkip to conversation

minios: add align support to _xmalloc()

PATCH New Samuel Thibault 1 participant 1 message Jan 21, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 minios: add align support to _xmalloc()

Add align support to _xmalloc().

extras/mini-os/include/xmalloc.h +2 -1
diff -r b13514ef6ec6 extras/mini-os/include/xmalloc.h
@@ -7,7 +7,8 @@
 /* Allocate space for array of typed objects. */
 #define xmalloc_array(_type, _num) ((_type *)_xmalloc_array(sizeof(_type), __alignof__(_type), _num))
 
-#define malloc(size) _xmalloc(size, 4)
+#define DEFAULT_ALIGN (sizeof(unsigned long))
+#define malloc(size) _xmalloc(size, DEFAULT_ALIGN)
 #define free(ptr) xfree(ptr)
 #define realloc(ptr, size) _realloc(ptr, size)
 
extras/mini-os/lib/xmalloc.c +89 -38

224 lines not on this page · raw message