<commit_before>/* headers.h
 *  Copyright: (When this is determined...it will go here)
 *  CVS Info
 *     $Id$
 *  Overview:
 *     Header management functions. Handles getting of various headers, and pool creation
 *  Data Structure and Algorithms:
 *  History:
 *  Notes:
 *  References:
 */

#if !defined(PARROT_BUFFERS_H_GUARD)
#define PARROT_BUFFERS_H_GUARD

#include "parrot/parrot.h"

#define BUFFER_ALIGNMENT 16
#define STRING_ALIGNMENT 4


static void *
get_from_free_pool(struct Parrot_Interp *interpreter,
                   struct Small_Object_Pool *pool)
{
    return (*pool->get_free_object)(interpreter, pool);
}
static void
add_to_free_pool(struct Parrot_Interp *interpreter, struct Small_Object_Pool *pool, void* free)
{
    (*pool->add_free_object)(interpreter, pool, free);
}

/** Header Management Functions **/

/* pmc header small-object methods */
void add_free_pmc(struct Parrot_Interp *interpreter, struct Small_Object_Pool *pool, void *pmc);
void *get_free_pmc(struct Parrot_Interp *interpreter, struct Small_Object_Pool *pool);
void alloc_more_pmcs(struct Parrot_Interp *interpreter, struct Small_Object_Pool *pool);

/* buffer header small-object methods */
void add_free_buffer(struct Parrot_Interp *interpreter, struct Small_Object_Pool *pool, void *buffer);
void *get_free_buffer(struct Parrot_Interp *interpreter, struct Small_Object_Pool *pool);
void alloc_more_buffers(struct Parrot_Interp *interpreter, struct Small_Object_Pool *pool);

/* pool creation and access functions */
struct Small_Object_Pool *new_pmc_pool(struct Parrot_Interp *interpreter);
struct Small_Object_Pool *new_bufferlike_pool(struct Parrot_Interp *interpreter, size_t unit_size);
struct Small_Object_Pool *new_buffer_pool(struct Parrot_Interp *interpreter);<commit_msg>Changed 'free' to 'to_free' to avoid naming conflicts<commit_after>/* headers.h
 *  Copyright: (When this is determined...it will go here)
 *  CVS Info
 *     $Id$
 *  Overview:
 *     Header management functions. Handles getting of various headers, and pool creation
 *  Data Structure and Algorithms:
 *  History:
 *  Notes:
 *  References:
 */

#if !defined(PARROT_BUFFERS_H_GUARD)
#define PARROT_BUFFERS_H_GUARD

#include "parrot/parrot.h"

#define BUFFER_ALIGNMENT 16
#define STRING_ALIGNMENT 4


static void *
get_from_free_pool(struct Parrot_Interp *interpreter,
                   struct Small_Object_Pool *pool)
{
    return (*pool->get_free_object)(interpreter, pool);
}
static void
add_to_free_pool(struct Parrot_Interp *interpreter, struct Small_Object_Pool *pool, void* to_free)
{
    (*pool->add_free_object)(interpreter, pool, to_free);
}

/** Header Management Functions **/

/* pmc header small-object methods */
void add_free_pmc(struct Parrot_Interp *interpreter, struct Small_Object_Pool *pool, void *pmc);
void *get_free_pmc(struct Parrot_Interp *interpreter, struct Small_Object_Pool *pool);
void alloc_more_pmcs(struct Parrot_Interp *interpreter, struct Small_Object_Pool *pool);

/* buffer header small-object methods */
void add_free_buffer(struct Parrot_Interp *interpreter, struct Small_Object_Pool *pool, void *buffer);
void *get_free_buffer(struct Parrot_Interp *interpreter, struct Small_Object_Pool *pool);
void alloc_more_buffers(struct Parrot_Interp *interpreter, struct Small_Object_Pool *pool);

/* pool creation and access functions */
struct Small_Object_Pool *new_pmc_pool(struct Parrot_Interp *interpreter);
struct Small_Object_Pool *new_bufferlike_pool(struct Parrot_Interp *interpreter, size_t unit_size);
struct Small_Object_Pool *new_buffer_pool(struct Parrot_Interp *interpreter);
{'fraction_non_alphanumeric': 0.08883953359244864, 'fraction_numerical': 0.001665741254858412, 'mean_word_length': 6.064705882352941, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7115724', 'n_tokens_mistral': 1165, 'n_tokens_neox': 1175, 'n_words': 300}