堆在身体上是什么?
我熟悉堆的摘要堆的概念以及如何用malloc
等语言实现。但是,我不明白编译器如何在程序员称为“堆”中分配内存。
在ARM-64机器(这是我使用的)中,没有物理堆栈和堆,只有RAM加上CPU中的15个寄存器。计算机将如何在堆上分配指针,例如为动态尺寸的数组分配?它如何确定要保留的内存地址?如果我要在A64汇编中编写内存管理器,那将大致说明什么?
I am familiar with the abstract concept of the heap and how to implement in languages like C with malloc
. But, I don't understand how the compiler allocates memory in what programmers call the "heap."
In ARM-64 machines (which is what I'm using), there is no physical stack and heap, just RAM plus 15 registers in the CPU. How would a computer allocate a pointer on the heap, say for a dynamically-sized array? How does it decide which memory address to reserve? If I were to write a memory manager in A64 assembly, what roughly would that entail?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论