Namensräume
Varianten
Aktionen

std::realloc

Aus cppreference.com
< cpp‎ | memory‎ | c

 
 
 
Dynamische Speicherverwaltung
Low-Level-Speicherverwaltung
Zuweiser
Original:
Allocators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
allocator
allocator_traits(C++11)
allocator_arg_t(C++11)
allocator_arg(C++11)
uses_allocator(C++11)
scoped_allocator_adaptor(C++11)
Initialisierter Speicher
Original:
Uninitialized storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
uninitialized_copy
uninitialized_copy_n(C++11)
uninitialized_fill
uninitialized_fill_n
raw_storage_iterator
get_temporary_buffer
return_temporary_buffer
Intelligente Zeiger
Original:
Smart pointers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unique_ptr(C++11)
shared_ptr(C++11)
weak_ptr(C++11)
auto_ptr(veraltet)
owner_less(C++11)
enable_shared_from_this(C++11)
bad_weak_ptr(C++11)
default_delete(C++11)
Garbage Collection Unterstützung
Original:
Garbage collection support
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
declare_reachable(C++11)
undeclare_reachable(C++11)
declare_no_pointers(C++11)
undeclare_no_pointers(C++11)
pointer_safety(C++11)
get_pointer_safety(C++11)
Verschiedenes
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pointer_traits(C++11)
addressof(C++11)
align(C++11)
C-Bibliothek
Original:
C Library
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
realloc
free
 
definiert in Header <cstdlib>
void *realloc( void *ptr, std::size_t new_size );
Verteilt den gegebenen Bereich des Speichers. Es muss zuvor durch malloc() zugeordnet werden, oder calloc() realloc() und noch nicht mit free() befreit, andernfalls sind die Ergebnisse undefiniert .
Original:
Reallocates the given area of memory. It must be previously allocated by malloc(), calloc() or realloc() and not yet freed with free(), otherwise, the results are undefined.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Die Umverteilung wird entweder durch getan:
Original:
The reallocation is done by either:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
a)
Erweiterung der bestehenden Fläche, auf die ptr, wenn möglich. Die Inhalte des Bereichs bleiben unverändert bis zu der kleineren der neuen und alten Größen. Wenn der Bereich erweitert wird, sind die Inhalte des neuen Teils des Arrays spezifiziert .
Original:
expanding the existing area pointed to by ptr, if possible. The contents of the area remain unchanged up to the lesser of the new and old sizes. If the area is expanded, the contents of the new part of the array are undefined.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
b)
Vergabe einer neuen Speicherblock der Größe new_size bytes, Kopieren Speicherbereich mit Größe gleich der geringere der neuen und alten Größen und befreien den alten Block .
Original:
allocating a new memory block of size new_size bytes, copying memory area with size equal the lesser of the new and the old sizes, and freeing the old block.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Wenn es nicht genügend Speicher, wird die alte Speicherblock nicht freigegeben und Null-Pointer zurückgegeben .
Original:
If there is not enough memory, the old memory block is not freed and null-pointer is returned.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Inhaltsverzeichnis

[Bearbeiten] Parameter

ptr -
Zeiger auf den Speicherbereich neu zugeteilt werden
Original:
pointer to the memory area to be reallocated
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
new_size -
neue Größe des Arrays
Original:
new size of the array
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Rückgabewert

Zeiger auf den Beginn des neu zugewiesenen Speicher oder NULL, wenn Fehler aufgetreten ist. Der Zeiger muss mit free() freigegeben werden .
Original:
Pointer to the beginning of newly allocated memory or NULL if error has occurred. The pointer must be deallocated with free().
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Beispiel

[Bearbeiten] Siehe auch

C documentation for realloc