Replace the revolting build pointer data structure by a proper data

type.  Make it abstract because that's possible.  Change data layout
so that the slots belonging to a sector are together in memory, it's
nicer to the cache.
(bp): The new type.  Users changed.
(get_wp): Update accordingly.
(alloc_bp): New.
(update_main, calc_all): Use it.  Before, calc_all() allocated 1/7
more than necessary.
This commit is contained in:
Markus Armbruster 2007-01-13 09:07:59 +00:00
parent ac9cdf5bb9
commit 5507e8a1dc
13 changed files with 51 additions and 39 deletions

View file

@ -39,10 +39,11 @@
#define SCT_EFFIC (SCT_TYPE_MAX + 1)
void fill_update_array(int *bp, struct sctstr *sp);
int gt_bg_nmbr(int *bp, struct sctstr *sp, i_type comm);
void pt_bg_nmbr(int *bp, struct sctstr *sp, i_type comm, int amount);
int get_materials(struct sctstr *, int *, int *, int);
struct bp *alloc_bp(void);
void fill_update_array(struct bp *, struct sctstr *);
int gt_bg_nmbr(struct bp *, struct sctstr *, i_type);
void pt_bg_nmbr(struct bp *, struct sctstr *, i_type, int);
int get_materials(struct sctstr *, struct bp *, int *, int);
extern long money[MAXNOC];
extern long pops[MAXNOC];