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 2020/02/01 10:59:39 UTC

[GitHub] [incubator-nuttx] Ouss4 commented on a change in pull request #194: Optimize gran_alloc() in mm_granalloc.c by using builtin ctz.

Ouss4 commented on a change in pull request #194: Optimize gran_alloc() in mm_granalloc.c by using builtin ctz.
URL: https://github.com/apache/incubator-nuttx/pull/194#discussion_r373773825
 
 

 ##########
 File path: mm/mm_gran/mm_granalloc.c
 ##########
 @@ -159,6 +159,15 @@ FAR void *gran_alloc(GRAN_HANDLE handle, size_t size)
                   break;
                 }
 
+#if CONFIG_HAVE_BUILTIN_CTZ
+
+              else if ((curr & 1) == 1)
+                {
+                  shift = __builtin_ctz(~curr);
 
 Review comment:
   Why `__builtin_ctz(~curr)` and not `__builtin_clz(curr)` ?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services