{ }Butler
Butler
Memory management for Luau, with O(1) removal and LIFO cleanup for instances, connections and threads.
- Doubly linked list internally: removal is O(1) rather than a scan, and cleanup runs LIFO.
- Instances, connections, threads and functions all go through one Add, with Connect, Once and ConnectParallel wrappers.
- Extend nests butlers, so cleaning a parent cleans everything below it.
- AttachToInstance ties a butler’s lifetime to an instance being destroyed.
- Used in production by Zero Pressure, The Next Vessel and Last Wave.