|
|
|
Re: [PATCH v4 0/13] Generic Red-Black Trees | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
|
On 06/22/2012 11:00 PM, Daniel Santos wrote: > Theory of Operation > =================== > Historically, genericity in C meant function pointers, the overhead of a > function call and the inability of the compiler to optimize code across > the function call boundary. GCC has been getting better and better at > optimization and determining when a value is a compile-time constant and > compiling it out. As of gcc 4.6, it has finally reached a point where > it's possible to have generic search & insert cores that optimize > exactly as well as if they were hand-coded. (see also gcc man page: > -findirect-inlining) For those of us who stopped upgrading gcc when it went to a non-open license, and the people trying to escape to llvm/pcc/open64/tcc/qcc/etc and build the kernel with that, this will simply be "less optimized" rather than "you're SOL, hail stallman"? > Layer 2: Type-Safety > -------------------- > In order to achieve type-safety of a generic interface in C, we must > delve deep into the darkened Swamps of The Preprocessor and confront the > Prince of Darkness himself: Big Ugly Macro. To be fair, there is an > alternative solution (discussed in History & Design Goals), the > so-called "x-macro" or "supermacro" where you #define some pre-processor > values and include an unguarded header file. With 17 parameters, I > choose this solution for its ease of use and brevity, but it's an area > worth debate. Because this is just _filling_ me with confidence about portability and c99 compliance. (Or I suppose C11!!one! compliance. The new thing that puts asserts in the base language and makes u8 a keyword since _that_ won't break existing code and putting utf8 string constants within quotes wasn't previously possible.) I'm not saying the standard's perfect, I'm saying a web page that ties itself to mozilla at the expense of working on firefox, let alone chrome, might be a bit short-sighted these days. XFree86 begat x.org, OpenOffice begat libre, etc. The FSF went nuts again and this time around EGCS is called LLVM, so talking about gcc 4.6-only features thrills some of us less than you might expect. I suppose sparse has to be able to cope with this, so that's something... > To avoid needing multiple versions of the macro, we use a paradigm Indeed. I still have trouble remembering how trampolines work when I wander away for a while. Oh well... Rob -- GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code. Either it's "mere aggregation", or a license violation. Pick one. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[Other Archives] [Linux Kernel Newbies] [Linux Driver Development] [Linux Kbuild] [Fedora Kernel] [Linux Kernel Testers] [Linux SH] [Linux Omap] [Linux Tape] [Linux Input] [Linux Kernel Janitors] [Linux Kernel Packagers] [Linux Doc] [Linux Man Pages] [Linux API] [Linux Memory Management] [Linux Modules] [Linux Standards] [Kernel Announce] [Netdev] [Git] [Linux PCI] Linux CAN Development [Linux I2C] [Linux RDMA] [Linux NUMA] [Netfilter] [Netfilter Devel] [SELinux] [Bugtraq] [FIO] [Linux Perf Users] [Linux Serial] [Linux PPP] [Linux ISDN] [Linux Next] [Kernel Stable Commits] [Linux Tip Commits] [Kernel MM Commits] [Linux Security Module] [AutoFS] [Filesystem Development] [Ext3 Filesystem] [Linux bcache] [Ext4 Filesystem] [Linux BTRFS] [Linux CEPH Filesystem] [Linux XFS] [XFS] [Linux NFS] [Linux CIFS] [Ecryptfs] [Linux NILFS] [Linux Cachefs] [Reiser FS] [Initramfs] [Linux FB Devel] [Linux OpenGL] [DRI Devel] [Fastboot] [Linux RT Users] [Linux RT Stable] [eCos] [Corosync] [Linux Clusters] [LVS Devel] [Hot Plug] [Linux Virtualization] [KVM] [KVM PPC] [KVM ia64] [Linux Containers] [Linux Hexagon] [Linux Cgroups] [Util Linux] [Wireless] [Linux Bluetooth] [Bluez Devel] [Ethernet Bridging] [Embedded Linux] [Barebox] [Linux MMC] [Linux IIO] [Sparse] [Smatch] [Linux Arch] [x86 Platform Driver] [Linux ACPI] [Linux IBM ACPI] [LM Sensors] [CPU Freq] [Linux Power Management] [Linmodems] [Linux DCCP] [Linux SCTP] [ALSA Devel] [Linux USB] [Linux PA RISC] [Linux Samsung SOC] [MIPS Linux] [IBM S/390 Linux] [ARM Linux] [ARM Kernel] [ARM MSM] [Tegra Devel] [Sparc Linux] [Linux Security] [Linux Sound] [Linux Media] [Video 4 Linux] [Linux IRDA Users] [Linux for the blind] [Linux RAID] [Linux ATA RAID] [Device Mapper] [Linux SCSI] [SCSI Target Devel] [Linux SCSI Target Infrastructure] [Linux IDE] [Linux SMP] [Linux AXP] [Linux Alpha] [Linux M68K] [Linux ia64] [Linux 8086] [Linux x86_64] [Linux Config] [Linux Apps] [Linux MSDOS] [Linux X.25] [Linux Crypto] [DM Crypt] [Linux Trace Users] [Linux Btrace] [Linux Watchdog] [Utrace Devel] [Linux C Programming] [Linux Assembly] [Dash] [DWARVES] [Hail Devel] [Linux Kernel Debugger] [Linux gcc] [Gcc Help] [X.Org] [Wine]
![]() |
![]() |
[Older Kernel Discussion] [Yosemite National Park Forum] [Large Format Photos] [Gimp] [Yosemite Photos] [Stuff]