Skip to content

Commit 66ccd3e

Browse files
ag2s20150909mglambda
authored andcommitted
android : fix llama_batch free (ggml-org#11014)
1 parent 4fef4e9 commit 66ccd3e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/llama.android/llama/src/main/cpp/llama-android.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ Java_android_llama_cpp_LLamaAndroid_new_1batch(JNIEnv *, jobject, jint n_tokens,
305305
extern "C"
306306
JNIEXPORT void JNICALL
307307
Java_android_llama_cpp_LLamaAndroid_free_1batch(JNIEnv *, jobject, jlong batch_pointer) {
308-
llama_batch_free(*reinterpret_cast<llama_batch *>(batch_pointer));
308+
//llama_batch_free(*reinterpret_cast<llama_batch *>(batch_pointer));
309+
const auto batch = reinterpret_cast<llama_batch *>(batch_pointer);
310+
delete batch;
309311
}
310312

311313
extern "C"

0 commit comments

Comments
 (0)