Ticket #1497 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

Expose 'meth_cache' attribute of class.pmc

Reported by: Austin_Hastings Owned by: whiteknight
Priority: normal Milestone:
Component: none Version: 2.1.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description

Taking over find_method for a class currently does not totally work because object.pmc checks to see if a method appears in the class object's meth_cache before proceeding to any other form of dispatch.

In theory, this is great if find_method is returning the same method all the time, *and* if the method in question hasn't been called prior to taking over the find_method vtable.

Both of those are questionable (read: invalid) assumptions.

The cache is a good idea, but either (1) the vtable override should take precedence over the cache; or (2) the cache should be manageable from the introspection interface.

If (2), then (2.a.) the cache should be clearable, or automatically cleared whenever a vtable override occurs; and (2.b.) there needs to be a way to turn caching off, so that a method which does not return the same sub all the time can function.

Change History

Changed 4 years ago by whiteknight

  • owner set to whiteknight

A fix has been applied in r45272. I've got to make sure I've added enough tests before closing this.

Changed 4 years ago by whiteknight

  • status changed from new to closed
  • resolution set to fixed

The test I committed in r45272 does satisfy the spirit of the test case that Austin provided yesterday. Closing ticket.

Note: See TracTickets for help on using tickets.