#3718, #3717: Add check for SSE 4.2 and PCLMUL support to native zlib

This commit is contained in:
lax1dude
2024-08-08 18:19:20 +10:00
committed by md_5
parent e49759025f
commit 6b612302e1
10 changed files with 73 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
#include <zlib.h>
#include "shared.h"
#include "cpuid_helper.h"
#include "net_md_5_bungee_jni_zlib_NativeCompressImpl.h"
typedef unsigned char byte;
@@ -26,6 +27,10 @@ jint throwException(JNIEnv *env, const char* message, int err) {
return (*env)->Throw(env, throwable);
}
JNIEXPORT jboolean JNICALL Java_net_md_15_bungee_jni_zlib_NativeCompressImpl_checkSupported(JNIEnv* env, jobject obj) {
return (jboolean) checkCompressionNativesSupport();
}
void JNICALL Java_net_md_15_bungee_jni_zlib_NativeCompressImpl_reset(JNIEnv* env, jobject obj, jlong ctx, jboolean compress) {
z_stream* stream = (z_stream*) ctx;
int ret = (compress) ? deflateReset(stream) : inflateReset(stream);