<div dir="ltr"><div>>Thanks! I guess i'm really unsure about how the pointer relates to the amount of memory that you can use. I assume the Malloc keeps track of the sections being used in the heap. Does this function Allocate 2 blocks since the pointer is set to <br></div><div> <br><div style="color:rgb(187,187,187);background-color:rgb(38,35,53);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:14px;line-height:19px;white-space:pre"><div><span style="color:rgb(187,187,187)"> (</span><span style="color:rgb(254,222,93)">uintptr_t</span><span style="color:rgb(187,187,187)">) next_block </span><span style="color:rgb(254,222,93)">+</span><span style="color:rgb(187,187,187)"> HEAP_ALLOC_BONUS </span><span style="color:rgb(254,222,93)">-</span><span style="color:rgb(187,187,187)"> alloc_begin;</span></div><div><span style="color:rgb(187,187,187)"><br></span></div></div></div><div>>(I know it's a bit naive to assume this given my first question) <br></div><div><br></div><div> think the method is _Heap_Size_of_alloc_area. It may need a wrapper 
added to the protected heap wrapper for safety. I don't know if it has one. It should be the equivalent functionality.</div><div>> How would i implement a wrapper and what safety measures need to be implemented. So far it's checking if :  the block is not in the heap and if it's been previously used. Is the usable memory in the heap calculated by: the size of the block * # of blocks? <br></div><div><br></div><div>Thanks, Zack <br> </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <b class="gmail_sendername" dir="auto">Joel Sherrill</b> <span dir="auto"><<a href="mailto:joel@rtems.org">joel@rtems.org</a>></span><br>Date: Wed, 8 Sept 2021 at 20:30<br>Subject: Re: Ticket 4503<br>To: Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>><br>Cc: zack leung <<a href="mailto:zakthertemsdev@gmail.com">zakthertemsdev@gmail.com</a>>, <a href="mailto:rtems-devel@rtems.org">rtems-devel@rtems.org</a> <<a href="mailto:devel@rtems.org">devel@rtems.org</a>><br></div><br><br><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 8, 2021 at 11:02 AM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi Zack,<div><br></div><div><a href="https://devel.rtems.org/ticket/4503" target="_blank">https://devel.rtems.org/ticket/4503</a><br></div><div><br></div><div>The malloc implementation exists in the score as the Heap Manager. search for "Heap_" within cpukit to get some ideas where to look.</div></div></div></blockquote><div><br></div><div>I think the method is _Heap_Size_of_alloc_area. It may need a wrapper added to the protected heap wrapper for safety. I don't know if it has one. It should be the equivalent functionality.</div><div><br></div><div>newlib's malloc.h will need looking at to make sure we provide the right methods.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>@Joel are these two tickets duplicates?<br></div><div><div><a href="https://devel.rtems.org/ticket/4503" target="_blank">https://devel.rtems.org/ticket/4503</a><br></div><div><a href="https://devel.rtems.org/ticket/4271" target="_blank">https://devel.rtems.org/ticket/4271</a></div></div></div></blockquote><div><br></div><div>Yes. Closed #4271 and merged comments.</div><div><br></div><div>--joel</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br></div></div><div><br></div>-Gedare<div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 7, 2021 at 7:14 PM zack leung <<a href="mailto:zakthertemsdev@gmail.com" target="_blank">zakthertemsdev@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I was wondering about ticket 4503. I was wondering where The required functionality should be in the underlying score/ capability used can be found to write this function. Also how does this relate  to  
                    <table><tbody><tr><td><br></td><td>
                      <a href="https://devel.rtems.org/ticket/4271" title="View ticket" target="_blank">Add common malloc family extension method malloc_usable_size()</a>? <br>Thanks <br>Zack <br></td></tr></tbody></table></div>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></blockquote></div></div></div>
</blockquote></div></div>
</div></div></div>