You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "fxysunshine (via GitHub)" <gi...@apache.org> on 2023/05/01 15:42:32 UTC
[GitHub] [nuttx] fxysunshine commented on a diff in pull request #9143: mm: malloc return valid pointer when request 0 size
fxysunshine commented on code in PR #9143:
URL: https://github.com/apache/nuttx/pull/9143#discussion_r1181666249
##########
mm/mm_heap/mm_malloc.c:
##########
@@ -87,6 +87,14 @@ void mm_dump_handler(FAR struct tcb_s *tcb, FAR void *arg)
}
#endif
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/* all zero allocated pointers to a global unique ptr */
+
+uint8_t g_zero_alloc;
Review Comment:
const address can not implicit cast to void * pointer, need explicit cast, but also lose read-only protection
> 1. add const to catch the caller write to it
OK
> 2. change uintptr_t to get the correct alignment
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org