From cd44dc59cdfc39534aef4d417e9f3c412e3be139 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 3 Feb 2012 09:55:33 +0100 Subject: Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560) --- Source/JavaScriptCore/wtf/StdLibExtras.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Source/JavaScriptCore/wtf/StdLibExtras.h') diff --git a/Source/JavaScriptCore/wtf/StdLibExtras.h b/Source/JavaScriptCore/wtf/StdLibExtras.h index 3f99c4d3f..e4d7c8fc0 100644 --- a/Source/JavaScriptCore/wtf/StdLibExtras.h +++ b/Source/JavaScriptCore/wtf/StdLibExtras.h @@ -107,6 +107,13 @@ TypePtr reinterpret_cast_ptr(const void* ptr) namespace WTF { +static const size_t KB = 1024; + +inline bool isPointerAligned(void* p) +{ + return !((intptr_t)(p) & (sizeof(char*) - 1)); +} + /* * C++'s idea of a reinterpret_cast lacks sufficient cojones. */ @@ -283,6 +290,8 @@ inline void* operator new(size_t, NotNullTag, void* location) return location; } +using WTF::KB; +using WTF::isPointerAligned; using WTF::binarySearch; using WTF::bitwise_cast; using WTF::safeCast; -- cgit v1.2.1