MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: the @measure verb



If you're asking for a fix here's one...

On Sun, 17 Nov 1996, Matthew Schmidt wrote:

> In the latest version of the Lamba DB, when i type @measure, it returns
> traceback,
> The TRACEBACK:
> @measure object here
> Checking size of Generic Bridge (#179)...
> #80:object_bytes object_size, line 15:  Verb not found
> ... called from #4:@measure (this == #2), line 17
> (End of traceback)
> 
> THe code for #80:object_bytes
>  1:  "Algorithm:";
>  2:  "  Base object takes up 13 words plus length of name.  (builtin
>  props?)";
>  3:  "  Each verb takes up 5 words overhead, plus length of its name,
>  plus size of its code.";
>  4:  "  Each property definition takes up 1 word plus length of
>  property name, plus each property on the object takes up 4 words. 
>  (Or, 5 per defined prop, 4 per inherited prop)";
>  5:  "Note: each word is four bytes.";
>  6:  foo = "delimit comments above from commented out code below";
>  7:  set_task_perms(this:task_perms());
>  8:  o = args[1];
>  9:  b = this:object_overhead_bytes(o);
> 10:  vs = verbs(o);
> 11:  b = b + this:verb_overhead_bytes(o);
> 12:  for i in [0..length(vs) - 1]

Change line 12 to for vn in [1..length(vs)]

> 13:    $command_utils:suspend_if_needed(5);
> 14:    vn = tostr(i);

delete line 14, that should do it....

> 15:    info = verb_info(o, vn);
> 16:    b = b + length(info[3]) + 1;
> 17:    "Request verb code in unindented, unparenthesized form";
> 18:    b = b + value_bytes(verb_code(o, vn, 0, 0));
> 19:  endfor
> 20:  ps = $object_utils:all_properties_suspended(o);
> 21:  b = b + this:property_overhead_bytes(o, ps);
> 22:  for p in (ps)
> 23:    if (this:property_exists(o, p) && !is_clear_property(o, p))
> 24:      $command_utils:suspend_if_needed(5);
> 25:      b = b + value_bytes(o.(p));
> 26:    endif
> 27:  endfor
> 28:  if ($object_utils:has_property(o, "object_size"))
> 29:    oldsize = is_clear_property(o, "object_size") ? 0 |
>  o.object_size[1];
> 30:    if ($object_utils:has_property(o.owner, "size_quota"))
> 31:      "Update quota cache.";
> 32:      if (oldsize)
> 33:        o.owner.size_quota[2] = o.owner.size_quota[2] + (b -
>  oldsize);
> 34:      else
> 35:        o.owner.size_quota[2] = o.owner.size_quota[2] + b;
> 36:        if (o.owner.size_quota[4] > 0)
> 37:          o.owner.size_quota[4] = o.owner.size_quota[4] - 1;
> 38:        endif
> 39:      endif
> 40:    endif
> 41:    o.object_size = {b, time()};
> 42:  endif
> 43:  return b;
> 
> 
> Thats all the code that has to do with that traceback.
> 
>                                                 Matthew Schmidt
> 
> Lieutenant Picard                  
> Officer of the FDS-Millennium      
> Administrator of Titan Facility    
> Office #2073                       
> Head of FDF Star Wars MOO          
> 
> 
> 
> 



References:

Home | Subject Index | Thread Index