Xcode - 涂鸦,防护边缘和防护malloc [英] Xcode - scribble, guard edges and guard malloc

查看:340
本文介绍了Xcode - 涂鸦,防护边缘和防护malloc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以解释Xcode中这些选项的作用吗?

Can someone explain what do these options in Xcode do?


  • 启用Scribble

  • 启用Guard Edge

  • 启用Guard Malloc

它们是什么,它们做了什么以及它们有多大用处它们用于调试/测试?

what they are and what they do and how useful can they be for debugging/testing?

谢谢。

推荐答案

来自文档


  • 启用Scribble。用0xAA填充已分配的内存,用0x55填充已释放的内存。

  • 启用Guard Edge。在大量分配之前和之后添加保护页面。

  • 启用Guard Malloc。使用libgmalloc来捕获常见的内存问题,例如缓冲区溢出和释放后使用。

Scribble将使你很明显通过覆盖过去在存储器块中的任何数据来释放后,重新使用内存块。

Guard边缘和Guard Malloc将帮助您查找内存溢出和(在某种程度上)通过读写保护内存块来释放后使用,如果误用内存,会使程序崩溃更明显。

Scribble will make it rather obvious that you're using a memory block after it's free'd by overwriting any data that used to be in the memory block upon free.
Guard edges and Guard Malloc will help you find memory overruns and (to some extent) use-after-free by read and write protecting memory blocks to make your program crash more obviously if misusing memory.

这篇关于Xcode - 涂鸦,防护边缘和防护malloc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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