Inline Functions in C

  Рет қаралды 10,518

Tsoding Daily

Tsoding Daily

Күн бұрын

Пікірлер: 11
@BreiiisBreiiis
@BreiiisBreiiis 3 жыл бұрын
I do love my zozing sessions.
@BradenBest
@BradenBest 2 жыл бұрын
counterargument regarding inline: even if the compiler does know better than you, you are still writing code for _other humans_ as well as the compiler. Even if inline doesn't do anything, it's a helpful hint for other programmers to know that the _intent_ was for the function to be inlined.
@D0Samp
@D0Samp 2 жыл бұрын
On the other hand there is link-time optimization which instructs the compiler to include call path information so the linker can perform the job of throwing away all known dead code. It works best with multiple compilation units sharing (mostly unused) library code and any level of optimization turned on (higher ones obviously favor more inlining). Still ends up a bit larger than removing everything yourself upfront in this example, but at least there are no library symbols left either. If you feel like cheating, you can also pass -fwhole-program on GCC with single compilation unit programs like these, which makes the compiler treat everything apart from main as not-actually-extern.
@Pi7on
@Pi7on 3 жыл бұрын
Congrats for 2k subs! Love your content!
@peterhutt4807
@peterhutt4807 3 жыл бұрын
Great video Alexey, really informative
@randomsoul294
@randomsoul294 2 жыл бұрын
Coming from a mathematical background I think that the hack you're using to not have scalar functions is more of a footgun than anything else.
@comradestinger
@comradestinger 7 ай бұрын
Hadamard multiplication is extremely useful in computer graphics. (blending colors, working with bounding boxes, operations on multidimensional arrays like pixels.)
@thegabriel3891
@thegabriel3891 2 жыл бұрын
7:40 Russian Doomer music vol.9 (New Superior?)
@BradenBest
@BradenBest 2 жыл бұрын
You should add a macro to the generated header that specifies its semantic version, e.g. define LA_VERSION "1.0.1", or do it libc style 10001L
@Ansatz66
@Ansatz66 2 жыл бұрын
It seems very unfair to judge the final executable by looking at the object files. How can the compiler remove definitions from the object files when it doesn't know how those object files will be used? Only the linker can possibly know that some definition in some object file is never used. Clearly the linker is also not removing unnecessary functions from the final executable, but by only looking at the object files we're not even giving the linker its fair chance.
@GegoXaren
@GegoXaren 2 жыл бұрын
You should add Generic Macros... All C standards over C11 support it. You can declare the functions as "UNUSED" using a macro, as is done in many C libraries. That will make the compiler not complain.
Coding a Bouncing Ball in Terminal
1:26:29
Tsoding Daily
Рет қаралды 81 М.
Linus Torvalds "Nothing better than C"
1:28
RunTime Recruitment
Рет қаралды 1,4 МЛН
Люблю детей 💕💕💕🥰 #aminkavitaminka #aminokka #miminka #дети
00:24
Аминка Витаминка
Рет қаралды 1,4 МЛН
Новый уровень твоей сосиски
00:33
Кушать Хочу
Рет қаралды 1,4 МЛН
Секрет фокусника! #shorts
00:15
Роман Magic
Рет қаралды 79 МЛН
Alat yang Membersihkan Kaki dalam Hitungan Detik 🦶🫧
00:24
Poly Holy Yow Indonesia
Рет қаралды 11 МЛН
Advanced C: The UB and optimizations that trick good programmers.
1:12:34
Eskil Steenberg
Рет қаралды 168 М.
Newton's Method in C
1:33:17
Tsoding Daily
Рет қаралды 22 М.
Making Cursed Textures with OpenGL and C
1:07:39
Tsoding Daily
Рет қаралды 17 М.
Rewriting Go's flag module in C
2:39:50
Tsoding Daily
Рет қаралды 14 М.
Using C instead of Bash
1:14:06
Tsoding Daily
Рет қаралды 41 М.
why do header files even exist?
10:53
Low Level Learning
Рет қаралды 402 М.
Hot Code Reloading in C
2:16:18
Tsoding Daily
Рет қаралды 64 М.
The Inline Keyword in C.
16:18
Jacob Sorber
Рет қаралды 57 М.
Literate Haskell but in C
2:25:24
Tsoding Daily
Рет қаралды 19 М.
the TRUTH about C++ (is it worth your time?)
3:17
Low Level Learning
Рет қаралды 695 М.
Люблю детей 💕💕💕🥰 #aminkavitaminka #aminokka #miminka #дети
00:24
Аминка Витаминка
Рет қаралды 1,4 МЛН