<commit_before>#define _EMMA_MEMTABLE_SRC_
#include "memtable.h"
#include "emma.h"

#include <string.h>
#include <stdio.h>

void init_memory_table(size_t blkSize)
{
    int base, i;

    printf("init_memory_table(%zu)\n", blkSize);
    
    base = emma_log2(blkSize) + 1;
    printf("base=%d\n", base);
    
    if(memory_table == 0) {
        // init list
        memory_table = (memory_page**) calloc(base, sizeof(memory_page*));
    } 
    
    if(memory_table_len < base) {
        // enlarge list
        memory_table = (memory_page**) realloc(memory_table, base*sizeof(memory_page*));
        memset(memory_table+(memory_table_len+1), 
               0, 
               (base-memory_table_len)*sizeof(memory_page*));
    }

    printf("initialisng first pages...\n");

    for(i=memory_table_len+1; i<=(base-1); ++i) {
	printf("fp base = %d\n", i);
        append_memory_page(init_memory_page(emma_nextp2(i)), i);
    }
<commit_msg>fix invalid memset... it is not necessary<commit_after>#define _EMMA_MEMTABLE_SRC_
#include "memtable.h"
#include "emma.h"

#include <string.h>
#include <stdio.h>

void init_memory_table(size_t blkSize)
{
    int base, i;

    printf("init_memory_table(%zu)\n", blkSize);
    
    base = emma_log2(blkSize) + 1;
    printf("base=%d\n", base);
    
    if(memory_table == 0) {
        // init list
        memory_table = (memory_page**) calloc(base, sizeof(memory_page*));
    } 
    
    if(memory_table_len < base) {
        // enlarge list
        memory_table = (memory_page**) realloc(memory_table, base*sizeof(memory_page*));
        /*memset(memory_table+(memory_table_len+1), 
               0, 
               (base-memory_table_len)*sizeof(memory_page*));*/
    }

    printf("initialisng first pages...\n");

    for(i=memory_table_len+1; i<=(base-1); ++i) {
	printf("fp base = %d\n", i);
        append_memory_page(init_memory_page(emma_nextp2(i)), i);
    }

{'fraction_non_alphanumeric': 0.15670859538784068, 'fraction_numerical': 0.008385744234800839, 'mean_word_length': 2.993723849372385, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '6023176', 'n_tokens_mistral': 716, 'n_tokens_neox': 690, 'n_words': 114}