Using Uninitialized Memory for Fun and Profit (2008)

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

InfluxDB high-performance time series database
Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.
influxdata.com
featured
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
  1. llvm-project

    The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.

    > 1. it's insane. nobody would write such an optimization because there's no possible performance gain, and it changes program behavior

    LLVM explicitly has an 'undef' constant value which facilitates this optimization. https://llvm.org/docs/LangRef.html#undefined-values

    FWIW, the most important reason compilers do this is to decrease compile time. The compiler notices that some code is insane because it's down an unreachable path, and it deletes the code now instead of waiting to prove the path is unreachable. The later optimizations tend to be slower and scale badly with more code in the function, so deleting it earlier will speed up the compile.

    > 2. malloc is just a function, it's not treated in any special way

    The compiler is full of optimizations that treat malloc and other functions specially. This file implements an analysis, but the results of the analysis is used by transformations. https://github.com/llvm/llvm-project/blob/main/llvm/lib/Anal...

    > 3. there's no guarentee this malloc is a per-spec malloc, it can be a user-defined function for which this is perfectly valid

    Yep, there's a flag for that mode, `-ffreestanding` which corresponds to freestanding mode in the C89 standard, chapter 2 section 2.1.2.1.

  2. InfluxDB

    InfluxDB high-performance time series database. Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.

    InfluxDB logo
  3. glibc

    Unofficial mirror of sourceware glibc repository. Updated daily.

    Expanding macro gives three GCC function attributes [2]: `__attribute__ ((malloc))`, `__attribute__ ((alloc_size(1)))` and `__attribute__ ((warn_unused_result))`. They are required for GCC (and others recognizing them) to actually ensure that they behave as the standard dictates. Your own malloc-like functions won't be treated same unless you give similar attributes.

    [1] https://github.com/bminor/glibc/blob/807690610916df8aef17cd1...

    [2] https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attribute...

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Why performance optimization is hard work

    1 project | news.ycombinator.com | 29 Apr 2025
  • Table RS: Why WASM Outperforms JS at Scale 📈

    2 projects | dev.to | 29 Apr 2025
  • Standalone C compiler/assembler/linker/Libc for x86-64/aarch64/riscv64/WASM

    1 project | news.ycombinator.com | 29 Apr 2025
  • Asynchronous Svelte

    1 project | news.ycombinator.com | 29 Apr 2025
  • I built a hardware processor that runs Python

    11 projects | news.ycombinator.com | 28 Apr 2025

Did you know that C++ is
the 7th most popular programming language
based on number of references?