C/C++ 内存管理

Memory Manage Together

链接:cuber-lotus/Memory-Manage-Together

BUG.png

介绍

Memory Manage Together

本项目主要记录各类在C/C++使用过程中,有关内存的各种事项。

如:

  • 内存泄漏 memory leak
  • 内存溢出 out of memory
  • 访问越界 access violation
  • 等等

展现形式

本仓库是一个 sample 的整合,不会涉及过多内部的底层设计等等。

一切回归到最接近每位coder的层面,一份文件一般对应一种问题。

目录

辅助工具

关于检测内存问题的工具有很多。

这里推荐 Valgrind Home

# linux 环境下
# 默认生成 a.out
gcc ./main.c

# 对 a.out 文件进行检测 
valgrind ./a.out
# 将检测信息打到文件中
# valgrind_out.log 不会自动创建
valgrind --log-file=valgrind_out.log ./a.out

交流合作

QQ群:817328828

本项目致力于打造为一个拥有丰富例子的仓库。

有各种有趣的场景或者idea可以直接提交issues。

已有资源

  • array

    • mismatch_arrayLength
  • class

    • copy_useDeepCopy
    • polymorphism_memoryTruncation
    • polymorphism_upcasting
    • polymorphism_vptr
    • polymorphism_withoutVirtualDestructor
  • delete-free

    • dereference_useWhenGetStorage
    • doubleFree
    • forget_freeOrDelete
    • invalidFree
    • mismatch_delete
    • mismatch_freeAndDelete
  • exception

    • exception_evaluationOrder
  • null-pointer

    • invalidAddress
  • reference

    • reference_extendTheLifeCycle
  • smartptr

    • circular-reference_00
    • circular-reference_01
  • stl

    • pointer-element
    • vector-bool
  • ~other

    • mismatch_byteLength
    • parameterList
    • recursive
    • union



END

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值