mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 11:40:11 +03:00
Merge pull request #6108 from urbit/philip/willoc-comment
u3: add comment explaining willoc logic
This commit is contained in:
commit
9d34ff6fba
@ -425,8 +425,18 @@ _ca_willoc(c3_w len_w, c3_w ald_w, c3_w alp_w)
|
||||
|
||||
alp_w = (alp_w + c3_wiseof(u3a_box)) % ald_w;
|
||||
|
||||
// XX: this logic is totally bizarre, but preserve it.
|
||||
//
|
||||
/* XX: this logic is totally bizarre, but preserve it.
|
||||
**
|
||||
** This means we use the next size bigger instead of the "correct"
|
||||
** size. For example, a 20 word allocation will be freed into free
|
||||
** list 2 but will be allocated from free list 3.
|
||||
**
|
||||
** This is important to preserve because the sequential search may be
|
||||
** very slow. On a real-world task involving many compilations,
|
||||
** removing this line made this function appear in ~80% of samples.
|
||||
**
|
||||
** For reference, this was added in cgyarvin/urbit ffed9e748d8f6c.
|
||||
*/
|
||||
if ( (sel_w != 0) && (sel_w != u3a_fbox_no - 1) ) {
|
||||
sel_w += 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user