C dynamic memory allocation (original) (raw)
Dynamická alokace paměti v jazyce C je v informatice souhrn funkcí používaných při programování pro dynamickou alokaci paměti, její správu a uvolňování. Správa paměti v programovacím jazyku C je prováděna programátorem ručně, nikoliv automaticky. Cílem je požádat jádro operačního systému o přidělení souvislého úseku operační paměti pro potřeby běžícího procesu nebo ji naopak operačnímu systému vrátit. Proces může paměť alokovat nebo vracet opakovaně. Po ukončení procesu je veškerá alokovaná paměť vrácena operačnímu systému k dalšímu použití.
Property | Value |
---|---|
dbo:abstract | Dynamická alokace paměti v jazyce C je v informatice souhrn funkcí používaných při programování pro dynamickou alokaci paměti, její správu a uvolňování. Správa paměti v programovacím jazyku C je prováděna programátorem ručně, nikoliv automaticky. Cílem je požádat jádro operačního systému o přidělení souvislého úseku operační paměti pro potřeby běžícího procesu nebo ji naopak operačnímu systému vrátit. Proces může paměť alokovat nebo vracet opakovaně. Po ukončení procesu je veškerá alokovaná paměť vrácena operačnímu systému k dalšímu použití. (cs) C dynamic memory allocation refers to performing manual memory management for dynamic memory allocation in the C programming language via a group of functions in the C standard library, namely malloc, realloc, calloc, aligned_alloc and free. The C++ programming language includes these functions; however, the operators new and delete provide similar functionality and are recommended by that language's authors. Still, there are several situations in which using new/delete is not applicable, such as garbage collection code or performance-sensitive code, and a combination of malloc and placement new may be required instead of the higher-level new operator. Many different implementations of the actual memory allocation mechanism, used by malloc, are available. Their performance varies in both execution time and required memory. (en) La asignación dinámica de memoria en el Lenguaje de programación C, conocida también como malloc (abreviatura del inglés memory allocation), se realiza a través de un grupo de funciones en la biblioteca estándar de C , es decir, malloc , realloc , calloc y free . En C++, se incluyen estas funciones por retrocompatibilidad, pero han sido sustituidas en gran parte por los operadores new y new[]. Están disponibles muchas implementaciones diferentes del mecanismo de asignación de memoria real, utilizado por malloc . Su rendimiento varía tanto en tiempo de ejecución y memoria requerida. (es) malloc est en informatique une fonction de la bibliothèque standard du langage C permettant d'allouer dynamiquement de la mémoire. La libération de la mémoire ainsi réservée s'effectue avec la fonction free. Cette fonction est déclarée dans l'en-tête <stdlib.h></stdlib.h>. Dans les systèmes GNU/Linux, elle fait partie du paquet GNU C Library. (fr) In informatica, malloc (derivato dai termini memory allocation) è una funzione della libreria standard dei linguaggi di programmazione C e C++ per l'allocazione dinamica della memoria. (it) malloc(マロック, エムアロック)、calloc、reallocは、動的メモリ確保を行うC言語の標準ライブラリの関数である。確保したメモリの解放にはfree関数を使用する。 mallocが使用する実際のメモリ確保機構には様々な実装がある。それらの性能は、実行時間と要求されるメモリの両面で様々である。 (ja) C 동적 메모리 할당은 동적 메모리 할당을 위한 를 수행하는 것을 말하며 C에 담긴 malloc, realloc, calloc 그리고 free 등의 함수를 말한다. 메모리 동적 할당을 위한 포인터 변수를 선언하여 동적 할당을 하는 순간 일반 변수를 저장하는 stack이 아닌 heap에 저장되기 때문에 free로 동적 할당을 해제하지 않는 이상 메모리가 반납되지 않으며, 따라서 함수가 끝나더라도 메모리의 값은 유지된다. 그래서 C언어 교재나 강의에서 문자열, 구조체 주소를 반납하는 함수를 다룰 때 malloc 사용을 반드시 하거나, static을 사용하라고 한다. C++ 언어에는 C 언어와 호환되는 위의 함수들을 포함되나 기능적으로 유사한 오퍼레이터가 제공되며 이쪽을 사용하는 것이 권장된다. malloc을 사용함으로써 여러 방식의 실제 메모리 할당 매커니즘을 실행할 수 있다. 퍼포먼스 방식에 따라 실행 시간이나 필요한 메모리 공간 또한 다양하다! (ko) Alocação dinâmica de memória em C se refere à execução de gerenciamento manual de memória para alocação dinâmica de memória na linguagem de programação C por meio de um grupo de funções na biblioteca padrão do C, que são malloc, realloc, calloc e freefree. A linguagem de programação C++ inclui essas funções; no entanto, os operadores fornecem funcionalidade semelhante e são recomendados pelos autores desse idioma. Ainda assim, existem várias situações em que o uso de new/delete não é aplicável, como código de coleta de lixo (garbage collection) ou código sensível ao desempenho, e uma combinação de malloc e placement new pode ser necessária em vez do operador new de alto nível. malloc é um termo da computação que designa uma função da biblioteca padrão das linguagens de programação C e C++ para requisitar alocação dinâmica de memória. É uma forma abreviada de escrever memory allocation (alocação de memória). (pt) C动态内存分配是在C语言中为了实现动态内存分配而进行的手动内存管理。这种管理是通过C標準函式庫中的malloc、realloc、calloc、free 等函数进行的。 C++ 为了兼容 C 语言也提供这些函数,但是更推荐使用 new、delete 操作符来完成类似的操作。 malloc 所实际使用的内存分配机制有很多不同的实现,执行时间和内存消耗各有不同。 (zh) |
dbo:wikiPageExternalLink | http://gee.cs.oswego.edu/dl/html/malloc.html http://jemalloc.net/ http://paste.tclers.tk/1596 http://www.hoard.org/ http://www.malloc.de/en/ http://www.nedprod.com/programs/portable/nedmalloc/ https://sploitfun.wordpress.com/2015/02/10/understanding-glibc-malloc/ http://www.ibm.com/developerworks/library/l-memory/ http://www.opengroup.org/onlinepubs/9699919799/functions/malloc.html https://github.com/gperftools/gperftools https://web.archive.org/web/20050823083743/http:/live.gnome.org/MemoryReduction https://web.archive.org/web/20060409094110/http:/www.osdcom.info/content/view/31/39/ http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf http://www.open-std.org/jtc1/sc22/wg14/www/standards http://www.research.ibm.com/people/m/michael/pldi-2004.pdf https://code.google.com/p/gperftools/ |
dbo:wikiPageID | 384289 (xsd:integer) |
dbo:wikiPageLength | 36169 (xsd:nonNegativeInteger) |
dbo:wikiPageRevisionID | 1124745062 (xsd:integer) |
dbo:wikiPageWikiLink | dbr:Poul-Henning_Kamp dbr:Memory_debugger dbr:Memory_protection dbr:Kernel_(computer_science) dbr:Unix dbr:Dope_vector dbr:Doug_Lea dbr:Dynamic_array dbr:Initialization_(programming) dbc:Memory_management dbr:Run_time_(program_lifecycle_phase) dbr:Null_pointer dbr:Open_source dbr:Coding_best_practices dbr:FreeBSD dbr:GNU_C_library dbr:Cruft dbr:Dangling_pointer dbc:Memory_management_software dbr:Call_stack dbr:Single_Unix_Specification dbr:Demand_paging dbr:Function_prototype dbr:Sbrk dbr:Page_(computer_memory) dbr:Pointer_(computer_programming) dbr:Public_domain dbr:Stack_overflow dbr:Static_memory_allocation dbr:C++ dbr:C99 dbr:C_(programming_language) dbr:Address_space dbr:Address_space_layout_randomization dbr:Trie dbr:Type_conversion dbr:UNIX/32V dbr:UNIX_System_V dbr:Data_segment dbr:Data_structure dbr:WhatsApp dbr:Data_structure_alignment dbr:Dynamic_memory_allocation dbr:POSIX dbr:Central_processing_unit dbr:Direct_memory_access dbr:Heap_memory dbr:Intrinsic_function dbr:Array_data_structure dbr:ANSI_C dbc:Articles_with_example_C_code dbc:C++ dbr:Bin_(computational_geometry) dbc:C_standard_library dbr:Manual_memory_management dbr:Buffer_overflow dbr:C11_(C_standard_revision) dbr:C_standard_library dbr:Microsoft_Research dbr:NetBSD dbr:OpenBSD dbr:System_call dbr:Mmap dbr:Undefined_behavior dbr:Variable-length_array dbr:Virtual_memory dbr:Segmentation_fault dbr:Uninitialized_variable dbr:Lines_of_code dbr:Thread-local_storage dbr:New_and_delete_(C++) dbr:Automatic_memory_allocation dbr:Variable-length_arrays dbr:Fragmentation_(computer) dbr:Wild_pointer dbr:Void_pointer dbr:Compile-time dbr:Stack_smashing dbr:Memory_allocator |
dbp:cs1Dates | y (en) |
dbp:date | May 2021 (en) |
dbp:wikiPageUsesTemplate | dbt:Memory_management_navbox dbt:Anchor dbt:Better_source_needed dbt:Code dbt:Main dbt:Mono dbt:Reflist dbt:Rp dbt:See_also dbt:Short_description dbt:Snd dbt:Use_dmy_dates dbt:Wikibooks dbt:Wikiversity dbt:Citation_needed_span dbt:Cpp dbt:CProLang dbt:C_Standard_Library |
dct:subject | dbc:Memory_management dbc:Memory_management_software dbc:Articles_with_example_C_code dbc:C++ dbc:C_standard_library |
rdf:type | owl:Thing |
rdfs:comment | Dynamická alokace paměti v jazyce C je v informatice souhrn funkcí používaných při programování pro dynamickou alokaci paměti, její správu a uvolňování. Správa paměti v programovacím jazyku C je prováděna programátorem ručně, nikoliv automaticky. Cílem je požádat jádro operačního systému o přidělení souvislého úseku operační paměti pro potřeby běžícího procesu nebo ji naopak operačnímu systému vrátit. Proces může paměť alokovat nebo vracet opakovaně. Po ukončení procesu je veškerá alokovaná paměť vrácena operačnímu systému k dalšímu použití. (cs) La asignación dinámica de memoria en el Lenguaje de programación C, conocida también como malloc (abreviatura del inglés memory allocation), se realiza a través de un grupo de funciones en la biblioteca estándar de C , es decir, malloc , realloc , calloc y free . En C++, se incluyen estas funciones por retrocompatibilidad, pero han sido sustituidas en gran parte por los operadores new y new[]. Están disponibles muchas implementaciones diferentes del mecanismo de asignación de memoria real, utilizado por malloc . Su rendimiento varía tanto en tiempo de ejecución y memoria requerida. (es) malloc est en informatique une fonction de la bibliothèque standard du langage C permettant d'allouer dynamiquement de la mémoire. La libération de la mémoire ainsi réservée s'effectue avec la fonction free. Cette fonction est déclarée dans l'en-tête <stdlib.h></stdlib.h>. Dans les systèmes GNU/Linux, elle fait partie du paquet GNU C Library. (fr) In informatica, malloc (derivato dai termini memory allocation) è una funzione della libreria standard dei linguaggi di programmazione C e C++ per l'allocazione dinamica della memoria. (it) malloc(マロック, エムアロック)、calloc、reallocは、動的メモリ確保を行うC言語の標準ライブラリの関数である。確保したメモリの解放にはfree関数を使用する。 mallocが使用する実際のメモリ確保機構には様々な実装がある。それらの性能は、実行時間と要求されるメモリの両面で様々である。 (ja) C 동적 메모리 할당은 동적 메모리 할당을 위한 를 수행하는 것을 말하며 C에 담긴 malloc, realloc, calloc 그리고 free 등의 함수를 말한다. 메모리 동적 할당을 위한 포인터 변수를 선언하여 동적 할당을 하는 순간 일반 변수를 저장하는 stack이 아닌 heap에 저장되기 때문에 free로 동적 할당을 해제하지 않는 이상 메모리가 반납되지 않으며, 따라서 함수가 끝나더라도 메모리의 값은 유지된다. 그래서 C언어 교재나 강의에서 문자열, 구조체 주소를 반납하는 함수를 다룰 때 malloc 사용을 반드시 하거나, static을 사용하라고 한다. C++ 언어에는 C 언어와 호환되는 위의 함수들을 포함되나 기능적으로 유사한 오퍼레이터가 제공되며 이쪽을 사용하는 것이 권장된다. malloc을 사용함으로써 여러 방식의 실제 메모리 할당 매커니즘을 실행할 수 있다. 퍼포먼스 방식에 따라 실행 시간이나 필요한 메모리 공간 또한 다양하다! (ko) C动态内存分配是在C语言中为了实现动态内存分配而进行的手动内存管理。这种管理是通过C標準函式庫中的malloc、realloc、calloc、free 等函数进行的。 C++ 为了兼容 C 语言也提供这些函数,但是更推荐使用 new、delete 操作符来完成类似的操作。 malloc 所实际使用的内存分配机制有很多不同的实现,执行时间和内存消耗各有不同。 (zh) C dynamic memory allocation refers to performing manual memory management for dynamic memory allocation in the C programming language via a group of functions in the C standard library, namely malloc, realloc, calloc, aligned_alloc and free. Many different implementations of the actual memory allocation mechanism, used by malloc, are available. Their performance varies in both execution time and required memory. (en) Alocação dinâmica de memória em C se refere à execução de gerenciamento manual de memória para alocação dinâmica de memória na linguagem de programação C por meio de um grupo de funções na biblioteca padrão do C, que são malloc, realloc, calloc e freefree. (pt) |
rdfs:label | Dynamická alokace paměti v jazyce C (cs) C dynamic memory allocation (en) Malloc (es) Malloc (it) Malloc (fr) Malloc (ja) C 동적 메모리 할당 (ko) Alocação dinâmica de memória em C (pt) C动态内存分配 (zh) |
rdfs:seeAlso | dbr:Sbrk |
owl:sameAs | freebase:C dynamic memory allocation wikidata:C dynamic memory allocation dbpedia-cs:C dynamic memory allocation dbpedia-es:C dynamic memory allocation dbpedia-fa:C dynamic memory allocation dbpedia-fr:C dynamic memory allocation dbpedia-it:C dynamic memory allocation dbpedia-ja:C dynamic memory allocation dbpedia-ko:C dynamic memory allocation dbpedia-no:C dynamic memory allocation dbpedia-pt:C dynamic memory allocation dbpedia-simple:C dynamic memory allocation dbpedia-sr:C dynamic memory allocation dbpedia-tr:C dynamic memory allocation dbpedia-zh:C dynamic memory allocation https://global.dbpedia.org/id/8YQE |
prov:wasDerivedFrom | wikipedia-en:C_dynamic_memory_allocation?oldid=1124745062&ns=0 |
foaf:isPrimaryTopicOf | wikipedia-en:C_dynamic_memory_allocation |
is dbo:wikiPageRedirects of | dbr:Jemalloc dbr:Free() dbr:Free_(programming) dbr:Ptmalloc dbr:Dlmalloc dbr:Malloc dbr:Valloc dbr:Std::aligned_alloc dbr:Std::calloc dbr:Std::free dbr:Std::malloc dbr:Std::realloc dbr:Farmalloc dbr:Double_free dbr:Calloc dbr:Realloc dbr:Aligned_alloc dbr:Alloc.h dbr:C_memory_management |
is dbo:wikiPageWikiLink of | dbr:Jemalloc dbr:Bionic_(software) dbr:Hoard_memory_allocator dbr:Libumem dbr:LibreSSL dbr:Computer_program dbr:Stack_overflow dbr:Superblock dbr:Address_space_layout_randomization dbr:Heap_overflow dbr:Firefox_3.0 dbr:Free() dbr:Free_(programming) dbr:Manual_memory_management dbr:C_standard_library dbr:Ptmalloc dbr:Mimalloc dbr:OpenBSD dbr:Programming_idiom dbr:Memory_management_unit dbr:Mmap dbr:Segmentation_fault dbr:Dlmalloc dbr:Imperative_programming dbr:Flexible_array_member dbr:New_and_delete_(C++) dbr:Malloc dbr:Valloc dbr:Std::aligned_alloc dbr:Std::calloc dbr:Std::free dbr:Std::malloc dbr:Std::realloc dbr:Farmalloc dbr:Double_free dbr:Calloc dbr:Realloc dbr:Aligned_alloc dbr:Alloc.h dbr:C_memory_management |
is foaf:primaryTopic of | wikipedia-en:C_dynamic_memory_allocation |