Ammar
Arm64
Let me try to check
Ammar
Arm64
Found here https://github.com/torvalds/linux/blob/master/arch/arm64/include/uapi/asm/setup.h#L25
Mar!o
If I use like 95% of the RAM and let's say the RAM is 32 GB there would be still enough left so the OS don't have to use the swap file
Mar!o
But that depends on your swapiness value in the kernel
Mar!o
AFAIK
Ammar
Mar!o
Mine is 0 so only when it reaches near 32GB it uses it
Anonymous
toytta
Send the whole code
Already solved the problem. Do you know how to do concatenation of elements of 1 array of hexadecimal
Ammar
So basically it is possible to prevent the kernel page the memory to the hard disk by doing that?
Ammar
Of course, there is also OOM killer which force kills your process.
Anonymous
toytta
To concatenate asa string?
For example : array[4] = {0x00, 0x00, 0x03, 0x20} //in hexadecimal
Concatenate this and get 00320.
Then after print that in decimal. 320 in hex = 800 in decimal
#39424E
Hi. How to synchronize threads using events?
In the main main thread, marker stream instances are created. How to send an event from the current thread to the main thread? And then from the main thread terminate the marker stream instance?
https://ru.stackoverflow.com/questions/1127135/%d0%9a%d0%b0%d0%ba-%d1%81%d0%b8%d0%bd%d1%85%d1%80%d0%be%d0%bd%d0%b8%d0%b7%d0%b8%d1%80%d0%be%d0%b2%d0%b0%d1%82%d1%8c-%d0%bf%d0%be%d1%82%d0%be%d0%ba%d0%b8-%d1%81-%d0%bf%d0%be%d0%bc%d0%be%d1%89%d1%8c%d1%8e-%d1%81%d0%be%d0%b1%d1%8b%d1%82%d0%b8%d0%b9
Dima
lol
Ajay
Is that option for including bounds checks on`stack arrays`?
Ajay
So, if I don't write that then that will only work on dynamic arrays?
Ajay
Ajay
upar
Ajay
not my comment, found on stackoverflow
toytta
Thank you
Ajay
Does the simple valgrind command check leaks only work for heap allocated arrays and not for stack arrays(that's why that option is needed to include stack-arrays too)?
Ajay
oh, that was for process going outside the heap and stack limits, I thought you were talking about the out-of-bounds access to heap-allocated arrays and stack-allocated arrays.
Ajay
👍
Anonymous
Anonymous
It seems the manufacturer of the board I worked on changed it
Ludovic 'Archivist'
(not counting memory mapped storage here because that would get really out of hand quickly)
Ryuzaki
@nightmareA
Artöm
Mar!o
Not directly on Manjaro Linux it is 0 by default 😉
Mar!o
Itadori
https://www.instagram.com/p/CATYg1UA92x/?igshid=4nxn1ynaz7z0
Ashish
Yarr koi mujhe tree aur graph ke videos dee sakta h coding ninza ke plz ...
Prosvetlennii Dimas
void some_func(VeryBigClass &tmp){
this.VeryBigClassVal = tmp;
}
what will happen when i do something like that? Will it copy tmp to VeryBigClassVall or something different will happen
Vi
/rules
Redocd
/rules
Sandaru
Hello guys i am new for c++ i am making a project music library databse and there is a option to play music in external programme
Which in this case i use windows mediaplayer / KMPlayer My code for excuting programme with arguments is this was working in my win10 laptop without errors but when i tried my programme on some other computer it says some server error cannot find --play-and-exit-- .
NOTE * This part was not implemented by my self but tried googling over and over to find this , i am wonder what was the error that this programme works on me but not on other computerss.
And also file paths are re writed according to other computers.
const char *appname = "c:\\Program Files (x86)\\Windows Media Player\\wmplayer.exe";
const char *filename = fullpath.c_str();
STARTUPINFOA si;
PROCESS_INFORMATION pi;
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
memset(&pi, 0, sizeof(pi));
char buf[MAX_PATH + 300];
wsprintfA(buf, "%s \"%s\" --play-and-exit", appname, filename);
CreateProcessA(0, buf, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
Anonymous
Anonymous
Mar!o
Or C18
Naaa C 18 is too new for me and not supported enough
Ludovic 'Archivist'
Why you would even use this
The only variable size types I use is size_t and intptr_t because I really hate variable size induced bug or non-cross-platform bugs
Anonymous
Mar!o
Mar!o
I don't need type safety I have Rust for that
Alexander
printf("hello, world!");
Artöm
Artöm
Artöm
intptr_t is bogus imo. Why would I want to store address as a signed integer?
Ludovic 'Archivist'
intptr_t is bogus imo. Why would I want to store address as a signed integer?
You are totally right (but I don't do operations on them anyway) but a very valid usecase is pointer subtraction to get byte size. A negative result means that the operands are in wrong order, a positive that they are in correct order, and clearing the sign bit (on the architectures where it is possible) gives you the result whichever they are
Artöm
Legit
Ludovic 'Archivist'
Ludovic 'Archivist'
Casting to intptr_t is semantically correct, putting the difference in a ptrdiff_t also is, but converting a pointer to a ptrdiff_t is not semantically correct
Ludovic 'Archivist'
You are, the idea is to obtain an explicit memory address instead or a typed memory address (also void* is cursed)
Ludovic 'Archivist'
Hence I am storing a memory address, not a pointer
Ludovic 'Archivist'
I write code that may be used on avr CPUs just as much as on x86_64 so I tend to write things as in line with the standard as I can and leave as little undefined as possible
ABDULLAH
i need a tutorial or document about mariadb connection with c programming language? If anyone help me, i will be happy
Henry
/get ide
Henry
/get cbook
Ludovic 'Archivist'
you create the filter with (for example):
gp::quotient_filter<uint16_t, 10,6,stepcache_skipstone>
Ludovic 'Archivist'
It is built in the code of the skipstone itself
Ludovic 'Archivist'
size_t ret = 0;
void next() {
++ret;
}
operator size_t() {
[[unlikely]] if ( ret >= 128 )
return ret+list[127];
return list[ret];
}
Ludovic 'Archivist'
when ret is above 128, it takes the last tested element+128, then the next, then the next etc etc
Ludovic 'Archivist'
0, 1, 2, 3, those are the first offsets from the original hash position that are explored
Ludovic 'Archivist'
all of those are already in L1 as cache line length is assumed to be 64bytes
Ludovic 'Archivist'
then we skip 4 offsets and go to 8, 9, 10, 11,
Ludovic 'Archivist'
another probable cache line
Ludovic 'Archivist'
so for 8 attempts, we hit the ram twice
Ludovic 'Archivist'
That is if you assume you are reading 32 bits integer
Ludovic 'Archivist'
that skipstone is for 64bit integers
Ludovic 'Archivist'
yes
Ludovic 'Archivist'
The reason I went with the 64bit one first in the lib is because it is generic and I plan to move them out of here to use them more generically
Ludovic 'Archivist'
It is not only posix but for OS specifics, it assumes posix
Ludovic 'Archivist'
Most of it is freestanding, so OS-less
Ludovic 'Archivist'
This quotient filter for example can be used on an arduino board without an OS
Ludovic 'Archivist'
I tried to be in between cache friendliness and cluster avoidance on that one, so for a fair evaluation, I advise to try at multiple degrees of "fullness", like 10% filled, 25% filled, 50% filled, 75% filled, 90% filled and 95% filled