Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming functions of src/global_setup.c #8

Closed
wants to merge 7 commits into from
File renamed without changes.
4 changes: 2 additions & 2 deletions config/gen/core_pmcs.pm
Expand Up @@ -111,7 +111,7 @@ END_C

print {$OUT} <<'END_C';

void Parrot_initialize_core_pmcs(PARROT_INTERP, int pass)
void Parrot_gbl_initialize_core_pmcs(PARROT_INTERP, int pass)
{
/* first the PMC with the highest enum
* this reduces MMD table resize action */
Expand All @@ -131,7 +131,7 @@ static void register_pmc(PARROT_INTERP, ARGIN(PMC *registry), int pmc_id)
}

void
Parrot_register_core_pmcs(PARROT_INTERP, ARGIN(PMC *registry))
Parrot_gbl_register_core_pmcs(PARROT_INTERP, ARGIN(PMC *registry))
{
END_C

Expand Down
2 changes: 1 addition & 1 deletion docs/embed.pod
Expand Up @@ -1380,7 +1380,7 @@ The list may also be augmented if additional functionality is required.

=item C<Parrot_secret_snprintf>

=item C<Parrot_set_config_hash_internal>
=item C<Parrot_gbl_set_config_hash_internal>

=item C<Parrot_set_context_threshold>

Expand Down
12 changes: 6 additions & 6 deletions include/parrot/global_setup.h
Expand Up @@ -15,34 +15,34 @@
#include "parrot/config.h"
#include "parrot/interpreter.h"

void Parrot_register_core_pmcs(PARROT_INTERP, ARGIN(PMC *registry))
void Parrot_gbl_register_core_pmcs(PARROT_INTERP, ARGIN(PMC *registry))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

void Parrot_initialize_core_pmcs(PARROT_INTERP, int pass)
void Parrot_gbl_initialize_core_pmcs(PARROT_INTERP, int pass)
__attribute__nonnull__(1);

/* HEADERIZER BEGIN: src/global_setup.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */

PARROT_EXPORT
void Parrot_set_config_hash_internal(
void Parrot_gbl_set_config_hash_internal(
ARGIN(const unsigned char* parrot_config),
unsigned int parrot_config_size)
__attribute__nonnull__(1);

void init_world(PARROT_INTERP)
__attribute__nonnull__(1);

void init_world_once(PARROT_INTERP)
void Parrot_gbl_init_world_once(PARROT_INTERP)
__attribute__nonnull__(1);

#define ASSERT_ARGS_Parrot_set_config_hash_internal \
#define ASSERT_ARGS_Parrot_gbl_set_config_hash_internal \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(parrot_config))
#define ASSERT_ARGS_init_world __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_init_world_once __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
#define ASSERT_ARGS_Parrot_gbl_init_world_once __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/global_setup.c */
Expand Down
2 changes: 1 addition & 1 deletion src/embed.c
Expand Up @@ -115,7 +115,7 @@ Parrot_init_stacktop(PARROT_INTERP, ARGIN(void *stack_top))
{
ASSERT_ARGS(Parrot_init_stacktop)
interp->lo_var_ptr = stack_top;
init_world_once(interp);
Parrot_gbl_init_world_once(interp);
}


Expand Down
46 changes: 23 additions & 23 deletions src/global_setup.c
Expand Up @@ -27,8 +27,8 @@ I<What are these global variables?>

/* These functions are defined in the auto-generated file core_pmcs.c */
/* XXX Get it into some public place */
extern void Parrot_initialize_core_pmcs(PARROT_INTERP, int pass);
void Parrot_register_core_pmcs(PARROT_INTERP, PMC* registry);
extern void Parrot_gbl_initialize_core_pmcs(PARROT_INTERP, int pass);
void Parrot_gbl_register_core_pmcs(PARROT_INTERP, PMC* registry);

static const unsigned char* parrot_config_stored = NULL;
static unsigned int parrot_config_size_stored = 0;
Expand All @@ -38,15 +38,15 @@ static unsigned int parrot_config_size_stored = 0;
/* HEADERIZER BEGIN: static */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */

static void parrot_global_setup_2(PARROT_INTERP)
static void Parrot_gbl_setup_2(PARROT_INTERP)
__attribute__nonnull__(1);

static void parrot_set_config_hash_interpreter(PARROT_INTERP)
static void Parrot_gbl_set_config_hash_interpreter(PARROT_INTERP)
__attribute__nonnull__(1);

#define ASSERT_ARGS_parrot_global_setup_2 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
#define ASSERT_ARGS_Parrot_gbl_setup_2 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_parrot_set_config_hash_interpreter \
#define ASSERT_ARGS_Parrot_gbl_set_config_hash_interpreter \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
Expand All @@ -55,7 +55,7 @@ static void parrot_set_config_hash_interpreter(PARROT_INTERP)

/*

=item C<void Parrot_set_config_hash_internal(const unsigned char* parrot_config,
=item C<void Parrot_gbl_set_config_hash_internal(const unsigned char* parrot_config,
unsigned int parrot_config_size)>

Called by Parrot_set_config_hash with the serialised hash which
Expand All @@ -67,17 +67,17 @@ will be used in subsequently created Interpreters.

PARROT_EXPORT
void
Parrot_set_config_hash_internal(ARGIN(const unsigned char* parrot_config),
Parrot_gbl_set_config_hash_internal(ARGIN(const unsigned char* parrot_config),
unsigned int parrot_config_size)
{
ASSERT_ARGS(Parrot_set_config_hash_internal)
ASSERT_ARGS(Parrot_gbl_set_config_hash_internal)
parrot_config_stored = parrot_config;
parrot_config_size_stored = parrot_config_size;
}

/*

=item C<static void parrot_set_config_hash_interpreter(PARROT_INTERP)>
=item C<static void Parrot_gbl_set_config_hash_interpreter(PARROT_INTERP)>

Used internally to associate the config hash with an Interpreter
using the last registered config data.
Expand All @@ -87,9 +87,9 @@ using the last registered config data.
*/

static void
parrot_set_config_hash_interpreter(PARROT_INTERP)
Parrot_gbl_set_config_hash_interpreter(PARROT_INTERP)
{
ASSERT_ARGS(parrot_set_config_hash_interpreter)
ASSERT_ARGS(Parrot_gbl_set_config_hash_interpreter)
PMC *iglobals = interp->iglobals;

PMC *config_hash = NULL;
Expand All @@ -113,7 +113,7 @@ parrot_set_config_hash_interpreter(PARROT_INTERP)

/*

=item C<void init_world_once(PARROT_INTERP)>
=item C<void Parrot_gbl_init_world_once(PARROT_INTERP)>

Call init_world() if it hasn't been called before.

Expand All @@ -124,9 +124,9 @@ C<interp> should be the root interpreter created in C<Parrot_new(NULL)>.
*/

void
init_world_once(PARROT_INTERP)
Parrot_gbl_init_world_once(PARROT_INTERP)
{
ASSERT_ARGS(init_world_once)
ASSERT_ARGS(Parrot_gbl_init_world_once)
if (!interp->world_inited) {
/* init_world() sets up some vtable stuff.
* It must only be called once.
Expand All @@ -142,7 +142,7 @@ init_world_once(PARROT_INTERP)

=item C<void init_world(PARROT_INTERP)>

This is the actual initialization code called by C<init_world_once()>.
This is the actual initialization code called by C<Parrot_gbl_init_world_once()>.

It sets up the Parrot system, running any platform-specific init code if
necessary, then initializing the string subsystem, and setting up the
Expand All @@ -165,8 +165,8 @@ init_world(PARROT_INTERP)
#endif

/* Call base vtable class constructor methods */
parrot_global_setup_2(interp);
Parrot_initialize_core_pmcs(interp, 1);
Parrot_gbl_setup_2(interp);
Parrot_gbl_initialize_core_pmcs(interp, 1);

iglobals = interp->iglobals;
VTABLE_set_pmc_keyed_int(interp, iglobals,
Expand All @@ -179,7 +179,7 @@ init_world(PARROT_INTERP)
VTABLE_set_pmc_keyed_int(interp, iglobals,
(INTVAL)IGLOBALS_INTERPRETER, self);

parrot_set_config_hash_interpreter(interp);
Parrot_gbl_set_config_hash_interpreter(interp);

/* lib search paths */
parrot_init_library_paths(interp);
Expand All @@ -206,7 +206,7 @@ init_world(PARROT_INTERP)

/*

=item C<static void parrot_global_setup_2(PARROT_INTERP)>
=item C<static void Parrot_gbl_setup_2(PARROT_INTERP)>

called from inmidst of PMC bootstrapping between pass 0 and 1

Expand All @@ -215,9 +215,9 @@ called from inmidst of PMC bootstrapping between pass 0 and 1
*/

static void
parrot_global_setup_2(PARROT_INTERP)
Parrot_gbl_setup_2(PARROT_INTERP)
{
ASSERT_ARGS(parrot_global_setup_2)
ASSERT_ARGS(Parrot_gbl_setup_2)
PMC *classname_hash;

create_initial_context(interp);
Expand All @@ -242,7 +242,7 @@ parrot_global_setup_2(PARROT_INTERP)

/* We need a class hash */
interp->class_hash = classname_hash = Parrot_pmc_new(interp, enum_class_NameSpace);
Parrot_register_core_pmcs(interp, classname_hash);
Parrot_gbl_register_core_pmcs(interp, classname_hash);

/* init the interpreter globals array */
interp->iglobals = Parrot_pmc_new_init_int(interp,
Expand Down
2 changes: 1 addition & 1 deletion src/interp/inter_create.c
Expand Up @@ -221,7 +221,7 @@ initialize_interpreter(PARROT_INTERP, ARGIN(void *stacktop))
/* create the root set registry */
interp->gc_registry = Parrot_pmc_new(interp, enum_class_AddrRegistry);

init_world_once(interp);
Parrot_gbl_init_world_once(interp);

/* context data */
if (is_env_var_set(interp, CONST_STRING(interp, "PARROT_GC_DEBUG"))) {
Expand Down
4 changes: 2 additions & 2 deletions src/vtables.c
Expand Up @@ -21,7 +21,7 @@ Functions to build and manipulate vtables

/* This function is defined in the auto-generated file core_pmcs.c */
/* XXX Get it into some public place */
extern void Parrot_initialize_core_pmcs(PARROT_INTERP, int pass);
extern void Parrot_gbl_initialize_core_pmcs(PARROT_INTERP, int pass);

/* HEADERIZER HFILE: include/parrot/vtables.h */

Expand Down Expand Up @@ -239,7 +239,7 @@ Parrot_vtbl_initialize_core_vtables(PARROT_INTERP)

if (! interp->vtables) {
Parrot_vtbl_alloc_vtables(interp);
Parrot_initialize_core_pmcs(interp, 0);
Parrot_gbl_initialize_core_pmcs(interp, 0);
}
}

Expand Down
4 changes: 2 additions & 2 deletions tools/build/parrot_config_c.pl
Expand Up @@ -49,7 +49,7 @@ =head1 DESCRIPTION
void Parrot_set_config_hash(void);

void
Parrot_set_config_hash_internal (const unsigned char* parrot_config,
Parrot_gbl_set_config_hash_internal (const unsigned char* parrot_config,
unsigned int parrot_config_size);


Expand Down Expand Up @@ -89,7 +89,7 @@ =head1 DESCRIPTION
void
Parrot_set_config_hash(void)
{
Parrot_set_config_hash_internal(parrot_config, sizeof(parrot_config));
Parrot_gbl_set_config_hash_internal(parrot_config, sizeof(parrot_config));
}
EOF

Expand Down