Тёмный

Exploring Swift Memory Layout • Mike Ash • GOTO 2016 

GOTO Conferences
Подписаться 996 тыс.
Просмотров 18 тыс.
50% 1

This presentation was recorded at GOTO Copenhagen 2016
gotocph.com
Mike Ash - Plausible Labs
ABSTRACT
Let's get down to bits and bytes! Abstraction is great, but sometimes it's useful to dig down. In this session, we'll explore exactly how Swift lays out data in memory, including both your own variables and Swift's internal data structures. [...]
TIMECODES
0:00 Introduction
0:31 About Me
6:19 Memory - Big Picture
9:47 Dumping Memory
14:50 Pointers are Integers
16:51 Bad Pointers
19:43 Safe Reads
20:17 How Much to Read?
22:23 Name Mangling
23:48 Strings
25:29 Output
26:05 Graphviz
27:23 Memory Layouts
28:19 C structs
30:17 C++ classes
36:03 Swift Types
42:26 Objective-C Classes
43:30 Swift Classes
44:11 Method Calls
44:42 Subclasses
45:14 Arrays
46:15 Protocols
49:38 Protocol Method Call
50:41 Enums
53:28 Wrapping Up
Download slides and read the full abstract here:
gotocon.com/cph-2016/presenta...
/ gotocon
/ goto-
/ gotoconferences
#Swift
Looking for a unique learning experience?
Attend the next GOTO conference near you! Get your ticket at gotopia.tech
Sign up for updates and specials at gotopia.tech/newsletter
SUBSCRIBE TO OUR CHANNEL - new videos posted almost daily.
ru-vid.com...

Наука

Опубликовано:

 

19 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 9   
@Andp92
@Andp92 6 лет назад
Best best best ever video I ve ever seen in my life
@dostoevsky8878
@dostoevsky8878 3 года назад
+1
@colza1025
@colza1025 5 лет назад
This is very very very deep... I'll come back again. lol
@dylanwang8590
@dylanwang8590 5 лет назад
Deep and helpful, need rethink, learn more reference resources to understand, thx.
@yecanxu5812
@yecanxu5812 7 лет назад
cool
@0xSimple
@0xSimple 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.
@0xSimple
@0xSimple 4 года назад
@@joshualearn8193 Thank you, I think I understand it now! :D
@bobbastian760
@bobbastian760 6 лет назад
Ahhh... The Initial So (tm).....
Далее
Wait for it 😇
00:45
Просмотров 3,4 млн
Rust and RAII Memory Management - Computerphile
24:22
Просмотров 220 тыс.
CppCon 2014: Mike Acton "Data-Oriented Design and C++"
1:27:46
Swift Memory Layout
1:21:43
Просмотров 2,7 тыс.
Enter The Arena: Simplifying Memory Management (2023)
1:47:50
All Rust string types explained
22:13
Просмотров 155 тыс.