Skip to content

Commit

Permalink
* core/gc.c: first phase should be a minor phase. allocate a rough o…
Browse files Browse the repository at this point in the history
…ld area first and then kick it off.
  • Loading branch information
_why committed Jul 10, 2009
1 parent 0d3641b commit 50db058
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
9 changes: 5 additions & 4 deletions core/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,16 @@ void potion_garbagecollect(Potion *P, int sz, int full) {

if (M->old_lo == NULL) {
int gensz = POTION_MIN_BIRTH_SIZE * 4;
if (gensz < sz * 4)
gensz = min(POTION_MAX_BIRTH_SIZE, PN_ALIGN(sz * 4, POTION_PAGESIZE));
void *page = pngc_page_new(&gensz, 0);
SET_GEN(old, page, gensz);
}

if ((char *) M->old_cur + sz + potion_birth_suggest(sz, M->old_lo, M->old_cur) +
full = 0;
} else if ((char *) M->old_cur + sz + potion_birth_suggest(sz, M->old_lo, M->old_cur) +
((char *) M->birth_hi - (char *) M->birth_lo) > (char *) M->old_hi)
full = 1;
#if POTION_GC_PERIOD>0
else if (M->pass % POTION_GC_PERIOD == POTION_GC_PERIOD - 1)
else if (M->pass % POTION_GC_PERIOD == POTION_GC_PERIOD)
full = 1;
#endif

Expand Down
4 changes: 0 additions & 4 deletions core/vm-x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,6 @@ void potion_x86_gte(Potion *P, struct PNProto * volatile f, PNAsm * volatile *as
X86_CMP(0x7C); // jl
}

int potion_bitten(unsigned int x) {
return ~x;
}

void potion_x86_bitn(Potion *P, struct PNProto * volatile f, PNAsm * volatile *asmp, PN_SIZE pos, long start) {
PN_OP op = PN_OP_AT(f->asmb, pos);
X86_MATH(0, potion_obj_bitl, {
Expand Down
7 changes: 7 additions & 0 deletions example/gcbench-steady.pn
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# allocate a million lists, but dispose of them immediately.
# run with -V option to see memory use.
#
ary = nil
1000000 times: ary = list(200000).
nil

0 comments on commit 50db058

Please sign in to comment.