rand() may call malloc()

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

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • m1n1

    A bootloader and experimentation playground for Apple Silicon

  • The solution isn't to stop using rand(). The solution is to stop using newlib.

    If you're doing your own custom memory management like this, you shouldn't even have a malloc implementation at all. newlib is too bloated for even your use case. At this point, chances are you're using a trivial subset of the C library and it'd be easy to roll your own. You can import bits and pieces from other projects (I personally sometimes copy and paste bits from PDClib for this). In such a tight embedded project, chances are you don't even have threads; why even pull in that reentrancy code?

    Freestanding C code with no standard library isn't scary. If you need an example, look at what we do for m1n1:

    https://github.com/AsahiLinux/m1n1/tree/main/src

  • stack_usage

    Calculates the maximum stack depth required by GCC-compiled code

  • One of the more experienced embedded Ada devs out there wrote this: https://github.com/simonjwright/stack_usage

    I’m not sure if it would meet your requirements or not.

  • 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