Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Question / Issue about Vector
Re: Question / Issue about Vector [message #12840 is a reply to message #12831] Tue, 20 November 2007 22:45 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
alexn wrote on Mon, 19 November 2007 23:47

Hi,

I'm trying to use the Vector class and within my application, the elements must be aligned on a 16 bytes boundary. (They are being accesses by SSE2 instructions.)

Looking at the code, the Vector template appears to call a global routine that calls "new" for a "byte" element. I would like to avoid rewriting or modifying the standard Vector class.

I am trying to figure out the best way to overwrite the memory allocation routines for the Vector class such that the "vector" was aligned.

In my old (stupid?) view, I would have thought that Vector should have used a "new" based on the type of object. Another approach might have been to add a template argument to Vector that would specify alignment (defaulting to Cool.

I'm quite new to Ultimate++ and and still trying to break my MFC orientation. Any push in the right direction would be appreciated.

Regards,
Alexn


I am afraid there are no guarantees about alignment in Vector and no intend to introduce any. IMO this is way too low-level issue to be reflected in Vector interface contract.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Juste simple question ~
Next Topic: Bug in Core06.cpp or in U++ Core value types tutorial
Goto Forum:
  


Current Time: Mon May 20 12:49:21 CEST 2024

Total time taken to generate the page: 0.00508 seconds