Re: Subclasses, tied hashes, {get,set}_property, undefined values

On Thu, 2007-11-15 at 18:21 +0100, Torsten Schoenfeld wrote:

Maybe we need a new macro that mimics defined() and use it instead of
"sv && SvOK (sv)"?

Here's a patch that adds the new function gperl_sv_defined, derived from
perl's pp_defined, and uses it in place of SvOK everywhere in Glib.  It
contains a test derived from Giuliano's program.

I also ran a benchmark and found no measurable time differences between
Glib with and without the patch applied.  Odot's start-up timed wasn't
affected either.

So, does this make sense?  Is the benchmark sound, or are there cases
which are slowed down measurably by this patch?  Is the
name ïgperl_sv_defined good, or are there better alternatives?


Attachment: defined.patch
Description: Text Data

Description: Perl program

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]