[SeaBIOS] [PATCH] Remove the pmm handle argument from _malloc().

Kevin O'Connor kevin at koconnor.net
Fri Dec 27 23:19:45 CET 2013


On Fri, Dec 27, 2013 at 05:07:17PM -0500, Don Slutz wrote:
> On 12/27/13 11:35, Kevin O'Connor wrote:
> >The PMM handle argument will almost always be 0xffffffff.  Use
> >separate code for the few rare cases where it may not be the default
> >value.  Gcc produces better code if _malloc() only requires three
> >parameters.
[...]
> >+// Set a handle associated with an allocation.
> >+void
> >+malloc_sethandle(void *data, u32 handle)
> >+{
> >+    ASSERT32FLAT();
> >+    struct allocinfo_s *info = findAlloc(data);
> >+    if (!info || data == (void*)info || data == info->dataend)
> >+        return;
> >+    struct allocdetail_s *detail = container_of(
> >+        info, struct allocdetail_s, datainfo);
> >+    detail->handle = handle;
> I would think a "dprint(8" should be here like:
> 
>     dprintf(8, "malloc_sethandle handle=%x data=%p (detail=%p)\n"
>             , handle, data, detail);

Thanks for reviewing.  The only place that calls malloc_sethandle
already shows the handle (handle_pmm00) and the rest of the info is
displayed by _malloc().

-Kevin



More information about the SeaBIOS mailing list