pussuw commented on code in PR #14858:
URL: https://github.com/apache/nuttx/pull/14858#discussion_r1848512184


##########
mm/mm_gran/mm_grantable.c:
##########
@@ -223,17 +223,47 @@ bool gran_match(const gran_t *gran, size_t posi, size_t 
size, bool used,
 
   if (mpos && !used)
     {
-      /* offset of last used when matching for free */
+      size_t tmp;
 
+      v = gran->gat[c];

Review Comment:
   You mean to replace the whole search / match algorithm with find_next_bit / 
find_next_zero_bit? I'd rather not do that, @yf13 can comment if that's 
feasible.
   
   I only noticed that finding a free granule takes longer the more the memory 
is filled up.
   
   The builtin ctz/clz have a time complexity of O(log(n))



-- 
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-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to