This will save the old stack pointer and allocate stack memory atomically.
这会保存原来的堆栈指针,并自动分配堆栈内存。
Also, the constant reuse of stack regions tends to keep active stack memory in the CPU caches, speeding up access.
另外,栈的反复使用能够使栈驻留在cpu缓存(cpu caches)中,从而加快数据存取。
In Greg's tests, using Continuations cuts thread consumption, and concomitantly stack memory consumption, by a factor of more than 10.
在Greg的测试中,使用Continuations能够减少线程消耗,并同时减少了超过10倍的栈内存消耗。
It turns out that slightly before the stack, slightly before this conceptual chunk of memory, there's other things called environment variables that we may see over time but elsewhere in memory are other things.
结果是稍微在堆之前,稍微在这个内存块概念之前,另外还一个东西叫做环境变量,我们之后可能看到,内存中的其他地方,是其他的东西。
Well, if you want to call a function, it's like putting another tray on that stack of trays and that tray represents a chunk of memory that, that function can use.
嗯,如果你想调用一个函数,这就像把一个托盘放到另一个托盘上,托盘代表一块,函数可以使用的内存。
But as soon as the most recently called function finishes executing, you have to take that tray off the stack in order to get at the previous function's memory, and once he's done executing, you have to take that one off and then what's left well then main.
但是,一旦新的调用函数结束了执行,你必须从堆中把托盘拿掉,用来获得先前函数的内存,一旦他完成执行,你必须把那一块拿下来,然后剩下的是main函数。
应用推荐