Vlad
std::memset(arr, 0, sizeof(*arr) * N);
Anonymous
-ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
Anonymous
It will not be removed from clang. Google uses that flag in production
Vlad
std::memset(arr, 0, sizeof(*arr) * N);
or ya know, just std::vector<int> vec(N, 0)
Vlad
Works like a charm
Anonymous
This is not a chat for your homework questions
Asuna 🍓
new int[length] { 0 }
Vlad
Why new tho?
Anonymous
this is bad
Anonymous
Do not use new
Mar!o
use std::unique_ptr
Anonymous
No, this is not the case
Indolent
*sighs*
Indolent
@Bonniex_x Do you give private coding lessons? I'm willing to learn!
ברני
Perv 🤨
Indolent
Perv 🤨
I've reported you for child abuse.
Indolent
Admin look what he just said!!!!!!!
Indolent
Asuna 🍓
No, this is not the case
Could you explain why don't use new?
Anunay
I think she's a pro.
She hasn't sent a single message here
V01D
Perv 🤨
Look at here PFP Shes half naked. I'm just saying.
Vlad
Prone to memory leak
And for sloppy memory related bugs
Indolent
Perv 🤨
I am going to press defamation charges against you.
Indolent
I demand a trial.
Asuna 🍓
Prone to memory leak
It can be used with unique_ptr, but Danya said that's not the reason.
Indolent
She hasn't sent a single message here
Rip. I think I'll never learn CPP 😔
Vlad
It can be used with unique_ptr, but Danya said that's not the reason.
Why would you want unique_ptr instead of a container?
Vlad
unique_ptr doesn't store size
Anonymous
Rip. I think I'll never learn CPP 😔
Don't worry. Only 5 people on the planet know C++
Vlad
unique_ptr doesn't store size
Hasn't got begin() and end()
Indolent
Japanese. That was a very Japanese edit.
Asuna 🍓
Japanese. That was a very Japanese edit.
me? Nah I'm not Japanese 😉
Roxifλsz 🇱🇹
Asuna 🍓
Just weeb?
Just love Japanese animes
Roxifλsz 🇱🇹
Just love Japanese animes
Based chinese cartoon enjoyer
Roxifλsz 🇱🇹
Asuna 🍓
Indolent
I bet she's a Jap.
Roxifλsz 🇱🇹
>she I refuse to believe that
Roxifλsz 🇱🇹
Only male weebs use anime girl profile pictures online
Dima
true
Roxifλsz 🇱🇹
Indolent
Here it goes....
Roxifλsz 🇱🇹
Yes this is OT chat now
Dima
Indolent
Y'all gonna scare the chick away
Vlad
Dima
jojo sux
Indolent
that's blasphemy
Roxifλsz 🇱🇹
Y'all gonna scare the chick away
I am literally physically incapable of not scaring women away
Roxifλsz 🇱🇹
Haram gay anime
Indolent
Indolent
Aye she's as female as a man can be
Vlad
Wierd isn't it a male name?
Dima
s/m/n
Alex
this is not about access, its about computation
M.Khorram
I'm not sure, but processing double might need more cpu clocks so the architecture of cpu matters
Vlad
Processing double and float is the same speed
Vlad
But caching for floats is better
Vlad
If you compute a lot of them.
Anonymous
Because of the amount of data
Vlad
Also floats fit into simd rather nicely
Vlad
Cpu does not have separate blocks for floats and for the double
Vlad
Means the registers are of the size of double
Vlad
Same deal with integers tho
Vlad
Caching and SIMD
Vlad
integers have their own
Vlad
Simply put you can pack 4 floats into 128 bits
Vlad
But only two doubles
Vlad
Given that simd registers are fixed size
Vlad
You can do twice as many computation