!phish support
!phish help - Displays this menu.
!phish ping - Pings the bot and gives uptime.
!phish space - Provides a link to join the Phish Bot space.
void CGameWorld::Clear()
{
// delete all entities
for(auto &pFirstEntityType : m_apFirstEntityTypes)
while(pFirstEntityType)
delete pFirstEntityType; // NOLINT(clang-analyzer-cplusplus.NewDelete)
}
did some experimenting with prediction and somehow when clearing a simulated world this crashed on me while deleting.
fixed it like this... idk if this is a issue or some preperations where wrong on my side
void CGameWorld::Clear()
{
// delete all entities
for(auto &pFirstEntityType : m_apFirstEntityTypes)
{
while(pFirstEntityType)
{
auto nextEntityType = pFirstEntityType->m_pNextTypeEntity;
delete pFirstEntityType->m_pPrevTypeEntity;
delete pFirstEntityType;
pFirstEntityType = nextEntityType;
}
}
}
void CGameWorld::Clear()
{
// delete all entities
for(auto &pFirstEntityType : m_apFirstEntityTypes)
while(pFirstEntityType)
delete pFirstEntityType; // NOLINT(clang-analyzer-cplusplus.NewDelete)
}
did some experimenting with prediction and somehow when clearing a simulated world this crashed on me while deleting.
fixed it like this... idk if this is a issue or some preperations where wrong on my side
void CGameWorld::Clear()
{
// delete all entities
for(auto &pFirstEntityType : m_apFirstEntityTypes)
{
while(pFirstEntityType)
{
auto nextEntityType = pFirstEntityType->m_pNextTypeEntity;
delete pFirstEntityType->m_pPrevTypeEntity;
delete pFirstEntityType;
pFirstEntityType = nextEntityType;
}
}
}
goto_switch 7
in consolegoto_switch 7
in console MACRO_ALLOC_HEAP()
needed?
#define MACRO_ALLOC_HEAP() \
public: \
void *operator new(size_t Size) \
{ \
void *p = malloc(Size); \
mem_zero(p, Size); \
return p; \
} \
void operator delete(void *pPtr) \
{ \
free(pPtr); \
} \
\
private:
it does the same thing constructor doessrc/game/server/entity.h
MACRO_ALLOC_HEAP()
needed?
#define MACRO_ALLOC_HEAP() \
public: \
void *operator new(size_t Size) \
{ \
void *p = malloc(Size); \
mem_zero(p, Size); \
return p; \
} \
void operator delete(void *pPtr) \
{ \
free(pPtr); \
} \
\
private:
it does the same thing constructor does MACRO_ALLOC_HEAP()
needed?
#define MACRO_ALLOC_HEAP() \
public: \
void *operator new(size_t Size) \
{ \
void *p = malloc(Size); \
mem_zero(p, Size); \
return p; \
} \
void operator delete(void *pPtr) \
{ \
free(pPtr); \
} \
\
private:
it does the same thing constructor does T t{}
which is value-initialization
that invokes aggregate-initialization
which does zero-initialization
on every member according to the rules of thatT t{}
which is value-initialization
that invokes aggregate-initialization
which does zero-initialization
on every member according to the rules of that T t{}
which is value-initialization
that invokes aggregate-initialization
which does zero-initialization
on every member according to the rules of that T
.use std::mem::MaybeUninit;
// Create an explicitly uninitialized reference. The compiler knows that data inside
// a `MaybeUninit<T>` may be invalid, and hence this is not UB:
let mut x = MaybeUninit::<&i32>::uninit();
// Set it to a valid value.
x.write(&0);
// Extract the initialized data -- this is only allowed *after* properly
// initializing `x`!
let x = unsafe { x.assume_init() };
auto x = MyClass()
instead of MyClass x
let mut letters = HashMap::new();
for ch in "a short treatise on fungi".chars() {
letters.entry(ch).and_modify(|counter| *counter += 1).or_insert(1);
}
assert_eq!(letters[&'s'], 2);
assert_eq!(letters[&'t'], 3);
assert_eq!(letters[&'u'], 1);
assert_eq!(letters.get(&'y'), None);
let mut letters = HashMap::new();
for ch in "a short treatise on fungi".chars() {
letters.entry(ch).and_modify(|counter| *counter += 1).or_insert(1);
}
assert_eq!(letters[&'s'], 2);
assert_eq!(letters[&'t'], 3);
assert_eq!(letters[&'u'], 1);
assert_eq!(letters.get(&'y'), None);
let entry = STRING_CACHE
.entry(string.to_owned())
.or_insert_with(|| CString::new(string).unwrap());
unsafe { Self::from_raw(mlirStringRefCreateFromCString(entry.as_ptr())) }
// We need to pass null-terminated strings to functions in the MLIR API although
// Rust's strings are not.
static STRING_CACHE: Lazy<DashMap<String, CString>> = Lazy::new(Default::default);
// We need to pass null-terminated strings to functions in the MLIR API although
// Rust's strings are not.
static STRING_CACHE: Lazy<DashMap<String, CString>> = Lazy::new(Default::default);
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "Vec")]
#[rustc_insignificant_dtor]
pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
buf: RawVec<T, A>,
len: usize,
}
(edited)The latest release, v0.17.8, takes from 15% to 75% less time to decode images than the previous v0.17.7. 75% less time means 4x faster! The gains depend heavily on the exact image used, but even 15% is impressive given how fast the code already is.
These gains in decompression are achieved by:
A new, specialized Zlib implementation designed specifically for PNG from the ground up. It delivers much higher performance than the generic Zlib implementation used previously.
PNG filters were rewritten to take advantage of autovectorization, making use of SIMD without unsafe or platform-specific code.
This should make the png crate faster than the reference C implementation in most cases. But it's difficult to benchmark libpng because its API is so unwieldy, and it doesn't provide example code for decoding an image. We'd be very happy to see such benchmark results!