On Mon, 24 Apr 2006 22:52:12 +0100, Alan Cox <[email protected]> wrote: > On Llu, 2006-04-24 at 15:36 -0600, Jeff V. Merkey wrote: > > C++ in the kernel is a BAD IDEA. C++ code can be written in such a > > convoluted manner as to be unmaintainable and unreadable. > > So can C. > > > All of the hidden memory allocations from constructor/destructor > > operatings can and do KILL OS PERFORMANCE. > > This is one area of concern. Just as big a problem for the OS case is > that the hidden constructors/destructors may fail. Tell me what is the difference between: sbi = kmalloc(sizeof(*sbi), GFP_KERNEL); if (!sbi) return -ENOMEM; sb->s_fs_info = sbi; memset(sbi, 0, sizeof(*sbi)); sbi->s_mount_opt = 0; sbi->s_resuid = EXT3_DEF_RESUID; sbi->s_resgid = EXT3_DEF_RESGID; and SuperBlock() : s_mount_opt(0), s_resuid(EXT3_DEF_RESUID), s_resgid(EXT3_DEF_RESGID) {} ... sbi = new SuperBlock; if (!sbi) return -ENOMEM; apart that you don't get members initalized twice and get a shorter code :). -- J.A. Magallon <jamagallon()able!es> \ Software is like sex: werewolf!able!es \ It's better when it's free Mandriva Linux release 2006.1 (Cooker) for i586 Linux 2.6.16-jam9 (gcc 4.1.1 20060330 (prerelease)) #1 SMP PREEMPT Tue
Attachment:
signature.asc
Description: PGP signature
- Follow-Ups:
- Re: C++ pushback
- From: "Alexander E. Patrakov" <[email protected]>
- Re: C++ pushback
- From: Geert Uytterhoeven <[email protected]>
- Re: C++ pushback
- From: Nikita Danilov <[email protected]>
- Re: C++ pushback
- From: Xavier Bestel <[email protected]>
- Re: C++ pushback
- From: "linux-os \(Dick Johnson\)" <[email protected]>
- Re: C++ pushback
- From: Harald Arnesen <[email protected]>
- Re: C++ pushback
- References:
- C++ pushback
- From: Gary Poppitz <[email protected]>
- Re: C++ pushback
- From: Martin Mares <[email protected]>
- Re: C++ pushback
- From: "Jeff V. Merkey" <[email protected]>
- Re: C++ pushback
- From: Alan Cox <[email protected]>
- C++ pushback
- Prev by Date: [PATCH][RFT] HPT3xxN clocking fixes (take 2)
- Next by Date: Re: [RFC][PATCH] swsusp: support creating bigger images
- Previous by thread: Re: C++ pushback
- Next by thread: Re: C++ pushback
- Index(es):