<commit_before>#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#ifndef NO_MEM_USAGE
# include <malloc.h>
#endif

#define M 14000000
#define N 14000000
#define SIZE	32

struct foo {
    char p[SIZE];
};

static struct foo blue = { "foobarflubar" };

unsigned long long int diff(struct timespec t1, struct timespec t2) {
    return (t2.tv_sec - t1.tv_sec) * 1000000000ULL + (t2.tv_nsec - t1.tv_nsec);
}

void shuffle(uint32_t * array, size_t n)
{
    if (n > 1) {
        size_t i;
	for (i = 0; i < n - 1; i++) {
	  size_t j = i + rand() / (RAND_MAX / (n - i) + 1);
	  uint32_t t = array[j];
	  array[j] = array[i];
	  array[i] = t;
	}
    }
}

void **p;
size_t mdiff = 0, fdiff = 0;
uint32_t num_pages = 0;
size_t bytes = 0, bytes_base;
TEST_INIT(foo);

#ifndef NO_MEM_USAGE
static inline size_t used_bytes(const struct mallinfo info) {
    return (size_t)info.uordblks + (size_t)info.hblkhd;
}
#endif

long int run2(long int n, uint32_t * shuffler) {
    long int i, j;
    struct timespec t1, t2;
    long int runs = N/n;

    clock_gettime(CLOCK_MONOTONIC, &t1);
    for (i = 0; i < runs; i++) {
	for (j = 0; j < n; j++) {
	    p[j] = TEST_ALLOC(foo);
	}
	for (j = 0; j < n; j++) {
	    long int k = shuffler[j];
	    TEST_FREE(foo, p[k]);
	}
    }
    clock_gettime(CLOCK_MONOTONIC, &t2);
    mdiff += diff(t1, t2);

    // get memory use
    for (j = 0; j < n; j++) {
	p[j] = TEST_ALLOC(foo);
    }
    TEST_NUM_PAGES(foo, num_pages);
#ifndef NO_MEM_USAGE
    bytes = used_bytes(mallinfo()) - bytes_base;
#endif
    for (j = 0; j < n; j++) {
	long int k = shuffler[j];
	TEST_FREE(foo, p[k]);
    }

    return runs * n;
}

int main(int argc, char ** argv) {
    long int i;
    p = (void**)malloc(sizeof(void*) * N);
    uint32_t * map = (uint32_t*)malloc(sizeof(uint32_t) * N);
    srand ( time(NULL) );
    long int loops;

#ifndef REAL_RANDOM
# ifdef SEED
    srand(SEED);
# else
    srand(0xaeaeaeaf);
# endif
#endif<commit_msg>removed warnings<commit_after>#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#ifndef NO_MEM_USAGE
# include <malloc.h>
#endif

#define M 14000000
#define N 14000000
#define SIZE	32

struct foo {
    char p[SIZE];
};

unsigned long long int diff(struct timespec t1, struct timespec t2) {
    return (t2.tv_sec - t1.tv_sec) * 1000000000ULL + (t2.tv_nsec - t1.tv_nsec);
}

void shuffle(uint32_t * array, size_t n)
{
    if (n > 1) {
        size_t i;
	for (i = 0; i < n - 1; i++) {
	  size_t j = i + rand() / (RAND_MAX / (n - i) + 1);
	  uint32_t t = array[j];
	  array[j] = array[i];
	  array[i] = t;
	}
    }
}

void **p;
size_t mdiff = 0, fdiff = 0;
uint32_t num_pages = 0;
size_t bytes = 0, bytes_base;
TEST_INIT(foo);

#ifndef NO_MEM_USAGE
static inline size_t used_bytes(const struct mallinfo info) {
    return (size_t)info.uordblks + (size_t)info.hblkhd;
}
#endif

long int run2(long int n, uint32_t * shuffler) {
    long int i, j;
    struct timespec t1, t2;
    long int runs = N/n;

    clock_gettime(CLOCK_MONOTONIC, &t1);
    for (i = 0; i < runs; i++) {
	for (j = 0; j < n; j++) {
	    p[j] = TEST_ALLOC(foo);
	}
	for (j = 0; j < n; j++) {
	    long int k = shuffler[j];
	    TEST_FREE(foo, p[k]);
	}
    }
    clock_gettime(CLOCK_MONOTONIC, &t2);
    mdiff += diff(t1, t2);

    // get memory use
    for (j = 0; j < n; j++) {
	p[j] = TEST_ALLOC(foo);
    }
    TEST_NUM_PAGES(foo, num_pages);
#ifndef NO_MEM_USAGE
    bytes = used_bytes(mallinfo()) - bytes_base;
#endif
    for (j = 0; j < n; j++) {
	long int k = shuffler[j];
	TEST_FREE(foo, p[k]);
    }

    return runs * n;
}

int main(int argc, char ** argv) {
    long int i;
    p = (void**)malloc(sizeof(void*) * N);
    uint32_t * map = (uint32_t*)malloc(sizeof(uint32_t) * N);
    srand ( time(NULL) );

#ifndef REAL_RANDOM
# ifdef SEED
    srand(SEED);
# else
    srand(0xaeaeaeaf);
# endif
#endif
{'fraction_non_alphanumeric': 0.15996928589710777, 'fraction_numerical': 0.03532121832608139, 'mean_word_length': 2.979633401221996, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '1395848', 'n_tokens_mistral': 1811, 'n_tokens_neox': 1684, 'n_words': 440}