Invitation to test: Lightweight Objects

15 views
Skip to first unread message

Gnomi

unread,
Apr 7, 2021, 11:00:10 AM4/7/21
to Discussion of the LDMud driver.
Hello everyone,

I'd like to invite you to test the lightweight object implementation
of LDMud. It will probably be released with LDMud 3.6.5.

For a short introduction see the previous RFC on this list and:
https://github.com/amotzkau/ldmud/blob/lwo/doc/LPC/lwobjects

With regard to the previous discussion these are the key points:

* The new type is named 'lwobject'.
* The efun is called 'new_lwobject'.
* dual use objects are possible with #pragma lightweight, clone
* lwobjects can have call_outs (and call input_to), as they don't
have any overhead on the (lw)object itself.

To allow lightweight objects a mudlib needs some adaptions.
The availability can be tested with #ifdef __LPC_LWOBJECTS__.

You'll need two driver hooks: H_CREATE_LWOBJECT and H_LWOBJECT_UIDS similar
to H_CREATE_CLONE and H_CLONE_UIDS. You might want to adapt your
'valid_read' and 'valid_write' functions in the master to also accept
lwobjects as the caller. Also check any usage of previous_object() in the
master and simul-efun. It could be an lwobject as well.

In our mudlib I amended our H_AUTO_INCLUDE hook to include "#pragma
lightweight" when the base file lies within an /lwo/ directory.

The implementation is available in my lwo branch (which is based on
the lastest LDMud release):
https://github.com/amotzkau/ldmud/tree/lwo

I hope you'll have some fun with it and I'm interested in your feedback.

Regards,
Gnomi.
Reply all
Reply to author
Forward
0 new messages