What is the replacement in C++ for _aligned_malloc in C?



 DEVELOP > c-Plus-Plus > What is the replacement in C++ for _aligned_malloc in C?

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "Amal P"
Date: 30 Mar 2006 06:06:23 AM
Object: What is the replacement in C++ for _aligned_malloc in C?
Hi,
I want to allocate some memory 16Byte aligned. For this now I am
using _aligned_malloc function that is given in malloc.h. What is the
substitute for this in new ? Is there any way to allocate aligned
memory using new ?
Thanks and Regards,
Amal P.
.

User: "Neo"

Title: Re: What is the replacement in C++ for _aligned_malloc in C? 30 Mar 2006 11:40:56 AM
You can take a look at this usage of new called
"placement new"...
new (placement_addr) type;
where placement_addr is compulsorily a pointer!
But yes, you need to say delete placement_addr & not the type pointer
used in "new".
--with regards
Neo
.

User: "Jakob Bieling"

Title: Re: What is the replacement in C++ for _aligned_malloc in C? 30 Mar 2006 06:18:50 AM
Amal P <enjoyamalp@gmail.com> wrote:

I want to allocate some memory 16Byte aligned. For this now I am
using _aligned_malloc function that is given in malloc.h. What is the
substitute for this in new ? Is there any way to allocate aligned
memory using new ?

_aligned_malloc is not a Standard function, but rather an extension
provided by your implementation. You should probably continue using that
extension function.
regards
--
jb
(reply address in rot13, unscramble first)
.


  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER