pussuw commented on code in PR #7618:
URL: https://github.com/apache/incubator-nuttx/pull/7618#discussion_r1028044982


##########
mm/mm_gran/mm_pgalloc.c:
##########
@@ -123,7 +123,7 @@ void mm_pginitialize(FAR void *heap_start, size_t heap_size)
 
 void mm_pgreserve(uintptr_t start, size_t size)
 {
-  gran_reserve(g_pgalloc, start, size);
+  DEBUGASSERT(gran_reserve(g_pgalloc, start, size) != NULL);

Review Comment:
   Ah now I see what you mean:
   
   `#  define DEBUGASSERT(f) ((void)(1 || (f)))`
   
   This will expand into ((void) 1 || ((gran_reserve(g_pgalloc, start, size) != 
NULL)))
   
   And gran_reserve does not get executed. My bad.



##########
mm/mm_gran/mm_pgalloc.c:
##########
@@ -123,7 +123,7 @@ void mm_pginitialize(FAR void *heap_start, size_t heap_size)
 
 void mm_pgreserve(uintptr_t start, size_t size)
 {
-  gran_reserve(g_pgalloc, start, size);
+  DEBUGASSERT(gran_reserve(g_pgalloc, start, size) != NULL);

Review Comment:
   Ah now I see what you mean:
   
   `#  define DEBUGASSERT(f) ((void)(1 || (f)))`
   
   This will expand into `((void) 1 || ((gran_reserve(g_pgalloc, start, size) 
!= NULL)))`
   
   And gran_reserve does not get executed. My bad.



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