[riot-notifications] [RIOT-OS/RIOT] pkg/tlsf: Fix the way system functions are overriden. (#12031)

Juan I Carrano notifications at github.com
Fri Sep 13 10:53:32 CEST 2019


jcarrano commented on this pull request.



> +#include "irq.h"
+#include "tlsf.h"
+#include "tlsf-malloc.h"
+#include "tlsf-malloc-internal.h"
+
+/* TODO: Add defines for other compilers */
+#if defined(__GNUC__) && !defined(__clang__)    /* Clang supports __GNUC__ but
+                                                 * not the alloc_size()
+                                                 * attribute */
+
+#define ATTR_MALLOC  __attribute__((malloc, alloc_size(1)))
+#define ATTR_CALLOC  __attribute__((malloc, alloc_size(1,2)))
+#define ATTR_MALIGN  __attribute__((alloc_align(1), alloc_size(2), malloc))
+#define ATTR_REALLOC  __attribute__((alloc_size(2)))
+
+#else /* No GNU C -> no alias attribute */

The comment is wrong, it should read:
```suggestion
#else /* No GNU C -> no *alloc attribute */
```

The warning is not necessary: the "alloc" attributes are just hints to the compiler. In fact, I'm not 100% sure they help here.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/12031#discussion_r324095799
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190913/2642d54e/attachment.htm>


More information about the notifications mailing list