From: ceriel Date: Wed, 3 Dec 1986 13:09:15 +0000 (+0000) Subject: Improved relocation reading code for the !incore strategy. X-Git-Tag: release-5-5~5124 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=91aad0b28e33c5dfb5ca3a63bbea1593c40c0de9;p=ack.git Improved relocation reading code for the !incore strategy. --- diff --git a/util/led/scan.c b/util/led/scan.c index 0ac32dd3b..e9d87ae36 100644 --- a/util/led/scan.c +++ b/util/led/scan.c @@ -494,9 +494,11 @@ modulsize(head) */ static struct outrelo *walkrelo; +static unsigned short cnt_relos; +static unsigned short index; startrelo(head) - struct outhead *head; + register struct outhead *head; { ind_t reloindex; @@ -504,18 +506,29 @@ startrelo(head) reloindex = *(ind_t *)(modulbase + IND_RELO(*head)); walkrelo = (struct outrelo *)address(ALLORELO, reloindex); } + else { + index = 20; + rd_rew_relos(head); + cnt_relos = head->oh_nrelos; + } } struct outrelo * nextrelo() { - static struct outrelo relobuf; + static struct outrelo relobuf[20]; if (incore) return walkrelo++; - rd_relo(&relobuf, 1); - return &relobuf; + if (index == 20) { + int i = cnt_relos >= 20 ? 20 : cnt_relos; + + cnt_relos -= i; + rd_relo(relobuf, i); + index = 0; + } + return &relobuf[index++]; } /* ------------------------------------------------------------------------- */