strip unicode dashes, trim restating doc comments, untrack forbidden files
This commit is contained in:
@@ -9,7 +9,7 @@ use std::sync::atomic::{AtomicI32, Ordering};
|
||||
// ── MSVC Buffer Security Check (/GS) ────────────────────────────────────────
|
||||
//
|
||||
// MSVC's /GS flag instruments functions with stack canaries. These two symbols
|
||||
// implement the canary check. The cookie value is arbitrary — real MSVC CRT
|
||||
// implement the canary check. The cookie value is arbitrary -- real MSVC CRT
|
||||
// randomises it at startup, but for a statically-linked helper library this
|
||||
// fixed sentinel is sufficient.
|
||||
|
||||
@@ -44,15 +44,15 @@ pub unsafe extern "C" fn _Init_thread_header(guard: *mut i32) {
|
||||
loop {
|
||||
let val = guard.read_volatile();
|
||||
if val == 0 {
|
||||
// Already initialised — tell caller to skip
|
||||
// Already initialised -- tell caller to skip
|
||||
return;
|
||||
}
|
||||
if val == -1 {
|
||||
// Not yet initialised — try to claim it
|
||||
// Not yet initialised -- try to claim it
|
||||
guard.write_volatile(1);
|
||||
return;
|
||||
}
|
||||
// val == 1: another thread is initialising — yield and retry
|
||||
// val == 1: another thread is initialising -- yield and retry
|
||||
std::thread::yield_now();
|
||||
}
|
||||
}
|
||||
@@ -71,22 +71,22 @@ pub unsafe extern "C" fn _Init_thread_footer(guard: *mut i32) {
|
||||
// MinGW's libstdc++ exports the same operators but with GCC/Itanium mangling,
|
||||
// so the linker can't match them. We provide the MSVC-mangled versions here.
|
||||
|
||||
/// `std::nothrow` — MSVC-mangled `?nothrow@std@@3Unothrow_t@1@B`
|
||||
/// `std::nothrow` -- MSVC-mangled `?nothrow@std@@3Unothrow_t@1@B`
|
||||
/// An empty struct constant used as a tag for nothrow `new`.
|
||||
#[export_name = "?nothrow@std@@3Unothrow_t@1@B"]
|
||||
pub static MSVC_STD_NOTHROW: u8 = 0;
|
||||
|
||||
/// `operator new(size_t, const std::nothrow_t&)` — nothrow allocation
|
||||
/// `operator new(size_t, const std::nothrow_t&)` -- nothrow allocation
|
||||
/// MSVC-mangled: `??2@YAPEAX_KAEBUnothrow_t@std@@@Z`
|
||||
#[export_name = "??2@YAPEAX_KAEBUnothrow_t@std@@@Z"]
|
||||
pub unsafe extern "C" fn msvc_operator_new_nothrow(size: usize, _nothrow: *const u8) -> *mut u8 {
|
||||
let size = if size == 0 { 1 } else { size };
|
||||
let layout = std::alloc::Layout::from_size_align_unchecked(size, 8);
|
||||
let ptr = std::alloc::alloc(layout);
|
||||
ptr // null on failure — nothrow semantics
|
||||
ptr // null on failure -- nothrow semantics
|
||||
}
|
||||
|
||||
/// `operator delete(void*, size_t)` — sized deallocation
|
||||
/// `operator delete(void*, size_t)` -- sized deallocation
|
||||
/// MSVC-mangled: `??3@YAXPEAX_K@Z`
|
||||
#[export_name = "??3@YAXPEAX_K@Z"]
|
||||
pub unsafe extern "C" fn msvc_operator_delete_sized(ptr: *mut u8, size: usize) {
|
||||
|
||||
Reference in New Issue
Block a user