<commit_before>#ifndef AUDIT_H_HEADER_INCLUDED
#define AUDIT_H_HEADER_INCLUDED

/*
 * This code is a (hopefully) nearly transparent way to keep track of
 * memory allocations and deallocations, to make finding memory leaks
 * easier.  GCC is required (for the __FUNCTION__ preprocessor macro).
 *
 * To use it, define DEBUG_ALLOCS before including this header, and call
 * print_unfreed_mem() whenever an audit is desired, like so:
 *
 * #ifdef DEBUG_ALLOCS
 * print_unfreed_mem();
 * #endif
 */

#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "ashash.h"

#ifndef DEBUG_ALLOCS
#define AS_ASSERT(p)            ((p)==NULL)
#define PRINT_MEM_STATS(m)      do{}while(0)
#else

#define AS_ASSERT(p) as_assert(p,__FILE__, __LINE__ ,__FUNCTION__)

#define malloc(a) countmalloc(__FUNCTION__, __LINE__, a)
#define safemalloc(a) countmalloc(__FUNCTION__, __LINE__, a)
#define safecalloc(a,b) countcalloc(__FUNCTION__, __LINE__, a, b)<commit_msg>started documenting libAfterImage<commit_after>#ifndef AUDIT_H_HEADER_INCLUDED
#define AUDIT_H_HEADER_INCLUDED

/*
 * This code is a (hopefully) nearly transparent way to keep track of
 * memory allocations and deallocations, to make finding memory leaks
 * easier.  GCC is required (for the __FUNCTION__ preprocessor macro).
 *
 * To use it, define DEBUG_ALLOCS before including this header, and call
 * print_unfreed_mem() whenever an audit is desired, like so:
 *
 * #ifdef DEBUG_ALLOCS
 * print_unfreed_mem();
 * #endif
 */

#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "ashash.h"

#ifndef DEBUG_ALLOCS

#define AS_ASSERT(p)            ((p)==NULL)
#define PRINT_MEM_STATS(m)      do{}while(0)
#else

#define AS_ASSERT(p) as_assert(p,__FILE__, __LINE__ ,__FUNCTION__)

#define malloc(a) countmalloc(__FUNCTION__, __LINE__, a)
#define safemalloc(a) countmalloc(__FUNCTION__, __LINE__, a)
#define safecalloc(a,b) countcalloc(__FUNCTION__, __LINE__, a, b)
{'fraction_non_alphanumeric': 0.10694087403598972, 'fraction_numerical': 0.005141388174807198, 'mean_word_length': 5.443708609271523, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2717021', 'n_tokens_mistral': 686, 'n_tokens_neox': 662, 'n_words': 191}