lkml.org 
[lkml]   [2006]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Compiling C++ modules
Date
On Tuesday 25 April 2006 18:46, Avi Kivity wrote:
> Should you want to allocate from the heap, try this:
>
> {
> spinlock_t::guard g(some_lock);
> auto_ptr<Foo> item(new (gfp_mask) Foo); /* or pass a kmem_cache_t */
> item->do_something();
> item->do_something_else();
> return item.release();
> }
>

I love C++, but you have to stop it now. Imagine how many auto_ptr<Foo> will
you use inside your kernel. The compiler will need to create a separete class
for each. Using templates in the kernel will be plain silly.
-
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: 2006-04-25 22:14    [W:0.182 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site