summaryrefslogtreecommitdiff
path: root/libs/rs/rsScriptC_Lib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/rs/rsScriptC_Lib.cpp')
-rw-r--r--libs/rs/rsScriptC_Lib.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp
index 0e094748c4a1..19dfaffcb548 100644
--- a/libs/rs/rsScriptC_Lib.cpp
+++ b/libs/rs/rsScriptC_Lib.cpp
@@ -1113,6 +1113,14 @@ int SC_divsi3(int a, int b)
return a / b;
}
+int SC_getAllocation(const void *ptr)
+{
+ GET_TLS();
+ const Allocation *alloc = sc->ptrToAllocation(ptr);
+ return (int)alloc;
+}
+
+
//////////////////////////////////////////////////////////////////////////////
// Class implementation
//////////////////////////////////////////////////////////////////////////////
@@ -1368,6 +1376,8 @@ ScriptCState::SymbolTable_t ScriptCState::gSyms[] = {
{ "debugPi", (void *)&SC_debugPi },
{ "scriptCall", (void *)&SC_scriptCall },
+ { "rsGetAllocation", (void *)&SC_getAllocation },
+
{ NULL, NULL }
};