summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsContext.h
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2010-09-30 18:15:52 -0700
committerJason Sams <rjsams@android.com>2010-09-30 18:15:52 -0700
commitf166d9b5a280f0ec2ce7e089471c20a1477e2dbb (patch)
tree9046963393d9ebc040cf50eb6c4f921130dd2b89 /libs/rs/rsContext.h
parent3cfc508f4ec535b47ffbb587b32a8846c37338cc (diff)
downloadframeworks_base-f166d9b5a280f0ec2ce7e089471c20a1477e2dbb.zip
frameworks_base-f166d9b5a280f0ec2ce7e089471c20a1477e2dbb.tar.gz
frameworks_base-f166d9b5a280f0ec2ce7e089471c20a1477e2dbb.tar.bz2
Add object validity checking.
Change-Id: I2613e87b09a6e560f0381d4ed620d60a10bc30e4
Diffstat (limited to 'libs/rs/rsContext.h')
-rw-r--r--libs/rs/rsContext.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/rs/rsContext.h b/libs/rs/rsContext.h
index 2e84930..f90e4af 100644
--- a/libs/rs/rsContext.h
+++ b/libs/rs/rsContext.h
@@ -49,6 +49,24 @@ namespace android {
namespace renderscript {
+#if 0
+#define CHECK_OBJ(o) { \
+ GET_TLS(); \
+ if(!ObjectBase::isValid(rsc, (const ObjectBase *)o)) { \
+ LOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \
+ } \
+}
+#define CHECK_OBJ_OR_NULL(o) { \
+ GET_TLS(); \
+ if(o && !ObjectBase::isValid(rsc, (const ObjectBase *)o)) { \
+ LOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \
+ } \
+}
+#else
+#define CHECK_OBJ(o)
+#define CHECK_OBJ_OR_NULL(o)
+#endif
+
class Context
{
public:
@@ -64,6 +82,7 @@ public:
Context * mContext;
Script * mScript;
};
+ ScriptTLSStruct *mTlsStruct;
typedef void (*WorkerCallback_t)(void *usr, uint32_t idx);