>>> On 02.06.16 at 10:53, <andrew.coop...@citrix.com> wrote: > On 02/06/16 09:47, Jan Beulich wrote: >>>>> On 02.06.16 at 00:31, <andrew.coop...@citrix.com> wrote: >>> On 01/06/2016 23:24, Julien Grall wrote: >>>> free_xenheap_pages already tolerates NULL (even if an order != 0). Is >>>> there any reason to not do the same for free_domheap_pages? >>> The xenheap allocation functions deal in terms of plain virtual >>> addresses, while the domheap functions deal in terms of struct page_info *. >>> >>> Overall, this means that the domheap functions have a more restricted >>> input/output set than their xenheap variants. >>> >>> As there is already precedent with xenheap, making domheap tolerate NULL >>> is probably fine, and indeed the preferred course of action. >> I disagree, for the very reason you mention above. > > Which? Dealing with struct page_info pointer? Its still just a > pointer, whose value is expected to be NULL if not allocated.
Yes, but it still makes the interface not malloc()-like, other than - as you say yourself - e.g. the xenheap one. Just look at Linux for comparison: __free_pages() also doesn't accept NULL, while free_pages() does. I think we should stick to that distinction. Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel