Changeset fde6d80


Ignore:
Timestamp:
Jan 23, 2010, 10:49:54 AM (10 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.6, release-1.7, release-1.8, release-1.9
Children:
c3a47c9
Parents:
2fec14b
Message:
owl_style_create_perl: Change refcounting convention.

Make owl_style_create_perl assume ownership of an existing ref, rather
than SvREFCNT_inc'ing its argument, for consistency with both perl
APIs and other code paths that retain SVs.
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • perlglue.xs

    r2fec14b rfde6d80  
    279279        {
    280280                s = owl_malloc(sizeof(owl_style));
    281                 owl_style_create_perl(s, name, sv_2mortal(newSVsv(object)));
     281                owl_style_create_perl(s, name, newSVsv(object));
    282282                owl_global_add_style(&g, s);
    283283        }
  • style.c

    rc0ddaea rfde6d80  
    22#include "owl.h"
    33
     4/* Assumes owenership of one existing ref on `obj`*/
    45void owl_style_create_perl(owl_style *s, const char *name, SV *obj)
    56{
    67  s->name=owl_strdup(name);
    7   s->perlobj = SvREFCNT_inc(obj);
     8  s->perlobj = obj;
    89}
    910
Note: See TracChangeset for help on using the changeset viewer.