xiaoxiang781216 commented on code in PR #2698:
URL: https://github.com/apache/nuttx-apps/pull/2698#discussion_r1802945726


##########
testing/mm/mm_main.c:
##########
@@ -196,6 +212,15 @@ static void do_reallocs(FAR void **mem, FAR const int 
*oldsize,
   for (i = 0; i < n; i++)
     {
       j = seq[i];
+      int allocsize = MM_ALIGN_UP(newsize[j] + MM_SIZEOF_ALLOCNODE) -
+                      MM_ALIGN_UP(oldsize[j] + MM_SIZEOF_ALLOCNODE);
+      if (is_oversize(allocsize))
+        {
+          printf("(%d)The reallocs memory exceeds the threshold,\

Review Comment:
   ```suggestion
             printf("(%d)The reallocs memory exceeds the threshold, "
                       "skipping\n", i);
   ```



##########
testing/mm/mm_main.c:
##########
@@ -249,17 +272,22 @@ static void do_memaligns(FAR void **mem,
   for (i = 0; i < n; i++)
     {
       j = seq[i];
+      int allocsize = MM_ALIGN_UP(size[j] + MM_SIZEOF_ALLOCNODE) +
+                                      2 * align[i];
       printf("(%d)Allocating %d bytes aligned to 0x%08x\n",
              i,  size[j], align[i]);
+      if (is_oversize(allocsize))
+        {
+          printf("(%d)The reallocs memory exceeds the threshold,\

Review Comment:
   ```suggestion
             printf("(%d)The reallocs memory exceeds the threshold, "
                    "skipping\n", i);
   ```



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