Merge "Migrate perf-critical functions away from librs."
diff --git a/driver/rsdRuntimeStubs.cpp b/driver/rsdRuntimeStubs.cpp
index d8050ac..90c8928 100644
--- a/driver/rsdRuntimeStubs.cpp
+++ b/driver/rsdRuntimeStubs.cpp
@@ -42,41 +42,6 @@
 // Allocation
 //////////////////////////////////////////////////////////////////////////////
 
-static uint32_t SC_allocGetDimX(Allocation *a) {
-    return a->mHal.state.dimensionX;
-}
-
-static uint32_t SC_allocGetDimY(Allocation *a) {
-    return a->mHal.state.dimensionY;
-}
-
-static uint32_t SC_allocGetDimZ(Allocation *a) {
-    return a->mHal.state.dimensionZ;
-}
-
-static uint32_t SC_allocGetDimLOD(Allocation *a) {
-    return a->mHal.state.hasMipmaps;
-}
-
-static uint32_t SC_allocGetDimFaces(Allocation *a) {
-    return a->mHal.state.hasFaces;
-}
-
-static const void * SC_getElementAtX(Allocation *a, uint32_t x) {
-    const uint8_t *p = (const uint8_t *)a->getPtr();
-    return &p[a->mHal.state.elementSizeBytes * x];
-}
-
-static const void * SC_getElementAtXY(Allocation *a, uint32_t x, uint32_t y) {
-    const uint8_t *p = (const uint8_t *)a->getPtr();
-    return &p[a->mHal.state.elementSizeBytes * (x + y * a->mHal.state.dimensionX)];
-}
-
-static const void * SC_getElementAtXYZ(Allocation *a, uint32_t x, uint32_t y, uint32_t z) {
-    const uint8_t *p = (const uint8_t *)a->getPtr();
-    return &p[a->mHal.state.elementSizeBytes * (x + y * a->mHal.state.dimensionX +
-              z * a->mHal.state.dimensionX * a->mHal.state.dimensionY)];
-}
 
 static void SC_AllocationSyncAll2(Allocation *a, RsAllocationUsageType source) {
     GET_TLS();
@@ -115,12 +80,6 @@
 }
 
 
-const Allocation * SC_getAllocation(const void *ptr) {
-    GET_TLS();
-    return rsrGetAllocation(rsc, sc, ptr);
-}
-
-
 //////////////////////////////////////////////////////////////////////////////
 // Context
 //////////////////////////////////////////////////////////////////////////////
@@ -599,18 +558,6 @@
     { "_Z10rsIsObject7rs_font", (void *)&SC_IsObject, true },
 
     // Allocation ops
-    { "_Z19rsAllocationGetDimX13rs_allocation", (void *)&SC_allocGetDimX, true },
-    { "_Z19rsAllocationGetDimY13rs_allocation", (void *)&SC_allocGetDimY, true },
-    { "_Z19rsAllocationGetDimZ13rs_allocation", (void *)&SC_allocGetDimZ, true },
-    { "_Z21rsAllocationGetDimLOD13rs_allocation", (void *)&SC_allocGetDimLOD, true },
-    { "_Z23rsAllocationGetDimFaces13rs_allocation", (void *)&SC_allocGetDimFaces, true },
-
-    { "_Z14rsGetElementAt13rs_allocationj", (void *)&SC_getElementAtX, true },
-    { "_Z14rsGetElementAt13rs_allocationjj", (void *)&SC_getElementAtXY, true },
-    { "_Z14rsGetElementAt13rs_allocationjjj", (void *)&SC_getElementAtXYZ, true },
-
-    { "_Z15rsGetAllocationPKv", (void *)&SC_getAllocation, true },
-
     { "_Z21rsAllocationMarkDirty13rs_allocation", (void *)&SC_AllocationSyncAll, true },
     { "_Z20rsgAllocationSyncAll13rs_allocation", (void *)&SC_AllocationSyncAll, false },
     { "_Z20rsgAllocationSyncAll13rs_allocationj", (void *)&SC_AllocationSyncAll2, false },
diff --git a/rsAllocation.h b/rsAllocation.h
index f538dd1..f2589c0 100644
--- a/rsAllocation.h
+++ b/rsAllocation.h
@@ -25,8 +25,16 @@
 
 class Program;
 
+/*****************************************************************************
+ * CAUTION
+ *
+ * Any layout changes for this class may require a corresponding change to be
+ * made to frameworks/compile/libbcc/lib/ScriptCRT/rs_core.c, which contains
+ * a partial copy of the information below.
+ *
+ *****************************************************************************/
 class Allocation : public ObjectBase {
-    // The graphics equilivent of malloc.  The allocation contains a structure of elements.
+    // The graphics equivalent of malloc.  The allocation contains a structure of elements.
 
 public:
     struct Hal {