Webkit中0xbbadbeef的作用是什么? [英] What is 0xbbadbeef used for in Webkit?

查看:145
本文介绍了Webkit中0xbbadbeef的作用是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Webkit时,我遇到了一个指针设置为0xbbadbeef的错误. 在Webkit中,BadBeef有什么用途?

While working with Webkit I encountered an error with a pointer set to 0xbbadbeef. What is BadBeef used for in Webkit?

推荐答案

这是WebKit中使用的十六进制,它表示已知的,不可恢复的错误,例如内存不足.

It is a hexspeak used in WebKit and, it indicates a known, unrecoverable error such as out of memory.

如您从链接 https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/wtf/Assertions.h&l=180

/* CRASH() - Raises a fatal error resulting in program termination and triggering either the debugger or the crash reporter.

   Use CRASH() in response to known, unrecoverable errors like out-of-memory.
   Macro is enabled in both debug and release mode.
   To test for unknown errors and verify assumptions, use ASSERT instead, to avoid impacting performance in release builds.

   Signals are ignored by the crash reporter on OS X so we must do better.
*/
#ifndef CRASH
#if COMPILER(MSVC)
#define CRASH() (__debugbreak(), IMMEDIATE_CRASH())
#else
#define CRASH() \
    (WTFReportBacktrace(), (*(int*)0xfbadbeef = 0), IMMEDIATE_CRASH())
#endif
#endif

这篇关于Webkit中0xbbadbeef的作用是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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