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 - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • 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.

  • glibc

    Unofficial mirror of sourceware glibc repository. Updated daily. (by bminor)

  • 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...

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
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