Add __attribute__((__malloc__)) declaration to internal malloc funcs.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 17 Apr 2010 20:58:32 +0000 (16:58 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 17 Apr 2010 20:58:32 +0000 (16:58 -0400)
src/pmm.c
src/types.h

index 1b90f215f851e49c4ddca7e5bb326f1c31cc509d..58c0e8b0c82548839b619ccdc50f1266c9103059 100644 (file)
--- a/src/pmm.c
+++ b/src/pmm.c
@@ -117,7 +117,7 @@ zonelow_expand(u32 size, u32 align)
  ****************************************************************/
 
 // Obtain memory from a given zone.
-static void *
+static void * __malloc
 zone_malloc(struct zone_s *zone, u32 size, u32 align)
 {
     u32 oldpos = GET_PMMVAR(zone->cur);
@@ -186,7 +186,7 @@ struct pmmalloc_s {
 struct pmmalloc_s *PMMAllocs VAR32FLATVISIBLE;
 
 // Allocate memory from the given zone and track it as a PMM allocation
-void *
+void * __malloc
 pmm_malloc(struct zone_s *zone, u32 handle, u32 size, u32 align)
 {
     u32 oldallocdata = GET_PMMVAR(ZoneTmpHigh.cur);
index e0133589640ac2140fa0f394f9c98443aa09e818..50839418f61971d6d41196854ac8a7c649d3d2d5 100644 (file)
@@ -129,6 +129,7 @@ extern void __force_link_error__only_in_16bit(void) __noreturn;
 
 #define noinline __attribute__((noinline))
 #define __always_inline inline __attribute__((always_inline))
+#define __malloc __attribute__((__malloc__))
 #define __attribute_const __attribute__((__const__))
 
 #define __stringify_1(x)        #x