Why you Should NEVER Use Malloc in Real-Time Systems

preview_player
Показать описание
Well, not never, but avoid it unless it fits the scope of your design. :)
Custom allocators will always be a better option!

Dynamic Memory Allocation:

Article which inspired me to make this:

Latency Numbers:

Follow me on Social Media!
Instagram: @jamezsgames
Stream Schedule:
Monday, Tuesday, Wednesday 6:30 PM EST
Рекомендации по теме
Комментарии
Автор

I’m learning embedded systems programming and your videos makes me understand the power of C

LucasDH
Автор

Thank you. Very well explained and right to the point.

undercrackers
Автор

Hey James,

I really enjoy your more nuanced technical videos like these.

My regular day job has me at at high level scripting languages. So I use a lot of my spare time in reading up on numerous YT videos, books, articles to learn more about about interesting topics such as this video.

I don't have anything in particular I would like to see covered. But if you find reasons to explain things such as... how memory fragmentation occurs, why its bad and how to solve them (Like in this video); optimizing code (Such as your Floating Point Bit Manipulation); talking about the HEAP; Assembly; or anything of that sort that catches your interest.

I would absolutely love to hear your thoughts on them!

kazeroth
Автор

Yep in games we just do a single (or 2) giant allocation at program startup then use that memory pool with custom allocators when dynamic memory is needed. Not a single dynamic malloc/free call afterwards. Much easier to work with and headache free (mostly) as long as you remember your push/pop e.g. if using a stack based allocator. The nice thing with this approach is since its one block of memory, its easy to do things like taking a snapshot of the system and reverting back, or do code hot-reloading etc.

vexedev
Автор

you are free to use malloc in realtime system in the "start up phase", but once the real time functions start dont use malloc anymore

MsKelvin
Автор

Hello! how can I reach at you?..I'm a beginner in embedded system...

grandsonudoette
Автор

No! instead, you MUST LEARN HOW TO USE MALLOC PROPERLY ! POINTERS AND DYNAMIC MEMORY ALLOCATION

diegoferrari
Автор

I was never a fan of malloc(), for me calloc() was always king

JeffersonHumber
visit shbcf.ru