如何分配我们自己的功能,动态内存(不使用malloc) [英] how to allocate the dynamic memory with our own function (without using malloc)
问题描述
如何用我们自己的功能分配动态内存
how to allocate the dynamic memory with our own function
不使用malloc(),如何用C语言动态分配内存空间。
without using malloc(), how to allocate dynamic memory using C language.
推荐答案
如果你不想使用由图书馆提供的的malloc
(),你将不得不实施您自己的内存管理器,但我看不出有任何理由这样做。这code为全面测试,在使用很长一段时间。
您可以根据 SBRK
()系统调用实现自己的样品内存管理器。
我建议你去通过下面的链接。
If you do not want to use malloc
() provided by the library, you will have to implement your own memory manager, but I don't see any reason for doing so. That code is thoroughly tested and is in use for a long time.
You can implement your own sample memory manager based on the sbrk
() system call.
I would recommend you to go through the following link.
假设你在Linux上,检查下面的链接:
Assuming you are on linux, check the link below:
http://www.ibm.com/developerworks/linux/library / L内存/
这篇关于如何分配我们自己的功能,动态内存(不使用malloc)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!