malloc()和free() [英] malloc() and free()

查看:169
本文介绍了malloc()和free()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编写自己的替换项以进行内存分配/取消分配 例程malloc()和free().将这两个新函数命名为NewMalloc() 和NewFree().

NewMalloc()为来自的每个调用分配内存 固定大小的数组.该数组是一个50,000字节的数组.一切 您声明要管理此50,000字节内存的数据结构 该区域必须位于该内存区域内.

可以使用NewFree()释放使用NewMalloc()分配的内存.

Write your own replacements for the memory allocation/deallocation routines malloc() and free(). Name these two new functions NewMalloc() and NewFree().

NewMalloc() allocates memory for each call from an array of fixed size. This array is an array of 50,000 bytes. All the data structures that you declare to manage this 50,000 bytes memory area must reside within that memory area.

The memory allocated using NewMalloc() can be freed with NewFree().

推荐答案

我们不为您做作业.

blockquote>


这篇关于malloc()和free()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆