bors r+
2023-07-14T11:07:23.147996Z ERROR Database error 22008: date/time field value out of range: "0000-00-00 00:00:00"
QUERY: CREATE TABLE maps
(
map text,
server text,
points bigint default '0',
stars bigint default '0',
mapper text,
timestamp timestamp default '0000-00-00 00:00:00'
);
4838c10
Don't run status checks on GitHub merge queue state twice - heinrich5991$ curl -I https://ddnet.org/downloads/sha256sums.txt
HTTP/2 200
last-modified: Sun, 09 Jul 2023 00:19:13 GMT
$ curl -I https://ddnet.org/downloads/DDNet-nightly-win64.zip
HTTP/2 200
last-modified: Thu, 13 Jul 2023 22:15:51 GMT
#[no_mangle]
pub unsafe extern "C" fn dict_get(
map: *mut std::ffi::c_void,
key: &[u8; 32],
) -> *mut std::ffi::c_void {
let ptr = map.cast::<HashMap<[u8; 32], NonNull<std::ffi::c_void>>>();
if let Some(v) = (*ptr).get(key) {
v.as_ptr()
} else {
std::ptr::null_mut()
}
}
its safe if i save a ptr to a hashmap outside rust and pass it to extern c rust functions to use its functionality? (edited)unsafe_and_evil {
int g_evil = 0;
}
void IncrementGlobal(int v) {
unsafe_and_evil {
g_evil += v;
}
}
mut
s are unsafe because you can obtain multiple mut
referencesmut
) global stateMutex<Option<State>>
would probably work?Mutex<Option<State>>
would probably work? static
static mut
)static
.lock().unwrap()
unsafe
static DATA: Mutex<Option<Data>> = Mutex::new(None);
work for your use-case?static DATA: Mutex<Option<Data>> = Mutex::new(None);
work for your use-case? OnceCell
but I need to mutate it more than onceuse std::cell::Cell;
thread_local! {
pub static FOO: Cell<u32> = const { Cell::new(1) };
}
static DATA: Mutex<Option<Data>> = Mutex::new(None);
work for your use-case? std::sync::Mutex
but not with tokio::sync::Mutex
, I'm perhaps just misunderstanding something, but it seems tokios mutexguard doesn't implement DerefMut for some reasonArc<Context>
like I did last time, I can't believe you actually made me feel bad about using a globalstd::sync::Mutex
but not with tokio::sync::Mutex
, I'm perhaps just misunderstanding something, but it seems tokios mutexguard doesn't implement DerefMut for some reason Arc<Mutex<Context>>
that isstd::sync::Mutex
but not with tokio::sync::Mutex
, I'm perhaps just misunderstanding something, but it seems tokios mutexguard doesn't implement DerefMut for some reason tokio
's MutexGuard
seems to impl DerefMut
std::sync::Mutex
but not with tokio::sync::Mutex
, I'm perhaps just misunderstanding something, but it seems tokios mutexguard doesn't implement DerefMut for some reason tokio
's MutexGuard
seems to impl DerefMut
blocking_lock()
OnceCell
OnceLock
instead: https://doc.rust-lang.org/std/sync/struct.OnceLock.htmlOnceCell
(stdlib) doesn't work with threadsArc
and Mutex
there won't be any memory/data race issue's
?'s
? s
from the noun there and not as a contraction'
are bloat 's
? fn<😬a>(hello: 😬a str) -> &😬a str;
end
parameter of str_utf8_find_nocase
.
Closes #6850.
Add optional end
output parameter to str_utf8_find_nocase
which is set to a pointer into the haystack after the matched string.
This is necessary because there are pairs of matching upper case and lower case Unicode characters with different byte length (e.g. both I
and İ
map to i
), so the byte length of the string matched in the h...cfdc696
Delay "Ingame moved" warning in editor - Robyt3