[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Alignment
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Mon, 23 Feb 2009 14:03:20 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=4i/YkZrWOPINz08B26wftl70r+QutakxMiv1h7zqcQ4=; b=UhWdrb9N0Tmzw98rjziDyKdeqH1S7ZoSdq4Hw5FrXAZx5olG9FqFCfXVXMJz6kikfB 0fqWtK9KcZwldB3W+wyTQs+Hr+BBoCJxdy0z9NLolf3ji+4oRXjcCarMiCv8aKPO1LH7 dTm0akk7D2wHTH5WuqeISSjoRk9fUSZddQixo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=d6AvToDXmm59gF96sQ05qJRwOg1Pts5IjBVu8fypJq30SyThQPK0olarTtDZOhrZdn HpINo3I/1cuz5CG6LamfKC/BTSbKeWhwt5BDMTqtfgRpKG1ZYJwx1wmP6DDkGpjmIggJ v1wTy6vbw0SRdnotr2mj28NfYMoZ41gVLmix0=
2009/2/23 Rene Wagner <rw@xxxxxxxxxxxx>:
> Thanks for confirming. It might be worth adding that to the
> documentation to avoid further stupid questions on the subject ;)
Not stupid at all, but yes it's always useful to update the online docs.
> I agree it's not great, but since I don't call resize() it's good enough
> for me right now.
You'll also have to make sure that resize() doesn't get called
internally, and that depends on the implementation of the rest of
std::vector, so it's really incomfortable. E.g. even if you never
resize, one could imagine that in some impls, some constructor calls
resize() as a helper.
> boost::array uses a plain "on-the-stack" array internally. So, as far as
> storage is concerned
>
> boost::array<T,size> a;
>
> is equivalent to
>
> T a[size];
Ah, OK. Then i'm confident that you won't have any problems. No
"operator new" gets called here, it's all done at compile time, and
then what happens is that inside Eigen, we declare the arrays that
need it with 128-bit alignment (for example on GCC this gives
__attribute__((align(16))) ). This should propagate as needed, as the
compiler has all the information that's needed.
Cheers,
Benoit