<commit_before>#include <stdlib.h>

#include <jni.h>
#include "jniutil.h"
jfieldID getLongFieldId(ST_ARGS, const char * fieldName)
{
	jclass clazz=env->GetObjectClass(obj);
	jfieldID fieldId=env->GetFieldID(clazz, fieldName, "J");
	env->DeleteLocalRef(clazz);
	return fieldId;
}

void * getStruct(ST_ARGS, const char * fieldName)
{
	jfieldID fieldId=getLongFieldId(env, obj, fieldName);
	jlong ptr=env->GetLongField(obj, fieldId);
	return (void *)ptr;
}
void initObj(ST_ARGS, const char * fieldName, int size)
{
	jfieldID fieldId=getLongFieldId(env, obj, fieldName);
	void * str=(void *)calloc(size, 1);
	env->SetLongField(obj, fieldId, (long)str);
}

void disposeObj(ST_ARGS, const char * fieldName)
{
 void * ptr=getStruct(env, obj, fieldName);
 free(ptr);
}


void JNU_ThrowByName(JNIEnv *env, const char *name, const char *msg)
{
	jclass cls = env->FindClass(name);
	/* if cls is NULL, an exception has already been thrown */
	if (cls != NULL)
	{
		env->ThrowNew(cls, msg);
	}
	/* free the local ref */
	env->DeleteLocalRef(cls);
}


<commit_msg>jniutil long->jlong<commit_after>#include <stdlib.h>

#include <jni.h>
#include "jniutil.h"
jfieldID getLongFieldId(ST_ARGS, const char * fieldName)
{
	jclass clazz=env->GetObjectClass(obj);
	jfieldID fieldId=env->GetFieldID(clazz, fieldName, "J");
	env->DeleteLocalRef(clazz);
	return fieldId;
}

void * getStruct(ST_ARGS, const char * fieldName)
{
	jfieldID fieldId=getLongFieldId(env, obj, fieldName);
	jlong ptr=env->GetLongField(obj, fieldId);
	return (void *)ptr;
}
void initObj(ST_ARGS, const char * fieldName, int size)
{
	jfieldID fieldId=getLongFieldId(env, obj, fieldName);
	void * str=(void *)calloc(size, 1);
	env->SetLongField(obj, fieldId, (jlong)str);
}

void disposeObj(ST_ARGS, const char * fieldName)
{
 void * ptr=getStruct(env, obj, fieldName);
 free(ptr);
}


void JNU_ThrowByName(JNIEnv *env, const char *name, const char *msg)
{
	jclass cls = env->FindClass(name);
	/* if cls is NULL, an exception has already been thrown */
	if (cls != NULL)
	{
		env->ThrowNew(cls, msg);
	}
	/* free the local ref */
	env->DeleteLocalRef(cls);
}



{'fraction_non_alphanumeric': 0.14807783578547698, 'fraction_numerical': 0.0009492168960607499, 'mean_word_length': 5.407294832826747, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4733264', 'n_tokens_mistral': 812, 'n_tokens_neox': 804, 'n_words': 191}