Move DS caching from user level to the HAL (#1143)

Also switch eventName and gameSpecificData to fixed 64-byte arrays to avoid mallocs and
extra NetComm calls.  This behavior matches 2018 LabView.

The DS caching is kept in Java to avoid JNI and/or massive amounts of allocations.
This does not increase latency because Java still only hits NetComm once.

Moving the DS caching benefits all languages other than Java, because it avoids the need
for individual implementations.  If caching is ever added to NetComm, it will then only be
necessary to remove it from the HAL and Java rather than all languages.
This commit is contained in:
Thad House
2018-07-18 22:22:41 -07:00
committed by Peter Johnson
parent 0b5df467e1
commit fe5d7dd6ba
11 changed files with 405 additions and 391 deletions

View File

@@ -256,10 +256,13 @@ void SetMatchInfoObject(JNIEnv* env, jobject matchStatus,
env->GetMethodID(matchInfoDataCls, "setData",
"(Ljava/lang/String;Ljava/lang/String;III)V");
env->CallVoidMethod(matchStatus, func, MakeJString(env, matchInfo.eventName),
MakeJString(env, matchInfo.gameSpecificMessage),
(jint)matchInfo.matchNumber, (jint)matchInfo.replayNumber,
(jint)matchInfo.matchType);
env->CallVoidMethod(
matchStatus, func, MakeJString(env, matchInfo.eventName),
MakeJString(env, wpi::StringRef{reinterpret_cast<const char*>(
matchInfo.gameSpecificMessage),
matchInfo.gameSpecificMessageSize}),
(jint)matchInfo.matchNumber, (jint)matchInfo.replayNumber,
(jint)matchInfo.matchType);
}
void SetAccumulatorResultObject(JNIEnv* env, jobject accumulatorResult,