[1537] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next last

Re: [patch] optimize method cache

daemon@ATHENA.MIT.EDU (Mon Jan 3 20:31:55 2000 )

Date: Mon, 03 Jan 2000 20:16:12 -0500
From: Psyclone <psyclone42@geocities.com>
To: coldstuff@cold.org
Reply-To: coldstuff@cold.org

bruce@puremagic.com wrote:
> 
> This is a patch to help optimize the method cache some.

<snippage>

the line:    if (method->m_access = access) {
should read: if (method->m_access == access) {

> @@ -1162,9 +1172,18 @@
>      method = object_find_method_local(object, name, FROB_ANY);
>      if (method == NULL)
>          return -1;
> +    if (method->m_access = access) {
> +        /* yay, we don't have to do anything. let's go home. */
> +        return access;
> +    }
> +    if ((method->m_access == MS_FROB) || (access == MS_FROB)) {
> +        /*
> +        * only invalidate when changing to or from 'frob' access.
> +        */
> +       cur_stamp++;
> +    }
>      method->m_access = access;
>      object->dirty = 1;
> -    cur_stamp++; /* to invalidate cached frob/!frob defaults */
>      return access;
>  }
>