wren icon indicating copy to clipboard operation
wren copied to clipboard

api: add wrenCopySlot

Open erincandescent opened this issue 2 years ago • 3 comments

Simple utility function which copies a value from one slot to another, as originally proposed in #836

erincandescent avatar Feb 19 '22 12:02 erincandescent

Instead add wrenCopySlots and make wrenCopySlot a special case/macro...

mhermier avatar Feb 19 '22 15:02 mhermier

I thought about that, but it opens up memcpy esque cans of worms (what do we do if they're overlapping).

Nothing insurmountable but I've never actually needed to move multiple

erincandescent avatar Feb 19 '22 15:02 erincandescent

Well this can be as this for now. The main usage for copying in block, is when one needs to realign the stack for a reentrant call, or when performing tail call optimisation (which are not supported yet).. That said, implementation should always be safest, so it should follow memmove semantic.

mhermier avatar Feb 19 '22 16:02 mhermier