Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Aug 16, 2023
1 parent 6a83202 commit b8bad6e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/jsvar.c
Original file line number Diff line number Diff line change
Expand Up @@ -4196,6 +4196,9 @@ int jsvGarbageCollect() {

#ifndef SAVE_ON_FLASH
void jsvDefragment() {
/* FIXME: we should surely be able to go through without `defragVars`,
and just work from the beginning to the end. We really need to be able
to move flat strings: https://github.com/espruino/Espruino/issues/1740 */
// garbage collect - removes cruft
// also puts free list in order
jsvGarbageCollect();
Expand All @@ -4214,6 +4217,7 @@ void jsvDefragment() {
} else if (jsvGetLocks(v)==0) {
defragVars[defragVarIdx] = vr;
defragVarIdx = (defragVarIdx+1) & (DEFRAGVARS-1);
// why do we roll over and not stop?
}
}
}
Expand Down

0 comments on commit b8bad6e

Please sign in to comment.