Subject: Re: bus_space annoyance, API change proposal
To: None <garrett_damore@tadpole.com>
From: Ben Harris <bjh21@netbsd.org>
List: tech-kern
Date: 02/16/2006 16:37:13
In article <43F4A2E9.9030705@tadpole.com> you write:
>Anyway, if someone wants to allocate e.g. a structure from the heap to
>create a bus_space_handle_t, then there has to be a way to clean it up
>to avoid leaking the memory.
>
>I am therefore proposing a new API be added:
>
>void bus_space_subregion_free(bus_space_tag_t, bus_space_handle_t);
>
>This frees a bus_space_handle_t allocated by bus_space_subregion().
>
>For all existing bus implementations this routine could be #define'd to
>a nop:
>
>#define bus_space_subregion_free(t,h) { }

On acorn26, I defined bus_space_handle_t to be a small struct, which works,
and is probably not ludicrously expensive as long as your handles don't need
many members.

>The bigger issue, as I see it, is changing the callers of
>bus_space_subregion() so that they free the handle when they need to.

That seems to me to be rather a lot of work for (as far as I can see) no
current gain at all.  Why not wait until we find an architecture that
actually needs it?

-- 
Ben Harris