lkml.org 
[lkml]   [2005]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2.6] 1/7 create kstrdup library function
At some point in time, I wrote:
> > kstrdup() is a special-case _memory allocator_ (not so much a string
> > operation) so I think it should go into mm/slab.c where we currently
> > have kcalloc().

On Tue, 01 Feb 2005 17:00:17 +0000, Paulo Marques <pmarques@grupopie.com> wrote:
> I was following Rusty Russell's approach. Also, I believe this is more
> intuitive because the standard libc strdup function is declared in string.h.
>
> However, I really don't have strong feelings either way, so if the
> majority agrees that this should be in mm/slab, its fine by me.

Intuitive, perhaps, but I think it's wrong. I don't like it because it
makes string operations depend on slab. Furthermore, kstrdup() is not
a string operation. It is about memory allocation, really, just like
kcalloc().

One possible way to clean this up would be to extract the
standard-like allocators (kmalloc, kcalloc, and kstrdup) from
mm/slab.c and move them into a separate file.

Pekka
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:10    [W:0.042 / U:2.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site