|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 08 of 15] hvmloader: Add a simple "scratch allocator"
> +void *scratch_alloc(uint32_t size, uint32_t align)
> +{
> + uint32_t s, e;
> +
> + /* Align to at least one kilobyte. */
> + if ( align < 1024 )
> + align = 1024;
> +
> + s = (scratch_start + align - 1) & ~(align - 1);
> + e = s + size - 1;
> +
> + BUG_ON(e < s);
> +
> + scratch_start = e;
> +
> + return (void *)(unsigned long)s;
Why the double cast?
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |