-
Notifications
You must be signed in to change notification settings - Fork 550
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
overload and rebless #7871
Comments
From @nwc10Created by @nwc10clkao actually found this bug, but he's having trouble reporting it. reblessing a object in a overloaded class doesn't clear the magic on some Even if ->delete is called from within delete_with_self, it still doesn't #!/usr/bin/perl -w use overload sub is_cool { sub delete { sub delete_with_self { package Something::Else; 1; package main; my $obj; $obj = bless {name => 'cool'}, 'Foo'; Nicholas Clark Perl Info
|
From @nwc10On Tue, Apr 12, 2005 at 01:24:58PM -0000, Nicholas Clark wrote:
It looks like it's a more fundamental problem of where the overloading flag #!/usr/bin/perl -w use overload sub quack { my %hash; my $o1 = \%hash; print $o1 ? "o1 true\n" : "o1 false\n"; To make things work, it needs to be on the referent, not the reference. Nicholas Clark |
The RT System itself - Status changed from 'new' to 'open' |
From tony@kasei.comOn Tue, Apr 12, 2005 at 01:24:58PM -0000, Nicholas Clark wrote:
This isn't just an abstract bug; this causes problems for Class::DBI Tony |
From @nwc10On Tue, Apr 12, 2005 at 08:17:20PM +0100, Tony Bowden wrote:
Which is how clkao found it. (should have said) Nicholas Clark |
From @ysthOn Tue, Apr 12, 2005 at 03:55:40PM +0100, Nicholas Clark wrote:
I'm not sure there's a flag available on every type of referent, which The existing implementation should work for almost every purpose so There will be a slight slowdown if you succeed in moving the flag to |
From @nwc10On Wed, Apr 13, 2005 at 11:03:00AM -0700, Yitzchak Scott-Thoennes wrote:
I think that 0x10000000 was available on all SV types back then. This would have to move: #define SVphv_REHASH 0x10000000 /* HV is recalculating hash values */ but as that's an internal implementation flag, anyone outside the core would
I believe that there would only be a slight slowdown for all cases when the Nicholas Clark |
From @ysthOn Thu, Apr 14, 2005 at 10:52:36AM +0100, Nicholas Clark wrote:
I was thinking principally about rv2av and rv2hv, common ops where ROK |
From @nwc10On Thu, Apr 14, 2005 at 10:52:36AM +0100, Nicholas Clark wrote:
I can see 3 possible solutions: 1: Move SVphv_REHASH somewhere else, and change the overloading code so that This is source compatible but not binary compatible. The only thing I can But it seems sane for blead and therefore 5.10 2: Dave said something about one of the other flags possibly being able to be 3: The problem is really only on rebless, isn't it? If so, a correct solution This would be binary compatible. Nicholas Clark |
From @JohnPeacockNicholas Clark wrote:
AFAIK I am the only person crazy enough to deal with overloading and XS John -- |
From @ysthOn Tue, Mar 14, 2006 at 05:13:42PM +0000, Nicholas Clark wrote:
No. $a = $b = {}; leaves $a not marked as overloaded. A brute force search could be quite lengthy. Better just to document the |
From @nwc10On Tue, Mar 14, 2006 at 09:30:41AM -0800, Yitzchak Scott-Thoennes wrote:
My impression is that that construction is rare, in that I don't know of Whereas reblessing existing objects does seem to be a commonly used idiom.
I'm happy to document the example you give as not working, because I suspect Nicholas Clark |
From @nwc10On Tue, Mar 14, 2006 at 05:13:42PM +0000, Nicholas Clark wrote:
I have applied this. All tests pass, including new tests for reblessing. Perlbench reports: A B C D E F AVERAGE 100 101 100 101 100 101 (A, C, E are without, B, D, F are with. I guess that this much randomness Nicholas Clark |
From @nwc10On Tue, Mar 14, 2006 at 05:53:08PM +0000, Nicholas Clark wrote:
Well, it turned out to be easier to scan for both bless and rebless, rather Change 27512 makes maint scan for other references. The scan is conditional I haven't actually timed this. Nicholas Clark |
From nick@ing-simmons.netJohn Peacock <jpeacock@rowman.com> writes:
Audio::Data does overloading with XS but doesn't rebless or check
|
@rgs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#34925 (status was 'resolved')
Searchable as RT34925$
The text was updated successfully, but these errors were encountered: