Differences From Artifact [8783bcd63b]:
- File
src/commands.mm
— part of check-in
[489124a92f]
at
2025-03-16 10:11:39
on branch trunk
— Use one autorelease pool per frame
This way, nowhere else autorelease pools need to be managed. (user: js, size: 11325) [annotate] [blame] [check-ins using]
To Artifact [586613b4e5]:
- File src/commands.mm — part of check-in [89fbd7a152] at 2025-03-20 13:21:56 on branch trunk — Make more use of convenience methods (user: js, size: 11220) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
16 17 18 19 20 21 22 | void alias(OFString *name, OFString *action) { Alias *alias = identifiers[name]; if (alias == nil) { | < < | | | | | | | | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | void alias(OFString *name, OFString *action) { Alias *alias = identifiers[name]; if (alias == nil) { alias = [Alias aliasWithName:name action:action persisted:true]; if (identifiers == nil) identifiers = [[OFMutableDictionary alloc] init]; identifiers[name] = alias; } else { if ([alias isKindOfClass:Alias.class]) alias.action = action; else conoutf( @"cannot redefine builtin %@ with an alias", name); } } COMMAND(alias, ARG_2STR) int variable(OFString *name, int min, int cur, int max, int *storage, void (*function)(), bool persisted) { Variable *variable = [Variable variableWithName:name min:min max:max storage:storage function:function persisted:persisted]; if (identifiers == nil) identifiers = [[OFMutableDictionary alloc] init]; identifiers[name] = variable; return cur; |
︙ | ︙ | |||
85 86 87 88 89 90 91 | return nil; } bool addcommand(OFString *name, void (*function)(), int argumentsTypes) { | | | | | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | return nil; } bool addcommand(OFString *name, void (*function)(), int argumentsTypes) { Command *command = [Command commandWithName:name function:function argumentsTypes:argumentsTypes]; if (identifiers == nil) identifiers = [[OFMutableDictionary alloc] init]; identifiers[name] = command; return false; |
︙ | ︙ |