# New Ticket Created by  Josef Höök 
# Please include the string:  [perl #16933]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=16933 >


Added a new pmc function that is used for passing inital sizes to pmcs. 
There was an old function called pmc_new_sized but it seemed that it was
outdated so i replaced it.


/Josef



-- attachment  1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/36329/29359/d1db20/pmc.20020830.patch

--- pmc.c.orig  Fri Aug 30 22:11:08 2002
+++ pmc.c       Fri Aug 30 22:10:47 2002
@@ -8,6 +8,7 @@
  *     See include/parrot/vtable.h.
  *  History:
  *     Initial version by Simon on 2001.10.20
+ *     Added pmc_new_pmc function. Josef 2002-08-30
  *  Notes:
  *  References:
  *     <[EMAIL PROTECTED]>
@@ -87,15 +88,16 @@
     return pmc;
 }
 
-/*=for api pmc pmc_new_sized
+/*=for api pmc pmc_new_pmc
 
-   As C<pmc_new>, but passes C<size> to the PMC's C<init> method.
+   As C<pmc_new>, but passes a C<pmc> to the PMC's C<init_pmc> method,
+   used when passing sizes to pmc.
 
 =cut
 */
 
 PMC *
-pmc_new_sized(struct Parrot_Interp *interpreter, INTVAL base_type, INTVAL size)
+pmc_new_pmc(struct Parrot_Interp *interpreter, INTVAL base_type, PMC *p)
 {
     PMC *pmc = new_pmc_header(interpreter);
 
@@ -115,8 +117,7 @@
         return NULL;
     }
 
-    /* XXX - pmc->vtable->init(interpreter, pmc, size); */
-    pmc->vtable->init(interpreter, pmc);
+    pmc->vtable->init_pmc(interpreter, pmc, p);
 
     return pmc;
 }
--- include/parrot/pmc.h.orig   Fri Aug 30 22:12:31 2002
+++ include/parrot/pmc.h        Fri Aug 30 22:08:50 2002
@@ -118,10 +118,8 @@
 /* Prototypes */
 PMC *pmc_new(struct Parrot_Interp *interpreter, INTVAL base_type);
 PMC *pmc_new_noinit(struct Parrot_Interp *interpreter, INTVAL base_type);
-PMC *pmc_new_sized(struct Parrot_Interp *interpreter, INTVAL base_type,
-                        INTVAL size);
-PMC *pmc_new_sized_pmc(struct Parrot_Interp *interpreter, INTVAL base_type, 
-                       PMC *p);
+PMC *pmc_new_pmc(struct Parrot_Interp *interpreter, INTVAL base_type, PMC *p);
+
 
 
 #endif

Reply via email to