- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a new thread related to aligned memory management C++ operators 'new' / 'delete' and 'new[]' / 'delete[]'.
Please take a look at a similar thread:
Forum topic: 'Aligning with new: for a beginner'
Web-link: http://software.intel.com/en-us/forums/topic/328019
Thanks to a User 'llevrel' for that subject!
Best regards,
Sergey
PS: This is the first post and many more will follow...
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sergey Kostrov wrote:The size of the structure need not be a power of 2. The size of the structure needs to be a multiple of the power of 2 that you require for alignment (e.g. 8-bytes for doubles, 16 -bytes for SSE, or 32-bytes for AVX2, ...) I tested with Intel C++, I did not test with MSVC **** Potential gotcha *** In the new[] operator, the Intel compiler generates a size_t header element containing the count of the elements in the array. Thus the necessitating of creating of the prefix padd in the allocation, and the bung-up (fix-up) of the returned pointer (converse in the delete[] operator). *** this value may change from compiler vendor to compiler vendor *** Therfore it is a requirement that you run a verification program, such as the provided test program, then make adjustments (conditional compilations) as required. You will note that you will need to do this in any event because the VTable information may vary from vendor to vendor. You might consider keeping a verification test in the beginning of the program in the event that a library function (.DLL, .so) returns the new[]. The information (diagnostic) may be more helpful than a GP fault in determining the problem. Jim DempseyThis is a limitation of '_aligned_offset_malloc_dbg' CRT-function and it always uses IS_2_POW_N( align ) macro. If somebody wants to create an object on any alignment boundary value then a new function could be created based on '_aligned_offset_malloc_dbg' CRT-function but without _VALIDATE_RETURN and IS_2_POW_N macros.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sergey Kostrov wrote:It should be easy enough to overload the missing funcitons. Jim DempseyJust discovered that
.
_aligned_malloc
_aligned_malloc_dbg
_aligned_free
_aligned_free_dbg
.
CRT-functions are NOT supported on Windows Mobile platforms.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page