a bool is actually a single bit, the rest is all padding
brian
c++ guarantees that calls to malloc are aligned https://en.cppreference.com/w/cpp/memory/c/malloc .
you can call malloc(1)
ofc, but calling malloc_usable_size(malloc(1))
is giving me 24, so it at least allocated 24 bytes for my 1, plus any tracking overhead
yeah, as I said, in a stack frame. not surprised a compiler packed them into single bytes in the same frame (but I wouldn't be that surprised the other way either), but the system v abi guarantees at least 4 byte alignment of a stack frame on entering a fn, so if you stored a single bool it'll get 3+ extra bytes added on the next fn call.
computers align things. you normally don't have to think about it. Consider this a TIL moment.
sure, but if you have a single bool in a stack frame it's probably going to be more than a byte. on the heap definitely more than a byte
things that store it as word size for alignment purposes (most common afaik), things that pack multiple books into one byte (normally only things like bool sequences/structs), etc
yeah, if you bind ctrl c and ctrl v to copy and paste keys, you can get the same behavior in terminals and other apps that have weird default bindings for ctrl c and v for historical reasons
it is nice to be able to plug your keyboard into a new computer and have all your shortcuts and layout set up though. I do that so I have the same layout and shortcuts on my personal and work computers regardless of os
no, there are dedicated keycodes for copy and paste, and you can bind them to whatever
ctrl v is convention for paste, but plenty of things (ex terminals) use that for something else. this is a universal (wrt the app receiving it) keycode that means paste. it lets you bind a key, or a keyboard shortcut, to the paste key and paste in any app. without this it isn't possible.
it doesn't even have to be a new programmable keyboard. there exist software key remappers for linux.
you could remap a mouse button to paste, you could remap ctrl v to always paste regardless of the app, etc., all in software, all not possible before.
it seems like a new version of this kind of thing pops up often enough, but it seems like the people making them have never heard of AppStream. like I guess managing webapps too is unique, but everything else and more support AppStream, along with existing gui managers like kde discover, gnome software, etc
it legitimately is a neutral network, I'm not sure what you're trying to say here. https://en.wikipedia.org/wiki/Generative_pre-trained_transformer
they are the first thing that comes up when searching "cursor" in both ddg and google, so I think they're doing ok
because with things that the compiler does, like padding for alignment, it frequently takes up more space than that. that was my argument the whole time. what til are you talking about? I'm talking about an extra layer you've decided doesn't count. ofc sizeof bool will be a byte in all of those languages.
a bool taking up a single byte is a fantasy that those languages use because developers generally don't need to think about all the other stuff going on.