lkml.org 
[lkml]   [2008]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC v5][PATCH 9/9] Restore open file descriprtors
From
Date
On Tue, 2008-09-16 at 20:11 -0400, Oren Laadan wrote:
>
> No. (this was discussed earlier already).
>
> cr_hbuf_get() "allocates" space inside a dedicated buffer for headers
> in the checkpoint context (ctx->hbuf). It does not allocate new kernel
> memory. Instead, it returns the current position in that buffer
> ctx->hbuf[ctx->hpos], and advances ctx->hpos appropriately. On the
> other side, cr_hbuf_put() reverses that effect, reducing ctx->hpos
> accordingly.
>
> If an error occurs, the checkpoint (or restart) operation is aborted,
> and eventually the context (ctx) will be cleaned up; at that point the
> special purpose buffer will be freed.

I think this is like claiming that my malloc() will get freed if my
applications exits, so I don't have to worry about free(). It is messy,
it makes lifetime rules and use less explicit, and it makes bugs harder
to find. If I were a good programmer (which I'm not) I probably
wouldn't do that.

-- Dave



\
 
 \ /
  Last update: 2008-09-22 18:05    [W:0.058 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site