29 ms·
Can you elaborate on why malloc() was prohibited?
by rocho 10y ago
Can you elaborate on why malloc() was prohibited?
- samblr 10y agoDesigning of component also involved a meticulous way of finding how much memory would be used. Most of the memory used was in stack and bss - to maintain model-and-state-machines. Predominantly these were 'static' variables. Then any allocation on heap was done using local-heap manager functions. Local-heap-manager allocated buffer of 3 or 4 sizes usually in terms of large kilo bytes - this was usually to process audio/video/image(AVI) frames. These allocation were mainly called by components involved in AVI libs. And any call to local-heap-manager had to get some sort of approval at architecture level - most of the time if it was not for AVI - it would be turned down with plenty of debate. This local-heap-manager abstracted to sort of a pipeline at system level. Only one pipeline can be active at any given state. Switch of pipeline meant - release-allocation of these large chunks of memory. Each pipeline involving say x components would use highest possible memory of say y. The error that was usually frowned upon was 'low memory' of system - this usually occured when a hardware unit was slow to process say a block of AVI. Also the total cpu load of each pipeline was also monitored.