mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-04 12:58:41 +00:00
use radsort for sorting base reloc pages
This commit is contained in:
committed by
Ryan Fleury
parent
fa0b2440ec
commit
0a930be613
+2
-12
@@ -3675,19 +3675,10 @@ THREAD_POOL_TASK_FUNC(lnk_patch_section_symbols_task)
|
|||||||
ProfEnd();
|
ProfEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal int
|
|
||||||
lnk_base_reloc_page_compar(const void *raw_a, const void *raw_b)
|
|
||||||
{
|
|
||||||
const LNK_BaseRelocPage *a = raw_a, *b = raw_b;
|
|
||||||
return u64_compar(&a->voff, &b->voff);
|
|
||||||
}
|
|
||||||
|
|
||||||
internal int
|
internal int
|
||||||
lnk_base_reloc_page_is_before(void *raw_a, void *raw_b)
|
lnk_base_reloc_page_is_before(void *raw_a, void *raw_b)
|
||||||
{
|
{
|
||||||
LNK_BaseRelocPage* a = raw_a;
|
return ((LNK_BaseRelocPage *)raw_a)->voff < ((LNK_BaseRelocPage *)raw_b)->voff;
|
||||||
LNK_BaseRelocPage* b = raw_b;
|
|
||||||
return a->voff < b->voff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal String8List
|
internal String8List
|
||||||
@@ -3760,8 +3751,7 @@ lnk_build_base_relocs(TP_Context *tp, TP_Arena *tp_arena, LNK_Config *config, U6
|
|||||||
ProfEnd();
|
ProfEnd();
|
||||||
|
|
||||||
ProfBegin("Sort Pages on VOFF");
|
ProfBegin("Sort Pages on VOFF");
|
||||||
//radsort(page_arr.v, page_arr.count, lnk_base_reloc_page_is_before);
|
radsort(page_arr.v, page_arr.count, lnk_base_reloc_page_is_before);
|
||||||
qsort(page_arr.v, page_arr.count, sizeof(page_arr.v[0]), lnk_base_reloc_page_compar);
|
|
||||||
ProfEnd();
|
ProfEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user