I've noticed std::aligned_alloc() coming into C++17, and I like it. But - what happens when I need to reallocate? I can do this manually (assuming the available space at the currently-allocated address is just the amount of space I asked for), but shouldn't there be a facility for this in the standard library?
What's the reallocation equivalent of std::aligned_alloc()?
670 views Asked by einpoklum At
1
There are 1 answers
Related Questions in C++
- How to immediately apply DISPLAYCONFIG_SCALING display scaling mode with SetDisplayConfig and DISPLAYCONFIG_PATH_TARGET_INFO
- Why can't I use templates members in its specialization?
- How to fix "Access violation executing location" when using GLFW and GLAD
- Dynamic array of structures in C++/ cannot fill a dynamic array of doubles in structure from dynamic array of structures
- How do I apply the interface concept with the base-class in design?
- File refuses to compile std::erase() even if using -std=g++23
- How can I do a successful map when the number of elements to be mapped is not consistent in Thrust C++
- Can std::bit_cast be applied to an empty object?
- Unexpected inter-thread happens-before relationships from relaxed memory ordering
- How i can move element of dynamic vector in argument of function push_back for dynamic vector
- Brick Breaker Ball Bounce
- Thread-safe lock-free min where both operands can change c++
- Watchdog Timer Reset on ESP32 using Webservers
- How to solve compiler error: no matching function for call to 'dmhFS::dmhFS()' in my case?
- Conda CMAKE CXX Compiler error while compiling Pytorch
Related Questions in C++17
- How to convert mathematical expression to lambda function in C++?
- How can I include a file using Eigen's plugin include?
- What was the problem with std::is_callable?
- Using lambda function in constexpr constructor with std::tie
- How to build new types by expand a parameter pack together with another list of types?
- Solved: Create standalone executable for MacOS with OpenCV and libmagic
- C++ File Input Skipping Lines
- C++: initialization of auto&& with the ternary operator leads to the copy constructor call on MSVC
- Correctly copying temporary string from a string_view (C++ 17)
- This is not a question, but an interesting thing I discovered yesterday in visual studio c++ 17 compiler
- How can std::unique_ptr apply EBO on closure?
- Is the ordering of std::recursive_directory_iterator specified?
- Initialize a logger once
- Listing all files in the directories and subdirectories recursively in c++
- Why does the C++17 standard not allow converting a string to a bool?
Related Questions in MEMORY-ALIGNMENT
- How does OpenGL std430 layout align elements in an array?
- Intel classic compiler reports non-unit strided load in simple assignment
- GCC generates unaligned access for ARMv8
- How is Result<T, E> in Rust so fast?
- Win32 Wide-Character String Alignment Requirements
- Arrange layout of a struct to automatically conform to GLSL std140
- Speed Test for Buffer Alignment: IBM's PowerPC results vs. my CPU
- Can I move between contiguous sequences of fields of the same type in a struct using pointer arithmetic without alignof?
- Are 64-byte CPU cache line reads aligned on 64-byte boundaries?
- Understanding reinterpret_cast error with some templated method
- How calculate, aligned, offset, and count, for, linux's, direct, storage io, through `O_DIRECT`
- Does `__attribute((packed))` affect the alignment of other data structures?
- Why misaligned access to locked memory read intermediate value on intel cpu?
- What stride should I use for matrices in CUDA for the fastest possible speed?
- Alignment of array type data member of a heap allocated object
Related Questions in DYNAMIC-ALLOCATION
- STM32 HAL_UART_Transmit dynamic string
- How to dynamically append new object at run time in C++ array of object and print them
- How to keep objects created inside other objects alive without using new?
- Why Does Pushing Back Local Variable to Vector Works
- What's the reallocation equivalent of std::aligned_alloc()?
- Is ending a program without releasing all dynamically allocated resources risky?
- Dynamic allocation in function C++
- std::bad_alloc thrown on prime number task
- Malloc Undefined Behavior - Losing data
- Allocation of variables inside dynamically allocated structs
- Detect anonymous allocations in GNAT predefined libraries
- Using realloc by multiplying a pointer integer and sizeof(int) not working
- Could I do this code without posix_memalign?
- ordered list in C returning just one node (head overwritten)
- Why is this C code not working?
Related Questions in MEMORY-REALLOCATION
- Explanation of "realloc doesn't require that ptr point to a memory but in practice does."
- Memory pool: force allocating resources (map / vector) to reallocate for continuity
- what's going wrong here with realloc()?
- Novice question about using realloc properly in practice
- Why is realloc giving me inconsistent behaviour?
- How to dynamically increase size of any structure objects during runtime?
- Vulkan/VMA Change buffer size similar to `realloc`
- What is the time complexity of the following piece of code
- Segmentation Fault accessing array positions after realloc
- Segmentation fault (core dumped) error in dynamic memory allocation
- Going ones through string to count length takes longer time, than moving string a couple of times?
- Reallocation of dynamic 2 dimensional array with double Pointers to structs and struct Pointer
- Reallocate array with memcpy and memset
- CUDA - dynamically reallocate more global memory in Kernel
- change address of object that keeps raw pointer to its field
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
There isn't such standard call equivalent.
Even more so, Microsoft's latest implementation of C++ still has its own
_aligned_malloc()instead of the now standardizedstd::aligned_alloc(), and here they explain why:Among their (Microsoft's) underscore-prefixed implementations they do serve you with
_aligned_realloc():-)