IMM_BUFFER

Keywords: IMM_BUFFER, WIZ_BUFFER, BUFFER

Category: Admin

=== STAFF MANUAL === Usage: buffer add <size> buffer delete <size> buffer verbose buffer detailed buffer paranoid buffer check buffer overflow Description: Debug-level control of the MUD's internal buffer pool -- the shared BUFFER() scratch allocation system used by command handlers, OLC, and string formatting throughout the codebase. This command is for live debugging of buffer usage and for toggling the diagnostic flags that the pool reads at runtime; you should only need it when chasing down a buffer leak, an overflow, or a memory-clearing regression. Allocation Subcommands: add <size> ...... Allocate a new buffer of the given byte size and add it to the pool. The new buffer is immediately available for the next BUFFER() request at that size class. delete <size> ... Free an unused buffer of the given byte size from the pool. The loop walks the size-class list for the matching magnitude and removes the first free entry it finds. In-use buffers are skipped. If nothing matches, you see "Not found.". Diagnostic Toggles: Each of these flips the matching bit on Buffer::options and prints the new state: verbose ......... "Verbose On." / "Verbose Off." -- enables extra per-acquire/release log output. detailed ........ "Detailed On." / "Detailed Off." -- more granular tracing than verbose, including caller context. paranoid ........ "Now paranoid." / "No longer paranoid." -- when on, buffers are fully memset to zero on release instead of just null-terminated. Catches stale-data leaks at the cost of some performance. check ........... "Checking on." / "Not checking." -- toggles buffer usage/validity checks. overflow ........ "Reboot on overflow." / "Will try to keep going." -- when the "stay up" flag is off, a buffer overflow triggers an immediate reboot; when on, the game tries to soldier on past the corruption. Default is stay-up. Restrictions: - Requires Coder level to issue the command. No permission flag gates it -- the level check in the command table is the only guard. - Argument parsing is strict: an empty command line or a bogus keyword prints the built-in BUFFER_FORMAT usage block. - add and delete require a second token that parses as a non-zero integer size. A zero or missing size also prints the usage block. Notes: - Turning on verbose or detailed in production is noisy. Use them during short, targeted debug sessions and turn them back off when done. - paranoid is useful when tracking down a bug that smells like stale-buffer reuse -- it makes old contents disappear between recycles. - check catches misuse at the cost of extra validation passes; leave it off during normal play. === END MANUAL ===