今日要点:
- 内存分配之堆和栈
- 限定性定语从句和非限定性定语从句
Heap(堆)
An area of memory that is used for dynamic memory allocation. Calls to malloc and free and the C++ operators new and delete result in run-time manipulation of the heap.
一块被用作动态内存分配的内存区域。调用malloc和free、C++的操作符new、delete在运行时进行堆的操作。
Stack(堆栈)
An area of memory that[1] contains a last-in-first-out queue of storage for[2] parameters, automatic variables, return addresses, and other information that [3]must be maintained across function calls.(无谓语,是对An area of memory解释,[1][2][3]定语从句或介词短语做后置定语修饰先行词)
In multitasking situations, each task generally has its own stack.
一个包含后进先出队列的内存区域,用来存储参数、自动变量、返回地址和其他一些必须在函数调用中进行维护的信息。在多任务情况下,每一个任务一般都有自己的堆栈区。
注:在vs c++中,每个线程具有独立的内存栈,初始化时好像是分配2兆内存
今日语法小知识:
- 限定性定语从句特点:
- 翻译为...的
- 关系代词前没有逗号(,)
- 非限定性定语从句特点:
- 不翻译成...的
- 关系代词前一般有逗号(,)
- 对比:
-
He is a good boy who studies hard.(无逗号,限定性定语从句,who是关系代词)
-
He is a good boy,who studies hard.(有逗号,非限定性定语从句,who是关系代词)
中文翻译为:
-
他是个学习用功的好孩子(限定性定语从句,翻译为...的)
-
他是个好孩子,学习很用功
关于关系介词,数量还有一些的,以后会涉及到。
网友评论