Re: Object Oriented Linux

From: Pavel Machek (pavel@suse.cz)
Date: Fri Jul 14 2000 - 04:48:32 EST


Hi!

> > inline void *operator new(size_t size)
> > {
> > return kmalloc(size);
> > }
>
> Yes? Care to compile that? FYI, kmalloc() has _two_ arguments. And no, I'm
> not being pedantic - choice of the second argument matters. Big way. C++
> has a notion of "allocation", but kernel has not. What it has is "atomic
> allocation", "dma-suitable allocation", etc. Choosing the right one is
> _not_ a task for compiler - it's AI-complete. Always forcing atomic is not
> an option, BTW - performance hit will be too serious.

I already see this ugglyness:

n_tty.c: get_zeroed_page(in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);

so C++ would not make it much worse.

                                                                Pavel

-- 
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org

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



This archive was generated by hypermail 2b29 : Sun Jul 23 2000 - 21:00:19 EST