WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [RFC] Replacing Xen's xmalloc engine and(?) API

To: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>, "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [RFC] Replacing Xen's xmalloc engine and(?) API
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Sun, 12 Oct 2008 10:16:27 +0100
Cc: Diwaker Gupta <dgupta@xxxxxxxxxxx>, nitingupta910@xxxxxxxxx, kurt.hackel@xxxxxxxxxx
Delivery-date: Sun, 12 Oct 2008 02:16:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <2ed5b44f-1700-4505-bad4-37c76c85e617@default>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcksSzRlcxoCBpg+Ed22twAWy6hiGQ==
Thread-topic: [Xen-devel] [RFC] Replacing Xen's xmalloc engine and(?) API
User-agent: Microsoft-Entourage/11.4.0.080122
On 11/10/08 22:44, "Dan Magenheimer" <dan.magenheimer@xxxxxxxxxx> wrote:

> As a result, I'd like to propose a change to the xmalloc interface
> to make this issue more explicit:  I'd like to change xmalloc/xfree
> to FAIL on allocation sizes greater than PAGE_SIZE - DELTA, where
> DELTA is a defined constant.   Callers that require an allocation
> larger than that MUST use the page_alloc (and corresponding
> page_free) interfaces.  In other words, for any dynamic allocation
> code that needs a dynamically computed size that might exceed a
> page, the test must be done on the caller-side... and the caller
> is responsible for remembering whether the subpage allocator or
> the page-plus allocator was used, and free'ing with the matching
> subpage-free or page-plus-free routine.  While I'd never propose
> this unforgiving API for user-land code, I think it isn't unreasonable
> in a hypervisor.

This sounds crazy to me. xmalloc() should work like malloc().

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel