Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This release fixes all known instances of memory corruption and subsequent crashes that seemingly snuck their way in with some of the changes in the previous `v3.8.0` release. Along with an update to dialect v2.0.0, `IRCEvent.aux` is now a static array of strings, and `IRCEvent.counts` a static array of `Nullable!long`s. `IRCEvent.count` and `IRCEvent.altcount` were summarily removed. All current plugins have been updated accordingly, largely by merely string-replacing `.aux` with `.aux[0]`, and `.count` with `.counts[0].get`. One exception is command event handlers, who can now access the command word in `.aux[$-1]`. Messaging functions were refactored to take a `Property` bitfield flag parameter, replacing up to four other `std.typecons.Flag` parameters. They are also no longer templates. When determining whether or not an event handler of a given plugin should be called upon some incoming event type, the program used to iterate through the handler's array of annotated accepted event types and compare the elements one by one with the incoming event type, by use of `std.algorithm.iteration.canFind`. If there was a match, the event handler would be called. This meant that there would be a lot of comparisons in the pathological case with many event handlers accepting many event types. In fact, one of the biggest hotspots revealed by profiling is (was) `std.algorithm.canFind`. if (eventHandlerUDA.acceptedEventTypes.canFind(event.type)) { /*...*/ } Since the arrays of accepted types are known at compile-time, we now generate a `bool[]` array per plugin that we simply index with the value of the event type, since it's functionally an integer. if (eventHandlerUDA.acceptedEventTypeMap[event.type]) { /*...*/ } The array iteration becomes a single array index operation. * Plugins now need to import `kameloso.plugins` for mixin `ModuleRegistration` * `bash.org` is back up, so the plugin stays * The `TwitchPlugin.useAPIFeatures` setting was removed; API features are now permanently enabled and will more aggressively retry on failures * Now (seems to) compile with `-dip1000`, but isn't configured in `dub.sdl` to do so yet * Polls now support vote choices with spaces in them * Various fixes and improvements
- Loading branch information