malloc:我使用系统mmap实现的libc malloc,realloc和free函数; 尺寸分割和优化的空间使用-源码

上传者: 42136791 | 上传时间: 2021-03-25 13:02:58 | 文件大小: 17KB | 文件类型: ZIP
C
分配 我使用系统mmap实现的libc malloc,realloc和free函数 特征 大小分段:将请求分为SMALL,MEDIUM和LARGE,对SMALL和MEDIUM请求使用预分配的区域 释放碎片空间以优化重用 Hexdump分配的内存功能 实现的功能: malloc-分配“大小”字节的内存,并返回指向已分配内存的指针 realloc-尝试将“ ptr”指向的分配大小更改为“ size”,并返回“ ptr”。 如果没有足够的空间来扩大ptr指向的内存分配,则realloc()创建一个新分配,复制“ ptr”指向的旧数据,使其与新分配的存储量一样多,释放旧分配,并返回指向已分配内存的指针。 free-释放“ ptr”指向的内存分配。 如果“ ptr”是NULL指针,则不执行任何操作 show_alloc_mem

文件下载

资源详情

[{"title":"( 35 个子文件 17KB ) malloc:我使用系统mmap实现的libc malloc,realloc和free函数; 尺寸分割和优化的空间使用-源码","children":[{"title":"malloc-master","children":[{"title":"author <span style='color:#111;'> 9B </span>","children":null,"spread":false},{"title":"inc","children":[{"title":"malloc.h <span style='color:#111;'> 1.77KB </span>","children":null,"spread":false}],"spread":true},{"title":".deps","children":[{"title":"block.d <span style='color:#111;'> 92B </span>","children":null,"spread":false},{"title":"malloc.d <span style='color:#111;'> 94B </span>","children":null,"spread":false},{"title":"tools.d <span style='color:#111;'> 92B </span>","children":null,"spread":false},{"title":"free.d <span style='color:#111;'> 90B </span>","children":null,"spread":false},{"title":"realloc.d <span style='color:#111;'> 96B </span>","children":null,"spread":false}],"spread":true},{"title":"src","children":[{"title":"malloc.c <span style='color:#111;'> 2.70KB </span>","children":null,"spread":false},{"title":".DS_Store <span style='color:#111;'> 6.00KB </span>","children":null,"spread":false},{"title":"block.c <span style='color:#111;'> 1007B </span>","children":null,"spread":false},{"title":"tools.c <span style='color:#111;'> 2.61KB </span>","children":null,"spread":false},{"title":"free.c <span style='color:#111;'> 2.94KB </span>","children":null,"spread":false},{"title":"realloc.c <span style='color:#111;'> 2.43KB </span>","children":null,"spread":false}],"spread":true},{"title":"libft","children":[{"title":".DS_Store <span style='color:#111;'> 6.00KB </span>","children":null,"spread":false},{"title":"inc","children":[{"title":"libft.h <span style='color:#111;'> 1.16KB </span>","children":null,"spread":false}],"spread":true},{"title":"ft_putchar.c <span style='color:#111;'> 958B </span>","children":null,"spread":false},{"title":"ft_memcpy.c <span style='color:#111;'> 1.14KB </span>","children":null,"spread":false},{"title":"ft_bzero.c <span style='color:#111;'> 970B </span>","children":null,"spread":false},{"title":"ft_memset.c <span style='color:#111;'> 1.05KB </span>","children":null,"spread":false},{"title":"Makefile <span style='color:#111;'> 1.47KB </span>","children":null,"spread":false},{"title":"ft_putnbr.c <span style='color:#111;'> 1.15KB </span>","children":null,"spread":false},{"title":"ft_strlen.c <span style='color:#111;'> 1.20KB </span>","children":null,"spread":false}],"spread":true},{"title":"run.sh <span style='color:#111;'> 120B </span>","children":null,"spread":false},{"title":"demo","children":[{"title":"demo.c <span style='color:#111;'> 2.22KB </span>","children":null,"spread":false}],"spread":true},{"title":"test","children":[{"title":"test6.c <span style='color:#111;'> 112B </span>","children":null,"spread":false},{"title":"test3bis.c <span style='color:#111;'> 325B </span>","children":null,"spread":false},{"title":"test4.c <span style='color:#111;'> 225B </span>","children":null,"spread":false},{"title":"test2.c <span style='color:#111;'> 149B </span>","children":null,"spread":false},{"title":"test0.c <span style='color:#111;'> 89B </span>","children":null,"spread":false},{"title":"main_thread.c <span style='color:#111;'> 688B </span>","children":null,"spread":false},{"title":"test3.c <span style='color:#111;'> 281B </span>","children":null,"spread":false},{"title":"test5.c <span style='color:#111;'> 159B </span>","children":null,"spread":false},{"title":"test1.c <span style='color:#111;'> 135B </span>","children":null,"spread":false}],"spread":true},{"title":"README.md <span style='color:#111;'> 1016B </span>","children":null,"spread":false},{"title":"Makefile <span style='color:#111;'> 2.83KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明