Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b318de4
radlink: enable C11 atomics so BLAKE3 skips the lock'd CPU-feature load
honkstar1 Jun 16, 2026
9aa79c3
radlink: skip symbol-name string-table scan on interp-only paths
honkstar1 Jun 16, 2026
f97b1eb
radlink: make symbol ref-list merge O(1) with a tail pointer
honkstar1 Jun 16, 2026
d052062
thread_pool: wake workers with one batched semaphore release
honkstar1 Jun 16, 2026
ee7dc9e
base: use memchr in str8_cstring_capped instead of a byte loop
honkstar1 Jun 16, 2026
05af760
radlink: fold CV type-index fixup into a single hash probe
honkstar1 Jun 16, 2026
0e9b3fe
radlink: release copy-on-write input views in parallel before exit
honkstar1 Jun 16, 2026
8fcd84b
radlink: trim COFF symbol/section parse overhead
honkstar1 Jun 17, 2026
5d400d2
radlink: cache leaf hash per bucket to avoid deref in type-dedup probe
honkstar1 Jun 17, 2026
be3e663
radlink: release the ~1GB image buffer early so reclaim overlaps the run
honkstar1 Jun 17, 2026
68c5ef3
radlink: memoize parsed COFF symbols per obj (kills #1 link hotspot)
honkstar1 Jun 17, 2026
4e077fd
radlink: size the assigned-ti table by unique types, not total (recla…
honkstar1 Jun 17, 2026
c2c3018
radlink: accept GNU ar (.a) archives as lib input
honkstar1 Jun 18, 2026
4fac1f6
radlink: slim the parsed-symbol memo (drop name, decode on demand)
honkstar1 Jun 18, 2026
fe5204e
radlink: pack LNK_ParsedSymbolLite to 16B (offset + U32 value)
honkstar1 Jun 18, 2026
a78313a
radlink: garbage-collect unreferenced CodeView types before PDB emit
honkstar1 Jun 19, 2026
61797ba
radlink: /OPT:ICF identical COMDAT folding (code + read-only data), p…
honkstar1 Jun 19, 2026
252aed4
radlink/pdb: coalesce DBI section contributions; stabilize + parallel…
honkstar1 Jun 19, 2026
bd0fc82
radlink: frontier worklist for type-GC transitive closure (perf)
honkstar1 Jun 19, 2026
3bb86c2
radlink: count ICF reloc slices in the parallel fill, not a serial re…
honkstar1 Jun 19, 2026
f45f200
radlink: skip the GC mark atomic on the already-reachable fast path
honkstar1 Jun 19, 2026
aceb5c3
radlink: make type-GC opt-in (/OPT:GCTYPES), default off
honkstar1 Jun 19, 2026
ab0c3e6
linker: make import-table generation deterministic
honkstar1 Jun 19, 2026
8d00121
radlink: parallelize the section-contrib sort for large chunks
honkstar1 Jun 19, 2026
c6903c2
radlink: skip converged classes in ICF refinement
honkstar1 Jun 19, 2026
351b2ef
radlink: cache symbol interp so the lib search stops re-parsing resol…
honkstar1 Jun 19, 2026
9223d30
radlink: skip redundant library re-searches in the resolution fixpoint
honkstar1 Jun 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,14 @@ popd
pushd build
if "%raddbg%"=="1" set didbuild=1 && %compile% ..\src\raddbg\raddbg_main.c %compile_link% %link_icon% %out%raddbg.exe || exit /b 1
if "%raddbg_non_graphical%"=="1" set didbuild=1 && %compile% -DWM_STUB=1 -DR_BACKEND=R_BACKEND_STUB ..\src\raddbg\raddbg_main.c %compile_link% %link_icon% %out%raddbg_non_graphical.exe || exit /b 1
if "%radlink%"=="1" set didbuild=1 && %compile% ..\src\linker\lnk.c %compile_link% %linker% /NOIMPLIB %linker% /NATVIS:"%~dp0\src\linker\linker.natvis" %out%radlink.exe || exit /b 1
:: NOTE: -DBLAKE3_ATOMICS=1 makes BLAKE3 use C11 _Atomic (plain atomic load) for
:: get_cpu_features instead of MSVC's _InterlockedOr `lock or` barrier on every
:: compress dispatch (was a ~5.5s main-thread hot spot). MSVC C11 atomics require
:: /std:c11 /experimental:c11atomics. Kept external so the vendored blake3 source
:: stays pristine.
set radlink_msvc_flags=
if "%msvc%"=="1" set radlink_msvc_flags=/std:c11 /experimental:c11atomics -DBLAKE3_ATOMICS=1
if "%radlink%"=="1" set didbuild=1 && %compile% %radlink_msvc_flags% ..\src\linker\lnk.c %compile_link% %linker% /NOIMPLIB %linker% /NATVIS:"%~dp0\src\linker\linker.natvis" %out%radlink.exe || exit /b 1
if "%radbin%"=="1" set didbuild=1 && %compile% ..\src\radbin\radbin_main.c %compile_link% %out%radbin.exe || exit /b 1
if "%raddump%"=="1" set didbuild=1 && %compile% ..\src\raddump\raddump_main.c %compile_link% %out%raddump.exe || exit /b 1
if "%ryan_scratch%"=="1" set didbuild=1 && %compile% ..\src\scratch\ryan_scratch.c %compile_link% %out%ryan_scratch.exe || exit /b 1
Expand Down
4 changes: 3 additions & 1 deletion src/base/base_strings.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ str8_cstring_capped(void *cstr, void *cap)
{
char *ptr = (char *)cstr;
char *opl = (char *)cap;
for (;ptr < opl && *ptr != 0; ptr += 1);
// memchr is typically SIMD-accelerated; much faster than a byte-by-byte scan
char *nul = (char *)memchr(ptr, 0, (U64)(opl - ptr));
ptr = nul ? nul : opl;
U64 size = (U64)(ptr - (char *)cstr);
String8 result = str8((U8*)cstr, size);
return result;
Expand Down
1 change: 1 addition & 0 deletions src/base/base_threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ internal Semaphore semaphore_open(String8 name);
internal void semaphore_close(Semaphore semaphore);
internal B32 semaphore_take(Semaphore semaphore, U64 endt_us);
internal void semaphore_drop(Semaphore semaphore);
internal void semaphore_drop_n(Semaphore semaphore, U32 count); // release `count` permits in one syscall

//- rjf: barriers
internal Barrier barrier_alloc(U64 count);
Expand Down
28 changes: 24 additions & 4 deletions src/coff/coff_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,16 @@ coff_section_header_array_from_name(Arena *arena, String8 string_table, COFF_Sec
}


// NOTE: name-skipping variants. coff_read_symbol_name does a cstr scan over the
// memory-mapped string table, which is the dominant cost when parsing symbols in
// bulk; callers that only need the scalar fields (value/section/storage_class/aux,
// e.g. symbol-value interpretation) should use these to avoid that scan. The full
// coff_parse_symbol{16,32} below are these plus the name read, so the scalar-field
// logic lives in exactly one place.
internal COFF_ParsedSymbol
coff_parse_symbol32(String8 string_table, COFF_Symbol32 *sym32)
coff_parse_symbol32_no_name(COFF_Symbol32 *sym32)
{
COFF_ParsedSymbol result = {0};
result.name = coff_read_symbol_name(string_table, &sym32->name);
result.value = sym32->value;
result.section_number = sym32->section_number;
result.type = sym32->type;
Expand All @@ -181,10 +186,9 @@ coff_parse_symbol32(String8 string_table, COFF_Symbol32 *sym32)
}

internal COFF_ParsedSymbol
coff_parse_symbol16(String8 string_table, COFF_Symbol16 *sym16)
coff_parse_symbol16_no_name(COFF_Symbol16 *sym16)
{
COFF_ParsedSymbol result = {0};
result.name = coff_read_symbol_name(string_table, &sym16->name);
result.value = sym16->value;
if (sym16->section_number == COFF_Symbol_DebugSection16) {
result.section_number = COFF_Symbol_DebugSection32;
Expand All @@ -200,6 +204,22 @@ coff_parse_symbol16(String8 string_table, COFF_Symbol16 *sym16)
return result;
}

internal COFF_ParsedSymbol
coff_parse_symbol32(String8 string_table, COFF_Symbol32 *sym32)
{
COFF_ParsedSymbol result = coff_parse_symbol32_no_name(sym32);
result.name = coff_read_symbol_name(string_table, &sym32->name);
return result;
}

internal COFF_ParsedSymbol
coff_parse_symbol16(String8 string_table, COFF_Symbol16 *sym16)
{
COFF_ParsedSymbol result = coff_parse_symbol16_no_name(sym16);
result.name = coff_read_symbol_name(string_table, &sym16->name);
return result;
}

internal COFF_ParsedSymbol
coff_parse_symbol(COFF_FileHeaderInfo header, String8 string_table, String8 symbol_table, U32 symbol_idx)
{
Expand Down
2 changes: 2 additions & 0 deletions src/coff/coff_parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ internal String8 coff_name_from_section_header (String8 str

internal COFF_ParsedSymbol coff_parse_symbol32(String8 string_table, COFF_Symbol32 *sym32);
internal COFF_ParsedSymbol coff_parse_symbol16(String8 string_table, COFF_Symbol16 *sym16);
internal COFF_ParsedSymbol coff_parse_symbol32_no_name(COFF_Symbol32 *sym32);
internal COFF_ParsedSymbol coff_parse_symbol16_no_name(COFF_Symbol16 *sym16);
internal COFF_ParsedSymbol coff_parse_symbol (COFF_FileHeaderInfo header, String8 string_table, String8 symbol_table, U32 symbol_idx);

internal COFF_Symbol32Array coff_symbol_array_from_data_16(Arena *arena, String8 data, U64 symbol_array_off, U64 symbol_count);
Expand Down
Loading