You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/07/02 03:01:01 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #3983: arch/sim: Implement mm_mallinfo and malloc_size for the custom heap

xiaoxiang781216 commented on a change in pull request #3983:
URL: https://github.com/apache/incubator-nuttx/pull/3983#discussion_r662704752



##########
File path: include/malloc.h
##########
@@ -31,6 +31,8 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
+#define malloc_usable_size malloc_size
+

Review comment:
       Since the standard doesn't define API to get the malloc size, It isn't unfortunate that popular Unix variant OS define two different function for it:
   
   1. Linux and FreeBSD define malloc_usable_size:
       https://man7.org/linux/man-pages/man3/malloc_usable_size.3.html
       https://www.freebsd.org/cgi/man.cgi?query=malloc_usable_size&apropos=0&sektion=0&manpath=FreeBSD+7.1-RELEASE&format=html
   2. macOS define malloc_size:
       https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/malloc_size.3.html
   




-- 
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