the big memory changes. the most important changes are:

ei_aligned_malloc now really behaves like a malloc
 (untyped, doesn't call ctor)
ei_aligned_new is the typed variant calling ctor
EIGEN_MAKE_ALIGNED_OPERATOR_NEW now takes the class name as parameter
This commit is contained in:
Benoit Jacob
2009-01-08 15:20:21 +00:00
parent e2d2a7d222
commit 1d52bd4cad
21 changed files with 215 additions and 243 deletions

View File

@@ -21,9 +21,9 @@ int main(int argc, char* argv[])
{
int size = SIZE * 8;
int size2 = size * size;
Scalar* a = ei_aligned_malloc<Scalar>(size2);
Scalar* b = ei_aligned_malloc<Scalar>(size2+4)+1;
Scalar* c = ei_aligned_malloc<Scalar>(size2);
Scalar* a = ei_aligned_new<Scalar>(size2);
Scalar* b = ei_aligned_new<Scalar>(size2+4)+1;
Scalar* c = ei_aligned_new<Scalar>(size2);
for (int i=0; i<size; ++i)
{

View File

@@ -38,16 +38,16 @@ public :
typedef typename f77_interface_base<real>::gene_vector gene_vector;
static void free_matrix(gene_matrix & A, int N){
ei_aligned_free(A, 0);
ei_aligned_delete(A);
}
static void free_vector(gene_vector & B){
ei_aligned_free(B, 0);
ei_aligned_delete(B);
}
static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){
int N = A_stl.size();
A = ei_aligned_malloc<real>(N*N);
A = ei_aligned_new<real>(N*N);
for (int j=0;j<N;j++)
for (int i=0;i<N;i++)
A[i+N*j] = A_stl[j][i];
@@ -55,7 +55,7 @@ public :
static inline void vector_from_stl(gene_vector & B, stl_vector & B_stl){
int N = B_stl.size();
B = ei_aligned_malloc<real>(N);
B = ei_aligned_new<real>(N);
for (int i=0;i<N;i++)
B[i] = B_stl[i];
}