4 ms·
Rule 20.4 (required): Dynamic heap memory allocation shall not be used. Good luck writing misra-compliant web browser. And yes, safe languages can be written
by fiedzia 11y ago
Rule 20.4 (required): Dynamic heap memory allocation shall not be used.
Good luck writing misra-compliant web browser.
And yes, safe languages can be written in safe languages. See rust and servo.
- sklogic 11y ago> Good luck writing misra-compliant web browser. I'd be delighted to see one. Statically pre-allocating a large continuous chunk of memory for the whole browser process lifetime would have been great.
- quonn 11y agoAnd then, what do you do with that chunk? Since the amount of memory you need depends on the website (e.g. some might need memory for a canvas, others might display large tables, etc.), presumably you take parts of it and allocate them for the various tasks you need to do? So you just write your own dynamic memory allocator.
- sklogic 11y ago> So you just write your own dynamic memory allocator. If the entire pool is reclaimed once page is rendered (and there is a way to handle the running out of space condition) it may not count as a rule violation, no more than incrementing an array index counter. And, browser is hardly a mission-critical appliance.
- huhtenberg 11y agoThis MISRA - https://en.wikipedia.org/wiki/MISRA_C https://en.wikipedia.org/wiki/MISRA_C ?
- Nashenas 11y agoRust and servo are great projects, but I would say there's still some time before Rust can completely replace C/C++. The language is stable, but there's still a lot of tooling that needs to be built up, and the compiler needs to be more performant. I also think it needs a few more small features in order to truly compete with C++ (it's already on par with C, in my opinion), e.g. being able to specify sized traits as return types. Once that's all done I think starting new projects in C/C++ wouldn't make sense anymore.
- deleted 11y ago[deleted]
- JustSomeNobody 11y ago"... misra-compliant web browser." Surely this is a joke.
- RotsiserMho 11y agoI so wish it were.