summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/wtf/StdLibExtras.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-03 09:55:33 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-03 09:55:33 +0100
commitcd44dc59cdfc39534aef4d417e9f3c412e3be139 (patch)
tree8d89889ba95ed6ec9322e733846cc9cce9d7dff1 /Source/JavaScriptCore/wtf/StdLibExtras.h
parentd11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (diff)
downloadqtwebkit-cd44dc59cdfc39534aef4d417e9f3c412e3be139.tar.gz
Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560)
Diffstat (limited to 'Source/JavaScriptCore/wtf/StdLibExtras.h')
-rw-r--r--Source/JavaScriptCore/wtf/StdLibExtras.h9
1 files changed, 9 insertions, 0 deletions
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;