TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Heap on Embedded Devices: Analysis and Improvement

37 点作者 dimonomid超过 9 年前

8 条评论

omgtehlion超过 9 年前
Wow wow, if you are using a heap on really small embedded device you&#x27;re gonna have a bad time any way.<p>Embedded engineering 101: statically allocate everything, and try not to push the stack too much. But you can not do this with JS :(
评论 #10980567 未加载
评论 #10983149 未加载
daphreak超过 9 年前
&quot;I have worked with a few embedded SDKs (by Microchip, Keil and Espressif), and all of them have a really dumb built-in implementation of the heap.&quot;<p>Many embedded systems allocate just once at startup and these &quot;really dumb&quot; implementations are completely sufficient. The vendors provide a fast, low-overhead solution by default and trust that developers can go find a more appropriate allocator if they need it for their application. Luckily we have many implementations to choose from!
评论 #10980307 未加载
评论 #10982095 未加载
flyinglizard超过 9 年前
Generally speaking, you should try really hard to avoid using the heap in any system that has no virtual memory support. Heap fragmentation will ultimately get your app.<p>The exception is in state machines where you know, in a deterministic way, what the memory layout should be at every given state, and then you can use heaps to get memory overlap between code pieces that operate exclusively of each other.
cornellwright超过 9 年前
While it&#x27;s nicely written, my first question is why are you running JS on a microcontroller?
评论 #10983061 未加载
plasticchris超过 9 年前
The allocator that comes with free rtos (I assume he&#x27;s using it as he mentions pvPortMalloc) can be extended to support realloc efficiently without too much trouble so that it will resize if possible. For example <a href="https:&#x2F;&#x2F;github.com&#x2F;hello&#x2F;heap_6" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hello&#x2F;heap_6</a>
评论 #10980810 未加载
plasticchris超过 9 年前
From 2010, very similar approach: <a href="http:&#x2F;&#x2F;www.asyndetic.com&#x2F;2010&#x2F;07&#x2F;30&#x2F;visualizing-the-heap-on-embedded-systems-part-ii&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.asyndetic.com&#x2F;2010&#x2F;07&#x2F;30&#x2F;visualizing-the-heap-on-...</a>
shenberg超过 9 年前
Don&#x27;t set a constant poison, the attacker will just overwrite the poison with A5s. Generate a random byte on start-up.
评论 #10983179 未加载
poseid超过 9 年前
interesting visualizations