1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-26 16:51:46 -07:00

Move blatting to a function so that its local variables don't remain on the stack and pin down objects.

Copied from Perforce
 Change: 189714
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Gareth Rees 2016-03-07 17:31:55 +00:00
parent 4b962a1d33
commit aa45b563da

View file

@ -58,6 +58,18 @@ static void mergelds(int merge) {
}
}
static void blat(mps_ap_t apamc, int percent) {
int i;
for (i=0; i < MAXLDS; i++) {
if (ranint(100) < percent) {
obj_table[i] = allocone(apamc, ranint(1000), mps_rank_exact());
mps_ld_reset(lds[i], arena);
mps_ld_add(lds[i], arena, (mps_addr_t) obj_table[i]);
addr_table[i] = obj_table[i];
}
}
}
static void test(void) {
mps_pool_t poolmv, poolawl, poolamc;
mps_thr_t thread;
@ -129,25 +141,12 @@ static void test(void) {
ldm[i] = (mps_ld_t) p;
}
for (i=0; i < MAXLDS; i++) {
obj_table[i] = allocone(apamc, ranint(1000), mps_rank_exact());
mps_ld_reset(lds[i], arena);
mps_ld_add(lds[i], arena, (mps_addr_t) obj_table[i]);
addr_table[i] = obj_table[i];
}
blat(apamc, 100);
for (merge = 1; merge <= MAXMERGE; merge++) {
comment("Merge %d", merge);
for (i=0; i < MAXLDS; i++) {
if (ranint(100) < BLATPERCENT) {
obj_table[i] = allocone(apamc, ranint(1000), mps_rank_exact());
mps_ld_reset(lds[i], arena);
mps_ld_add(lds[i], arena, (mps_addr_t) obj_table[i]);
addr_table[i] = obj_table[i];
}
}
blat(apamc, BLATPERCENT);
mergelds(merge);
stale = 0;