Re: Object Oriented Linux

From: Andrew Morton (andrewm@uow.edu.au)
Date: Wed Jul 12 2000 - 22:19:56 EST


Khimenko Victor wrote:
>
> Kernel does not have malloc and
> friends so new/free can not be used (allocations in kernel should be used
> ONLY when really necessary).

typedef unsigned int size_t;

extern "C" void *kmalloc(size_t size);

inline void *operator new(size_t size)
{
        return kmalloc(size);
}

char *foo(int n)
{
        return new char[n];
}

g++ -c -O -fno-exceptions t.cc
size t.o
   text data bss dec hex filename
     21 0 0 21 15 t.o

This is a red herring. All of it.

> Kernel lacks suppot for rtti and exceptions.

See above.

> "Linux is free software"

Yup. And one principle of Free software is "don't tell other people
what to do".

I'm sorry, Victor but this one gets under my skin. If people want to
write kernel code in C++ well good for them. All it requires of the
kernel developers is to take the darn C++ keywords out of the headers.
About an hour's work for someone who has a license for /bin/vi.

This is an ideological language war masquerading as a technical and
supportability issue.

grrr...

-
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 : Sat Jul 15 2000 - 21:00:16 EST