• There are absolutely going to be times where you're running a program where the programmer, say you, didn't possibly know in advanced how much RAM the program was going to need.

    它们总是在,程序员运行程序的地方,你可能预先不知道那个程序,需要多少内存。

    哈佛公开课 - 计算机科学课程节选

  • I've been using the blackboard a little ad hoc here, but suppose I neaten things up here now and present this rectangle is let's say R RAM, the memory inside of your computer.

    我在这里特别地使用这块黑板,假如我整理这些东西,把它们呈现,这个长方形,假如说就是内存,你电脑的内存。

    哈佛公开课 - 计算机科学课程节选

  • All right so it has to live in RAM as opposed to the hard drive because otherwise things would be terribly slow as you know so it's much better if your programs live while they're running in RAM and they end up in what's called the tech segment.

    好的,它存在内存中,而不是硬盘中,因为,否则程序会非常的缓慢,程序在内存中运行会好得多,它们在技术段,的地方结束。

    哈佛公开课 - 计算机科学课程节选

  • When you're working on a file, it's saving constantly to RAM but also hopefully to disc, the hard disk so you don't actually lose it if the power goes off.

    当你打开一个文件,它不断地保存在内存中,但对于光盘,硬盘,当你断开电源的时候,数据不会丢失。

    哈佛公开课 - 计算机科学课程节选

  • Here I actually need to tell the computer, "Give me some bytes in ram in which to store a value, and that value's going to be a floating point value."

    这里我的确需要告诉计算机,“给我一些字节内存,来存储一个值,那个值将是,浮点型的数值“

    哈佛公开课 - 计算机科学课程节选

  • It's just a little block of memory in RAM, you know, that represents four bytes, 32-bits and the Number Two is currently in it.

    它只是一小块内存块,它表示4个字节,32位,那个数字2就存储在里面。

    哈佛公开课 - 计算机科学课程节选

  • Conceptually, it's put at the top of my chunk of RAM, -- below it, goes initialized and uninitialized data -- - this is a fancy way of saying global variables come next -- and below that, comes what's called the heap.

    概念上,它放置在内存块的顶端,在下面,已初始化的和未初始化的数据-,这是一种指明紧随其后的全局变量的设想方式-,在后来,引入了一个叫做堆的东西。

    哈佛公开课 - 计算机科学课程节选

  • So the heap is a chunk of memory in a computer's RAM that's conceptually allocated to what's called dynamic memory allocation.

    堆是在计算机RAM中的一块内存,它可以进行,动态内存分配。

    哈佛公开课 - 计算机科学课程节选

  • This is somewhat of a artist's rendition, but they're at the very bottom of my RAM.

    这个是有点表演艺术的,但是它们在我内存的底端。

    哈佛公开课 - 计算机科学课程节选

  • It ends up at the top most portion of the computer's RAM.

    在内存中的顶部结束。

    哈佛公开课 - 计算机科学课程节选

  • Only the operating system has controlling of byte zero NULL in the computer's RAM and so if a function ever returns null, aka zero, well, something must have gone wrong because that can't possibly belong to me that memory because by human convention zero is owned by the operating system; not by a program I wrote.

    只用操作系统在内存中能够控制,字节0,并且如果一个函数返回,或者说0,好的,可能出错了,因为那可能是不属于我的内存,因为惯例上,0是由操作系统拥有的,而不是由我的程序拥有的。

    哈佛公开课 - 计算机科学课程节选

  • So, conceptually if you've ever wondered why you get access in all of your functions to global variables that's because they're not down here, they're at the very top of RAM and any function can access that RAM way up there, but for now the interesting player in the story is this thing called the heap.

    所以,如果你想知道为什么全局变量能在,所有的函数中使用,那是因为它们不在这下面,而是在内存的顶端,那样任意函数都可以在内存中使用它们,现在,这里面一个有用的角色是,叫做堆的东西。

    哈佛公开课 - 计算机科学课程节选

  • So, for the most part any time we talk about or draw pointers an arrow suffices, which really 71 in there is a number like 71, which is the literal byte that the F is actually in in RAM, but frankly who cares?

    所以,每次我们讨论,或者用箭头表示指针,在指针里面有一个数字,如,那是F在RAM中的字节,但是谁在乎它呢?

    哈佛公开课 - 计算机科学课程节选

  • To do that the data travels from RAM along with software signals that tell the hard drive how to store that data.

    为了能让数据从RAM中,到硬盘是要使用软件信号告诉硬盘,如何存储这些数据。

    哈佛公开课 - 计算机科学课程节选

  • So you can think of it as left or right, top to bottom, or whatever, the point is they come next in RAM.

    你可以想象它们为left或者right,从上到下,要点是它们在内存中紧随其后。

    哈佛公开课 - 计算机科学课程节选

  • This was the special value that said to the computer string stops here and because you have that barrier given to you at the end of every string, just the most efficient way you can pass strings around is just by passing the address of their very first bytes, the location in RAM.

    这是一个特殊的值,表示的是,字符串在这里结束,因为在每个字符串的末尾,都有那个关卡,这是一个最有效率的方式,你可以通过传递,字符串的第一个字节的地址来传递一个字符串,地址是在RAM中的。

    哈佛公开课 - 计算机科学课程节选

  • So, certainly the CS50 Library designed to be dynamic and, in fact, any time you call get string, we are, in fact, ; allocating a chunk of RAM but it's not coming from the stack; it's actually coming from this portion of memory called the heap.

    所以,Cs50库是动态设计的,实际上,每次你调用GetSting时,我们分配一块内存,但它不是来自栈;,而是来自于叫做堆的,内存的一部分。

    哈佛公开课 - 计算机科学课程节选

  • X That's just the special symbol in C that says don't pass X, that is don't pass a copy of X. Rather figure out where x is in memory, where he is in that frame and provide swap the numeric address in RAM of that value so that swap can go do anything it wants at that address.

    这在C中是一个特殊的符号,指明不传送,也不是传递X的拷贝,而是指出x在内存中哪个地方,它在那个框架中的哪个地方,提供给swap它的地址值,这样swap就可以使用那个地址中的数据。

    哈佛公开课 - 计算机科学课程节选

  • Now that's changing the more years that pass the more of you have 64-bit computers and the more servers have many, many gigabytes of RAM and so you need actually 64-bits, but for now let's assume a common system whereby a pointer just by definition of the homework is 32 bits.

    现在计算机也在改变,也有更多的人,使用64位的计算机,更多的服务器有很多,很多G的内存,那样你就需要64位的,现在我们假设通常的系统中,根据家庭作业所定义的,一个指针为32位。

    哈佛公开课 - 计算机科学课程节选

  • Instead I'm going to be expecting the address of some int and the address of another int and thanks to this address I can literally find this address in RAM, do anything I want there, -- return and what I've just done is actually changed or mutate the values of those original variables.

    我们所期望的是int型地址,和另外一个int型地址,幸亏这个地址,我可以找在RAM中找到它的地址,然后做我想做的事情,返回我处理后的东西,我可能改变了这些源变量。

    哈佛公开课 - 计算机科学课程节选

  • And, again, the rectangle represents your computer's RAM, the bottom represents the part of RAM that we generally call the stack, main conceptually ends up on the bottom of the stack followed foo by its local variables then the function say foo that it calls and on and on and on and up, but there is, in fact, something above all of this and we've seen this picture briefly and that's this thing called the heap.

    再次,矩形表示的是计算机内存,底端表示内存的一部分,通常我们把它叫做堆栈,main函数在,堆栈的底端,之后是,它的局部变量,然后是它调用的函数,等等等等,但是那里有,实际上,在这个上面,我们粗略看看这个图画,这个东西叫做堆。

    哈佛公开课 - 计算机科学课程节选

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定