I'd like to allocate 2D array (square matrix) using memalign
with 16B instead of using just malloc
.
I have
A =(float **) malloc( (*dim) * sizeof(float*));
for ( i = 0 ; i < (*dim) ; i++) {
A[i] = (float*) malloc(sizeof(float)*(*dim));
}
how can I change code above with memalign
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…