more monster iteration

Re-use the array allocated for iterating over all monsters during
monster movement much of the time.  It was being allocated from
scratch for each round of monster movement, then freed after they
moved, then repeated the next round.
This commit is contained in:
PatR
2024-01-25 23:59:32 -08:00
parent 9cd1a571ae
commit 17414c500a
3 changed files with 37 additions and 12 deletions

View File

@@ -1736,6 +1736,7 @@ extern void wake_nearby(void);
extern void wake_nearto(coordxy, coordxy, int);
extern void seemimic(struct monst *) NONNULLARG1;
extern void normal_shape(struct monst *) NONNULLARG1;
extern void alloc_itermonarr(unsigned);
extern void iter_mons_safe(boolean (*)(struct monst *));
extern void iter_mons(void (*)(struct monst *));
extern struct monst *get_iter_mons(boolean (*)(struct monst *));