3 ms·
Well the whole article seemed silly after he said this: "First of all, you can't use heap - not when you're in orbit. Why? Because quite simply, if you do use
by icefox 15y ago
Well the whole article seemed silly after he said this:
"First of all, you can't use heap - not when you're in orbit. Why? Because quite simply, if you do use heap, and malloc returns null... what do you do? You can't ask the user for help"
This is the OOM problem and is highly dependent upon the kernel you are using. Not bringing the kernel into the discussion means that the discussion is just silly. There is not much of a point to putting the heap in the stack as you said, but hey like the author we are just getting some ideas out there without bringing up the kernel.
- ttsiodras 15y agoI think you misinterpreted the article: the target is not Linux/x86, its a custom board with the SPARC/Leon processor running a custom embedded OS (RTEMS), launched in space :-) The article is just an example of the notions used, and how objdump can be used to enforce them. Linux is used simply for demonstration purposes. In your average PC with Linux/x86, it is clear that you fear neither stack nor heap error - you just restart the app :-)
- icefox 15y agoI think you misinterpreted my comment. I didn't mention Linux anywhere in it, but specifically talk about how when dealing with OOM you must first discuss what the kernel provides. On RTEMS can malloc actually return 0 or does it never return 0 and there is a signal or some other event that is sent out from the kernel? These are the most important bits of information in this problem.