In the same way that garbage collectors improve upon malloc and free, we found that goroutines and channels improve upon the lock-based approach to concurrency.
因此,从malloc()/free()的早期实现中分配是从堆中分配的。
For that reason, allocating from early implementations of malloc()/free() was allocation from a heap.
The reason is simple: memory allocators, such as malloc, and garbage collectors often have unpredictable behavior that can significantly impact performance.
在C中,堆是经由malloc()和其它相关函数来访问的。
In C, the heap is accessed via malloc() and other related functions.
附带地,new操作符还提供了胜过malloc()的新特性:.
Incidentally, the new operator offers additional advantages over malloc().
在C语言中,这种不安全的转换最常见的应用之一,是将malloc()的结果赋予一个合适的指针。
One of the most common uses of this unsafe conversion in C is to assign the result of malloc() to a suitable pointer.
像C这样的语言有低级的内存管理原语,如malloc()和free()。
Low-level languages, like C, have low-level memory management primitives like malloc() and free().
像C这样的编程语言,具有低级内存管理原语,如malloc()和free()。
Low-level languages, like C, have low-level memory management primitives like malloc() and free().
更新二:感谢GitHub用户ghswa贡献了我忘记的一些malloc()的空指针检查。
Edit 2: Thanks to user ghswa on GitHub for contributing some null checks for malloc() that I forgot.
而“分配”则意味着手工的内存管理,你必须且不得不重新实现malloc()函数。
And“allocation” means manual memory management, you essentially have to reimplement the malloc() function.
中文
Bahasa indonesia
日本語
عربى
Български
বাংলা
Český
Dansk
Deutsch
Ελληνικά
Español
Suomi
Français
עִברִית
हिंदी
Hrvatski
Magyar
Italiano
Қазақ
한국어
മലയാളം
मराठी
Bahasa malay
Nederlands
Norsk
Polski
Português
Română
Русский
Slovenský
Slovenski
Српски
Svenska
தமிழ்
తెలుగు
ไทย
Tagalog
Turkce
Українська
اردو
Tiếng việt