Exploring Swift Memory Layout • Mike Ash • GOTO 2016

  Рет қаралды 18,789

GOTO Conferences

GOTO Conferences

Күн бұрын

Пікірлер: 9
@Andp92
@Andp92 6 жыл бұрын
Best best best ever video I ve ever seen in my life
@dostoevsky8878
@dostoevsky8878 4 жыл бұрын
+1
@colza1025
@colza1025 5 жыл бұрын
This is very very very deep... I'll come back again. lol
@krosshj
@krosshj 4 жыл бұрын
actually, I stilly don't understand the differences between the 'stride' and 'size', could anyone explain it?
@joshualearn8193
@joshualearn8193 4 жыл бұрын
Size refers to the actual number of bytes your object takes up in memory. The stride refers to the distance between two of those objects in memory, which could be different due to alignment rules. Say, for instance, you have a struct with two fields: an Int16 (2 bytes) and a Bool (1 byte). The total size of this struct would be 3 bytes. The trick is that the computer wants to align things neatly in increments of an even number of bytes. So to account for this, if we have multiple instances of this struct side by side, there will be an extra byte of padding after the 3 bytes of each struct. This makes our stride 4 bytes long. So if we have 3 structs of the same type, A, B, and C, then the memory will look something like this: [ A1 | A2 | A3 | | B1 | B2 | B3 | | C1 | C2 | C3 | ... ]. You can see we have 4 bytes from the start of one struct to the start of the next struct, whereas technically the size of one struct is only 3 bytes.
@krosshj
@krosshj 4 жыл бұрын
@@joshualearn8193 Thank you, I think I understand it now! :D
@dylanwang8590
@dylanwang8590 5 жыл бұрын
Deep and helpful, need rethink, learn more reference resources to understand, thx.
@bobbastian760
@bobbastian760 6 жыл бұрын
Ahhh... The Initial So (tm).....
@yecanxu5812
@yecanxu5812 7 жыл бұрын
cool
Functional Programming in 40 Minutes • Russ Olsen • GOTO 2018
41:35
GOTO Conferences
Рет қаралды 817 М.
Walking on LEGO Be Like... #shorts #mingweirocks
00:41
mingweirocks
Рет қаралды 4,9 МЛН
2 MAGIC SECRETS @denismagicshow @roman_magic
00:32
MasomkaMagic
Рет қаралды 30 МЛН
CAN YOU DO THIS ?
00:23
STORROR
Рет қаралды 48 МЛН
Advanced Swift L1 - Memory Layout & Pointers
29:23
AppleProgramming
Рет қаралды 14 М.
Exploring RxJava 2 for Android • Jake Wharton • GOTO 2016
44:15
GOTO Conferences
Рет қаралды 112 М.
RunLoop на главном потоке / Антон Сергеев
43:11
Команда ВКонтакте
Рет қаралды 8 М.
Debugging Swift Memory Issues with Xcode and Profiler
25:31
Make School
Рет қаралды 25 М.
Faster than Rust and C++: the PERFECT hash table
33:52
strager
Рет қаралды 603 М.
Memory 2 - Finding and Fixing Memory Leaks (iOS, Xcode 9, Swift 4)
34:31
Swift Memory Layout
1:21:43
red_mad_dev
Рет қаралды 2,9 М.
Диспетчеризация в Swift.
34:56
Ildar Zalyalov
Рет қаралды 20 М.
Walking on LEGO Be Like... #shorts #mingweirocks
00:41
mingweirocks
Рет қаралды 4,9 МЛН