Red

177 posts

Red banner
Red

Red

@RedNicStone

α2 Centauri, Sagittarius Katılım Haziran 2023
99 Takip Edilen17 Takipçiler
Red
Red@RedNicStone·
@straceX This is a great technique, unfortunately it dosent work in constexpr :(
English
0
0
0
118
Strace
Strace@straceX·
most x86-64 linux user-space pointers only use 48 address bits. some runtimes temporarily store metadata in the upper bits, then mask them out before dereferencing the pointer again. this technique is called pointer tagging. lisp runtimes, garbage collectors, and JavaScript engines use it to attach extra information to pointers without additional memory overhead.
Strace tweet media
English
9
27
280
14K
Red
Red@RedNicStone·
@MarekKnapek @straceX This isent the case. Canonical memory space is defined as 48-bit on x86-64, which means any virtual address space the system gives you will always fall into that range unless you add extra flags during mmap.
English
0
0
0
27
Marek Knápek
Marek Knápek@MarekKnapek·
@straceX This will break when we transition from 44bit pointers to 48bit ones. Later again 48bit -> 52bit. It also breaks HW security, such as pointer signing. Better align your allocations and use the lower bits.
English
4
0
5
628
Red
Red@RedNicStone·
@sudox7 > Empty string allocates on most implementations Maybe if you wrote the implementations
English
0
0
7
336
SudoX7
SudoX7@sudox7·
your default constructor is doing something you never asked it to do
SudoX7 tweet media
English
13
1
47
6.3K
yuki ➡️ in Tokyo
yuki ➡️ in Tokyo@fragmentums·
I came back home to America and find out my neighbor cut my coax internet line and then just routed it to their unit. What the hellie
yuki ➡️ in Tokyo tweet media
English
103
254
14.4K
300.3K
Red
Red@RedNicStone·
@themovercell @TrisH0x2A You can, but its a little inconsistent because it can break if-else. If you have something like `if (x) SWAP(...); else something();`, it will fail to compile because of the extra semicolon. The gnu statement expression dosent have that problem as it behaves like a function call.
English
0
0
5
237
trish
trish@TrisH0x2A·
the classic XOR swap is broken on modern CPUs. it's slower, and if both operands refer to the same memory it corrupts the value. __typeof__ + a temp is the right way. it works for any type, evaluates once and the compiler typically eliminates the temp entirely. this is what the Linux kernel swap() macro actually does.
trish tweet media
English
11
62
459
29.2K
Red
Red@RedNicStone·
@rovarma @SheriefFYI Proton is for gaming. And like it, any other games on steam are a 1-click install. If anything proton is a lot harder to get running well than a native linux game. Outside of games the situation might be different. But counterpoint; have you tried compiling something for Windows?
English
0
0
0
122
Ritesh Oedayrajsingh Varma
This is 100% true, but Linux devs were and are in denial about this. There’s a reason the install page for every cross platform app looks like * Download Windows installer * Download OSX package * Click here for Linux install instructions that may or may not work on your distro
gingerBill@TheGingerBill

I don't know if a lot of people have thought why this happened. To make Linux viable for the layman, Valve had to make Proton (derived from Wine) so that Win32 API became the first and only stable ABI on Linux. Why did Linux Distro devs not care about stable ABI historically?

English
76
169
4.5K
287.2K
Red
Red@RedNicStone·
@straceX This is also allowed in seccomp, so you can write filter machines for system calls. Its what 'virtualization' tools like docker use. Powerful stuff!
English
0
0
10
5.2K
Strace
Strace@straceX·
linux has a kernel feature that lets you run code on every network packet. nginx uses it. firewalls use it. it's called BPF.
Strace tweet media
English
24
118
1.8K
106K
Red
Red@RedNicStone·
@anicic_filip @Pirat_Nation @Ed__dev This has always worked ok. Windows likes to corrupt the partition but the `ntfsfix` utility fixes that. You can out it in the autostart and never worry.
English
1
0
2
70
Filip Aničić
Filip Aničić@anicic_filip·
@Pirat_Nation @Ed__dev Wonder if games on NTFS could be played on both Linux and Windows when dual booting, without worry. (AFAIK, there is worries of corrupting the FS when dual booting)
English
2
0
3
914
Pirat_Nation 🔴
Pirat_Nation 🔴@Pirat_Nation·
Linux kernel 7.1 introduces a new in-kernel NTFS driver, a complete ground-up rewrite that delivers native read and write access to Windows NTFS volumes directly within the kernel without any userspace tools. It replaces the slower FUSE-based NTFS-3G and the previous NTFS3 driver. Performance gains include 3-5 percent faster single-threaded writes, 35-110 percent faster multi-threaded writes, and mounting times for large drives up to four times quicker. The driver also features lower CPU overhead, better integration with modern kernel infrastructure, and improved reliability. This update marks a major step forward for Linux-Windows storage interoperability. Via:tomshardware
Pirat_Nation 🔴 tweet mediaPirat_Nation 🔴 tweet media
English
106
639
8.3K
367.3K
Red
Red@RedNicStone·
@schteppe Bet on Ru thread 'main' panicked at test.rd
English
0
0
1
85
Red
Red@RedNicStone·
@p1nosaur This is for when you accidentally type 44kF instead of 44kΩ
English
0
0
1
55
Red
Red@RedNicStone·
@GregNotSure @CREATE_rocket The wroom module has a PCB antenna, which is why its so tall. I didn't know espressif made modules with ceramic antennas...?
English
0
0
1
32
東京科学大学ロケットサークル CREATE
電装班ではKiCadを使い、ロケットに搭載する基板の設計を行います🚀​ ノイズの削減や利便性の向上など、日々改良を重ねています💪​ 上級生が一から指導を行うので、初心者でもすぐに設計に取り組めます‼️
東京科学大学ロケットサークル CREATE tweet media東京科学大学ロケットサークル CREATE tweet media
日本語
9
21
305
16.2K
Red retweetledi
Niels Mache
Niels Mache@NielsMache·
NASA spent $100M on Microsoft 365 and put Surfaces on the Orion spacecraft. First technical crisis on humanity’s return to the Moon? Reid Wiseman radios Houston: “I have two Microsoft Outlooks… and neither one works.” Mission Control: “We can remote in.” …from 30,000 miles away at 4,275 mph. The toilet got fixed faster. Battle-tested in space. Still broken everywhere. Ditch Outlook. Use open-source Nextcloud instead. Self-hosted. Reliable. No support tickets from lunar orbit. 🚀 #Nextcloud #OpenSource #Microsoft
English
0
1
4
168
Red
Red@RedNicStone·
@_trish_xD thinking the compiler handles malloc is about the level of competence I expected
English
0
0
1
21
trish
trish@TrisH0x2A·
malloc(0) is legal C. let that sink in for a second. some compilers return NULL. some return a valid pointer you can't dereference but CAN free(). both behaviors are correct according to the C standard. you can allocate zero bytes of memory, get a pointer to nothing, and then dutifully free that nothing. and the language just shrugs and says "yeah that's fine." this is why C developers have trust issues.
English
91
18
639
84.9K
Red
Red@RedNicStone·
@ChShersh Templates for sure. So powerful. Maybe constexpr as a close second.
English
0
0
0
11
Dmitrii Kovanikov
Dmitrii Kovanikov@ChShersh·
gun to your head your favourite C++ feature
English
153
1
134
22K
Red
Red@RedNicStone·
@samsoniuk I wrote something like this for embedded. You could throw an error string that would report a code based on a compiletime hash. With a special define the compiler would also generate a warning for each error string, which a python script would use to make an error lookup table.
English
0
0
1
21
Red
Red@RedNicStone·
@robertgraham Engineers working with precision should use 20 digits, as thats the number required to completely utilise a 64-bit fixed point value
English
0
0
0
84
Robert Graham
Robert Graham@robertgraham·
The correct value of pi 𝜋 is 3.141592653589793. It's the maximum precision for a 64-bit (double) floating point number according to the IEEE 754 standard, used by NASA and rocket engineers for all their calculations for rockets in the solar system. You'll never practically need greater precision, and you'll rarely do floating point at less than 64-bits, so there's little point to use fewer or more digits. Now, gamers might choose 3.1415927 for 32-bit floating point, but they understand the compromise. For everyone else, pi 𝜋 is exactly 3.141592653589793.
World of Engineering@engineers_feed

How many π digits do we need? 3.1415 ➡️ design the finest engines 3.1415926535 ➡️ obtain the circumference of the Earth within a fraction of an inch 3.1415926535897932384626433832795028842 ➡️ measure the radius of the universe to an accuracy equal to the size of a hydrogen atom

English
184
160
3.9K
597K