<commit_before>#include <stdio.h>
#include <string.h>
#include <raaz/primitives/config.h>

#ifdef RAAZ_HAVE_mlock
#include <sys/mman.h>
#endif

#ifdef RAAZ_HAVE_memalign
#include <stdlib.h>
#include <unistd.h>
#endif

char * getLine (char*, size_t);
void wipememory (void*, size_t);
void * createpool(size_t);
void freepool(void*, size_t);
int memorylock(void*, size_t);
void memoryunlock(void*, size_t);


/* Make this unbuffered and handle case when line is more that len */
char * getLine(char* line, size_t len){
  getline(&line, &len, stdin);
  return line;
}

/* Wipes the entire memory with 0 */
void wipememory (void* mem, size_t size){
  memset(mem, 0, size);
}

/* Creates the page aligned memory */
void * createpool(size_t size){
#ifdef RAAZ_HAVE_memalign
  void *o;
  posix_memalign(&o,getpagesize(),size);
  return o;
#endif
}
<commit_msg>volatile: keep gcc from optimising off memset calls<commit_after>#include <stdio.h>
#include <string.h>
#include <raaz/primitives/config.h>

#ifdef RAAZ_HAVE_mlock
#include <sys/mman.h>
#endif

#ifdef RAAZ_HAVE_memalign
#include <stdlib.h>
#include <unistd.h>
#endif

char * getLine (char*, size_t);
void wipememory (volatile void*, size_t);
void * createpool(size_t);
void freepool(void*, size_t);
int memorylock(void*, size_t);
void memoryunlock(void*, size_t);


/* Make this unbuffered and handle case when line is more that len */
char * getLine(char* line, size_t len){
  getline(&line, &len, stdin);
  return line;
}

/* Wipes the entire memory with 0. */
void wipememory ( volatile void* mem, /* volatile is used to keep the
                                      ** compiler from optimising
                                      ** stuff.
                                      ** BIG QUESTION: Is this
                                      ** sufficient?
				      */
		  size_t size
                )
{
    /* WARNING: Potentially dangerous code. Please audit all changes
    ** carefully.
    */
    memset(mem, 0, size);
}

/* Creates the page aligned memory */
void * createpool(size_t size){
#ifdef RAAZ_HAVE_memalign
  void *o;
  posix_memalign(&o,getpagesize(),size);
  return o;
#endif
}

{'fraction_non_alphanumeric': 0.12331942512749189, 'fraction_numerical': 0.0018544274455261937, 'mean_word_length': 3.118320610687023, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1855591', 'n_tokens_mistral': 763, 'n_tokens_neox': 727, 'n_words': 213}