News for hackers. Stuff that matters.
Re:Tinyalloc: replacement for malloc/free in unmanaged, line... by okl on Sunday January 06, 2019 @12:59PM (#18839562)
Of course, but then we are back to memory pools.
Re:Tinyalloc: replacement for malloc/free in unmanaged, line... by CyberDildonics on Sunday January 06, 2019 @03:25PM (#18840438)
What is the difference between allocating memory right when the program starts with malloc and using the same size in static unitialized byte arrays?

There are differences of course, but that memory can be used in the same way, and so memory pools are orthogonal to how the memory is aquired.

Re:Tinyalloc: replacement for malloc/free in unmanaged, line... by okl on Sunday January 06, 2019 @03:39PM (#18840552)
If you use modules with opaque pointers, the types are incomplete and therefore their size is not known outside of the module. You can either make the type visible (against the idea of opaque pointers), modify the module to allocate a fixed set of instances (somewhat against the open/closed principle), or you let the module use malloc to allocate memory for new instances.
Re:Tinyalloc: replacement for malloc/free in unmanaged, line... by CyberDildonics on Sunday January 06, 2019 @09:47PM (#18842352)
Why would someone be doing this while trying to fit within the boundaries of the MISRA standard? Also what do you mean by module?
Re:Tinyalloc: replacement for malloc/free in unmanaged, line... by okl on Sunday January 06, 2019 @10:37PM (#18842573)
The rule you are referring to is a "required" (not a "mandatory") rule. You can deviate from it and still be MISRA-C compliant. People write deviations for all kinds of reasons. Here are some rationales for deviations: https://lars-lab.jpl.nasa.gov/JPL_Coding_Standard_C.pdf (Rule 5 on page 10 on malloc) https://www.keil.com/pack/doc/CMSIS/Core/html/coreMISRA_Exce...

The unit of reuse that defines the type, example: http://c-faq.com/struct/sd1.html

Re:Tinyalloc: replacement for malloc/free in unmanaged, line... by CyberDildonics on Monday January 07, 2019 @03:34PM (#18849722)
So your solution, in a thread about using a fixed amount of memory, is to do nothing different and let anything use the heap at any time because it might be possible in some cases to get it past MISRA standards? I'm not really sure of what you are trying to say, it seems you keep skewing further from the original discussion.