[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1221501750.16561.15.camel@nimitz>
Date: Mon, 15 Sep 2008 11:02:30 -0700
From: Dave Hansen <dave@...ux.vnet.ibm.com>
To: Oren Laadan <orenl@...columbia.edu>
Cc: arnd@...db.de, jeremy@...p.org, linux-kernel@...r.kernel.org,
containers@...ts.linux-foundation.org
Subject: Re: [RFC v5][PATCH 2/8] General infrastructure for checkpoint
restart
On Sat, 2008-09-13 at 19:06 -0400, Oren Laadan wrote:
>
> +void *cr_hbuf_get(struct cr_ctx *ctx, int n)
> +{
> + void *ptr;
> +
> + BUG_ON(ctx->hpos + n > CR_HBUF_TOTAL);
> + ptr = (void *) (((char *) ctx->hbuf) + ctx->hpos);
> + ctx->hpos += n;
> + return ptr;
> +}
All of the casting here is unnecessary. 'void *' behaves like 'char *'
when you do arithmetic on it.
I really do detest having a memory allocator BUG_ON() when it runs out
of space.
-- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists