[svn:parrot] r43019 - in branches/context_unify3: include/parrot src/call

bacek at svn.parrot.org bacek at svn.parrot.org
Sat Dec 12 19:50:41 UTC 2009


Author: bacek
Date: Sat Dec 12 19:50:40 2009
New Revision: 43019
URL: https://trac.parrot.org/parrot/changeset/43019

Log:
Add Parrot_pcc_allocate_empty_context to allocate new context without
registers.

Modified:
   branches/context_unify3/include/parrot/call.h
   branches/context_unify3/src/call/context.c

Modified: branches/context_unify3/include/parrot/call.h
==============================================================================
--- branches/context_unify3/include/parrot/call.h	Sat Dec 12 14:59:34 2009	(r43018)
+++ branches/context_unify3/include/parrot/call.h	Sat Dec 12 19:50:40 2009	(r43019)
@@ -464,6 +464,12 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+PMC * Parrot_pcc_allocate_empty_context(PARROT_INTERP,
+    ARGIN_NULLOK(PMC *old))
+        __attribute__nonnull__(1);
+
 void Parrot_pcc_allocate_registers(PARROT_INTERP,
     ARGIN(PMC *pmcctx),
     ARGIN(const INTVAL *number_regs_used))
@@ -538,6 +544,9 @@
 #define ASSERT_ARGS_Parrot_alloc_context __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(number_regs_used))
+#define ASSERT_ARGS_Parrot_pcc_allocate_empty_context \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_pcc_allocate_registers __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(pmcctx) \

Modified: branches/context_unify3/src/call/context.c
==============================================================================
--- branches/context_unify3/src/call/context.c	Sat Dec 12 14:59:34 2009	(r43018)
+++ branches/context_unify3/src/call/context.c	Sat Dec 12 19:50:40 2009	(r43019)
@@ -567,6 +567,30 @@
 
 /*
 
+=item C<PMC * Parrot_pcc_allocate_empty_context(PARROT_INTERP, PMC *old)>
+
+Allocates and returns a new context.  Does not set this new context as the
+current context. 
+
+=cut
+
+*/
+
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+PMC *
+Parrot_pcc_allocate_empty_context(PARROT_INTERP, ARGIN_NULLOK(PMC *old))
+{
+    ASSERT_ARGS(Parrot_pcc_allocate_empty_context)
+    PMC            *pmcctx = pmc_new(interp, enum_class_CallContext);
+
+    init_context(interp, pmcctx, old);
+
+    return pmcctx;
+}
+
+/*
+
 =item C<PMC * Parrot_set_new_context(PARROT_INTERP, const INTVAL
 *number_regs_used)>
 


More information about the parrot-commits mailing list