<commit_before>#include <stdio.h>
#include <stdlib.h>     // for exit()
#include <fcntl.h>      // for open()
#include <unistd.h>     // for close()
#include <sys/stat.h>   // for fstat()
#include <ctype.h>      // for isdigit()
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/file.h>

#ifdef __MTA__
#include <machine/runtime.h>
#include <luc/luc_common.h>
#include <snapshot/client.h>
#include <sys/mta_task.h>


typedef int int64;
typedef unsigned uint64;
#else
#include <sys/time.h>

typedef long int int64;
typedef long unsigned uint64;
#endif

// How to use the counters:
// 1) malloc space for as many counters as you need
//    int numCounters = 7;
//    int *counters = mallocCounterMemory(numCounters);
// 2) Call getCounters(), specifying the particular address for storing the
//    counter values. Increment currCounter so that you don't overwrite values.
//    int currCounter = 0;
//    getCounters(counters, currCounter);
//    currCounter = currCounter + 1; // 1
// 3) Print the difference between the counters
//    printDiffCounters(counters, numCounters);
// 4) Free the memory storing the counter values
//    free(counters);
   



// --------------------------------- COUNTERS -------------------------------------
#define RT_ISSUES_IDX (0)
#define RT_MEMREFS_IDX (1)
#define RT_STREAMS_IDX (2)
#define RT_CONCURRENCY_IDX (3)
#define RT_CLOCK_IDX (4)
#define RT_PHANTOM_IDX (5)
#define RT_READY_IDX (6)
#define RT_TRAP_IDX (7)
#define NUM_RT_COUNTERS (RT_TRAP_IDX+1)

int *
mallocCounterMemory(int numCounters) {
#ifdef __MTA__
  int *counters = (int *)malloc(numCounters*(sizeof(int)*NUM_RT_COUNTERS));
  return counters;
#endif // __MTA__
}

void
freeCounterMemory(int *counters) {
#ifdef __MTA__
  free(counters);
#endif // __MTA__
}

bool countersInitialized = false;
int TrapCounter = -1;

void
initCounters()
{
#ifdef __MTA__
  TrapCounter = mta_reserve_task_event_counter(1, CNT_TRAP);
#endif // __MTA__
  countersInitialized = true;
}

void<commit_msg>thought we fixed this void return<commit_after>#include <stdio.h>
#include <stdlib.h>     // for exit()
#include <fcntl.h>      // for open()
#include <unistd.h>     // for close()
#include <sys/stat.h>   // for fstat()
#include <ctype.h>      // for isdigit()
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/file.h>

#ifdef __MTA__
#include <machine/runtime.h>
#include <luc/luc_common.h>
#include <snapshot/client.h>
#include <sys/mta_task.h>


typedef int int64;
typedef unsigned uint64;
#else
#include <sys/time.h>

typedef long int int64;
typedef long unsigned uint64;
#endif

// How to use the counters:
// 1) malloc space for as many counters as you need
//    int numCounters = 7;
//    int *counters = mallocCounterMemory(numCounters);
// 2) Call getCounters(), specifying the particular address for storing the
//    counter values. Increment currCounter so that you don't overwrite values.
//    int currCounter = 0;
//    getCounters(counters, currCounter);
//    currCounter = currCounter + 1; // 1
// 3) Print the difference between the counters
//    printDiffCounters(counters, numCounters);
// 4) Free the memory storing the counter values
//    free(counters);
   



// --------------------------------- COUNTERS -------------------------------------
#define RT_ISSUES_IDX (0)
#define RT_MEMREFS_IDX (1)
#define RT_STREAMS_IDX (2)
#define RT_CONCURRENCY_IDX (3)
#define RT_CLOCK_IDX (4)
#define RT_PHANTOM_IDX (5)
#define RT_READY_IDX (6)
#define RT_TRAP_IDX (7)
#define NUM_RT_COUNTERS (RT_TRAP_IDX+1)

int *
mallocCounterMemory(int numCounters) {
#ifdef __MTA__
  int *counters = (int *)malloc(numCounters*(sizeof(int)*NUM_RT_COUNTERS));
  return counters;
#else // __MTA__
  return NULL;
#endif
}

void
freeCounterMemory(int *counters) {
#ifdef __MTA__
  free(counters);
#endif // __MTA__
}

bool countersInitialized = false;
int TrapCounter = -1;

void
initCounters()
{
#ifdef __MTA__
  TrapCounter = mta_reserve_task_event_counter(1, CNT_TRAP);
#endif // __MTA__
  countersInitialized = true;
}

void
{'fraction_non_alphanumeric': 0.1568054541027514, 'fraction_numerical': 0.013148283418553688, 'mean_word_length': 3.4994523548740415, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '4720739', 'n_tokens_mistral': 1539, 'n_tokens_neox': 1463, 'n_words': 397}