<commit_before>/* dod.h
 *  Copyright (C) 2001-2007, The Perl Foundation.
 *  SVN Info
 *     $Id$
 *  Overview:
 *     Handles dead object destruction of the various headers
 *  History:
 *     Initial version by <NAME> on 2002.05.27
 */

#ifndef PARROT_DOD_H_GUARD
#define PARROT_DOD_H_GUARD

#include "parrot/parrot.h"

/* Macros for recursively blocking and unblocking DOD */
#define Parrot_block_DOD(interp) \
        do { \
            (interp)->arena_base->DOD_block_level++; \
            Parrot_shared_DOD_block(interp); \
        } while (0)

#define Parrot_unblock_DOD(interp) \
        if ((interp)->arena_base->DOD_block_level) { \
            (interp)->arena_base->DOD_block_level--; \
            Parrot_shared_DOD_unblock(interp); \
        }

/* Macros for recursively blocking and unblocking GC */
#define Parrot_block_GC(interp) \
        (interp)->arena_base->GC_block_level++

#define Parrot_unblock_GC(interp) \
        if ((interp)->arena_base->GC_block_level) \
            (interp)->arena_base->GC_block_level--

/* Macros for testing if the DOD and GC are blocked */
#define Parrot_is_blocked_DOD(interp) \
        ((interp)->arena_base->DOD_block_level)

#define Parrot_is_blocked_GC(interp) \
        ((interp)->arena_base->GC_block_level)

enum {
    DOD_trace_stack_FLAG = 1 << 0,      /* trace system areads and stack */
    DOD_trace_normal     = 1 << 0,      /* the same */
    DOD_lazy_FLAG        = 1 << 1,      /* timely destruction run */
    DOD_finish_FLAG      = 1 << 2,      /* run async past sweep */
    DOD_no_trace_volatile_roots = 1 << 3  /* trace all but volatile root
                                             set, i.e. registers */
};

/* HEADERIZER BEGIN: src/gc/dod.c */

PARROT_API void Parrot_do_dod_run( Interp *interp /*NN*/, UINTVAL flags )
        __attribute__nonnull__(1);

PARROT_API void Parrot_dod_clear_live_bits( Interp *interp /*NN*/ )
        __attribute__nonnull__(1);

PARROT_API void Parrot_dod_ms_run( Interp *interp /*NN*/, int flags )
        __attribute__nonnull__(1);

PARROT_API void Parrot_dod_ms_run_init( Interp *interp /*NN*/ )
        __attribute__nonnull__(1);

PARROT_API void Parrot_dod_profile_end( Interp *interp /*NN*/, int what )
        __attribute__nonnull__(1);
<commit_msg>Changed the DOD flags to be #defines instead of enums.  We aren't using them as enums if we're doing bit logic with them.<commit_after>/* dod.h
 *  Copyright (C) 2001-2007, The Perl Foundation.
 *  SVN Info
 *     $Id$
 *  Overview:
 *     Handles dead object destruction of the various headers
 *  History:
 *     Initial version by <NAME> on 2002.05.27
 */

#ifndef PARROT_DOD_H_GUARD
#define PARROT_DOD_H_GUARD

#include "parrot/parrot.h"

/* Macros for recursively blocking and unblocking DOD */
#define Parrot_block_DOD(interp) \
        do { \
            (interp)->arena_base->DOD_block_level++; \
            Parrot_shared_DOD_block(interp); \
        } while (0)

#define Parrot_unblock_DOD(interp) \
        if ((interp)->arena_base->DOD_block_level) { \
            (interp)->arena_base->DOD_block_level--; \
            Parrot_shared_DOD_unblock(interp); \
        }

/* Macros for recursively blocking and unblocking GC */
#define Parrot_block_GC(interp) \
        (interp)->arena_base->GC_block_level++

#define Parrot_unblock_GC(interp) \
        if ((interp)->arena_base->GC_block_level) \
            (interp)->arena_base->GC_block_level--

/* Macros for testing if the DOD and GC are blocked */
#define Parrot_is_blocked_DOD(interp) \
        ((interp)->arena_base->DOD_block_level)

#define Parrot_is_blocked_GC(interp) \
        ((interp)->arena_base->GC_block_level)

#define DOD_trace_stack_FLAG    (UINTVAL)(1 << 0)   /* trace system areads and stack */
#define DOD_trace_normal        (UINTVAL)(1 << 0)   /* the same */
#define DOD_lazy_FLAG           (UINTVAL)(1 << 1)   /* timely destruction run */
#define DOD_finish_FLAG         (UINTVAL)(1 << 2)   /* run async past sweep */
#define DOD_no_trace_volatile_roots (UINTVAL)(1 << 3)
            /* trace all but volatile root set, i.e. registers */

/* HEADERIZER BEGIN: src/gc/dod.c */

PARROT_API void Parrot_do_dod_run( Interp *interp /*NN*/, UINTVAL flags )
        __attribute__nonnull__(1);

PARROT_API void Parrot_dod_clear_live_bits( Interp *interp /*NN*/ )
        __attribute__nonnull__(1);

PARROT_API void Parrot_dod_ms_run( Interp *interp /*NN*/, int flags )
        __attribute__nonnull__(1);

PARROT_API void Parrot_dod_ms_run_init( Interp *interp /*NN*/ )
        __attribute__nonnull__(1);

PARROT_API void Parrot_dod_profile_end( Interp *interp /*NN*/, int what )
        __attribute__nonnull__(1);

{'fraction_non_alphanumeric': 0.11633397724833655, 'fraction_numerical': 0.0137368534020176, 'mean_word_length': 2.9458086367485183, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6773734', 'n_tokens_mistral': 1706, 'n_tokens_neox': 1648, 'n_words': 358}