[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH] lib/ukalloc: Add uk_zalloc



Hey Sharan,

thanks for your work! Can you add a second macro to have also a "_do_" variant 
of zalloc? This is for consistency to the rest of the API:

  #define uk_do_zalloc(a, size)  uk_do_calloc(a, size, 1)

Thanks,

Simon

On 07.10.19, 11:46, "Minios-devel on behalf of Sharan Santhanam" 
<minios-devel-bounces@xxxxxxxxxxxxxxxxxxxx on behalf of 
Sharan.Santhanam@xxxxxxxxx> wrote:

    Add convenience macro to allocate a single element zeroed out memory.
    
    Signed-off-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
    ---
     lib/ukalloc/include/uk/alloc.h | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/lib/ukalloc/include/uk/alloc.h b/lib/ukalloc/include/uk/alloc.h
    index c62d93d..fb33639 100644
    --- a/lib/ukalloc/include/uk/alloc.h
    +++ b/lib/ukalloc/include/uk/alloc.h
    @@ -50,6 +50,8 @@ struct uk_alloc;
     extern "C" {
     #endif
     
    +#define uk_zalloc(a, size)  uk_calloc(a, size, 1)
    +
     struct uk_alloc *uk_alloc_get_default(void);
     int uk_alloc_set_default(struct uk_alloc *a);
     
    -- 
    2.7.4
    
    
    _______________________________________________
    Minios-devel mailing list
    Minios-devel@xxxxxxxxxxxxxxxxxxxx
    https://lists.xenproject.org/mailman/listinfo/minios-devel

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.