쉐도잉 연습: You are wasting memory - 영상으로 영어 말하기 배우기

레슨 만드는 중...
1
Take a look at this C code and tell me what the output of that printf will be.
2
If you said 12, you are correct, and that's because each integer is 4 bytes wide.
3
Now, what happens if I add a character to the structure?
4
You probably already know that a character has a size of 1 byte, but if we run this program, we can see that the structure became 16 bytes.
5
This happens because of memory alignment.
6
You can imagine memory as a row of numbered boxes, where each number represents an address.
7
Each box can hold exactly one byte.
8
We know that on 64-bit machines an integer is usually four bytes.
9
For it to be aligned, its address must be a multiple of its size.
10
If a value is not aligned, on some architectures and older computers, working with it might be slower.
11
But how is the structure represented in memory by the compiler?
12
The structure is represented as a series of consecutive values, each starting at a specific padding from the beginning of of the structure.
13
The padding is needed so that each value is correctly aligned.
14
As you can see here, the value D would occupy only one byte, but three extra bytes are added so that the value C is correctly aligned.
15
If we add another character at the end of the structure, another 3 bytes of padding are added because the whole structure must be aligned to the alignment of the structure itself,
16
which is the maximum alignment between the members of the structure.
17
This way, when creating an array of this structure, the first member is always correctly aligned.
18
So to save memory, we can move our characters close together
19
so that only 2 bytes of padding are added making the whole thing 16 bytes instead of 20, while keeping everything correctly aligned.
20
We can check that in C as well.
21
As you can see, this code represents what was shown in the previous images.
22
Now take a look at the output of this.
23
If we move E, like this, the output changes.
24
Now if you want to ignore alignment and remove padding for some reason, you can use the packed attribute like this on GCC and CLang and the compiler will not insert any padding,
25
as you can see here from this output, but note that on some architectures this might make the code slower.
26
So in conclusion, if you don't wanna waste memory over padding, remember to place your structural members correctly.
27
Bye!

맥락 및 배경

이 비디오는 C 프로그래밍 언어에서 메모리 관리와 정렬에 대한 내용을 다루고 있습니다. 발표자는 구조체의 크기와 그 구성 요소가 메모리에 어떻게 배열되는지를 설명하며, 메모리 낭비를 줄이기 위한 방법에 대해서도 언급합니다. 이러한 기술적 내용은 프로그래머와 컴퓨터 과학에 관심이 있는 학습자에게 유용할 뿐만 아니라, 영어로 이러한 복잡한 주제를 이해하고 표현하는 데 있어 중요한 학습 자료가 됩니다.

일상 소통을 위한 5가지 핵심 문구

  • 메모리를 낭비하고 있습니다. (You are wasting memory.)
  • 구조체의 크기를 확인해 보세요. (Take a look at the size of the structure.)
  • 정렬을 유지해야 합니다. (You must maintain alignment.)
  • 여기서 패딩을 추가합니다. (Here, we add padding.)
  • 코드를 실행해 주세요. (Please run the code.)

단계별 섀도잉 가이드

이 비디오는 기술적인 내용이 많아 처음에는 다소 어려울 수 있지만, 섀도 스피크 (shadow speak) 기법을 활용하면 영어 회화 연습에 큰 도움이 될 수 있습니다. 다음 단계에 따라 이 비디오의 내용을 효과적으로 학습해 보세요.

  1. 첫 번째로, 비디오를 시청하면서 발음을 인식해 보세요. 특히 메모리와 관련된 용어들이 중요합니다.
  2. 두 번째, 각 문장을 반복해 보세요. 영어 발음 교정을 위해 천천히 따라 해보는 것이 좋습니다. 처음에는 느리게, 이후에는 자연스럽게 말할 수 있도록 연습하세요.
  3. 세 번째, 문장 구조와 어휘에 집중하세요. IELTS 스피킹에서 유용한 표현들이 포함되어 있으니, 이러한 구절을 기억하세요.
  4. 네 번째, 발표자가 설명한 개념을 적용해 보세요. 코드의 실행 결과를 직접 확인하며, 메모리 정렬의 중요성을 이해하세요.
  5. 마지막으로, 이 내용을 일상적인 대화에서도 사용할 수 있도록 기타 주제와 연결해 보세요. 실제 상황에서 영어를 사용할 수 있는 기회를 만들어 보세요.

이러한 연습을 통해 영어 회화 연습의 능력을 키우고, 다양한 주제를 자신 있게 이야기할 수 있을 것입니다. shadowspeaks 기법을 초월하여 영어 실력을 한층 끌어올려 보세요!

쉐도잉이란? 영어 실력을 빠르게 키우는 과학적 방법

쉐도잉(Shadowing)은 원래 전문 통역사 훈련을 위해 개발된 언어 학습 기법으로, 다언어 학자인 Dr. Alexander Arguelles에 의해 대중화된 방법입니다. 핵심 원리는 간단하지만 매우 강력합니다: 원어민의 영어를 들으면서 1~2초의 짧은 지연으로 즉시 소리 내어 따라 말하는 것——마치 '그림자(shadow)'처럼 화자를 따라가는 것입니다. 문법 공부나 수동적인 청취와 달리, 쉐도잉은 뇌와 입 근육이 동시에 실시간으로 영어를 처리하고 재현하도록 훈련합니다. 연구에 따르면 이 방법은 발음 정확도, 억양, 리듬, 연음, 청취력, 말하기 유창성을 크게 향상시킵니다. IELTS 스피킹 준비와 자연스러운 영어 소통을 원하는 분들에게 특히 효과적입니다.