mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-13 07:32:23 -07: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();
|
||||
}
|
||||
|
||||
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
|
||||
lnk_base_reloc_page_is_before(void *raw_a, void *raw_b)
|
||||
{
|
||||
LNK_BaseRelocPage* a = raw_a;
|
||||
LNK_BaseRelocPage* b = raw_b;
|
||||
return a->voff < b->voff;
|
||||
return ((LNK_BaseRelocPage *)raw_a)->voff < ((LNK_BaseRelocPage *)raw_b)->voff;
|
||||
}
|
||||
|
||||
internal String8List
|
||||
@@ -3760,8 +3751,7 @@ lnk_build_base_relocs(TP_Context *tp, TP_Arena *tp_arena, LNK_Config *config, U6
|
||||
ProfEnd();
|
||||
|
||||
ProfBegin("Sort Pages on VOFF");
|
||||
//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);
|
||||
radsort(page_arr.v, page_arr.count, lnk_base_reloc_page_is_before);
|
||||
ProfEnd();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user