Rename unused fields of RS base object handle in 64-bits Fields other than the first one (p) in RS_BASE_OBJECT are set in some part of existing RS runtime, but is not used at all. However, removing them is not desirable as size of RS_BASE_OBJECT is really part of the ABI and thus if we change it, we are creating a new ABI variant here, which is not always desirable. For example, consider a library that contains compiled scripts and assuming we pass allocation handles between the library and other user codes, changes to handle size only in user code would break the compatibility on things like array of rs_allocations. Thus, to keep ABI compatibility the unused fields r, v1, v2 are renamed. Also they are now assigned zero consistently. These field however are not copied consistently in the current runtime, and are not expected so anyways. Bug: 35043722 Test: mm, CTS and RSTest on Angler Change-Id: I426fad8e07bf445b6d8625bd23c689acaee26322
diff --git a/driver/rsdBcc.cpp b/driver/rsdBcc.cpp index d9aec53..0e07aaf 100644 --- a/driver/rsdBcc.cpp +++ b/driver/rsdBcc.cpp
@@ -183,12 +183,8 @@ { obj->p = script; #ifdef __LP64__ - obj->r = nullptr; - if (script != nullptr) { - obj->v1 = script->mHal.drv; - } else { - obj->v1 = nullptr; - } - obj->v2 = nullptr; + obj->unused1 = nullptr; + obj->unused2 = nullptr; + obj->unused3 = nullptr; #endif }