Commit bf4eba65 by Christophe Geuzaine

trying to fix 32 bit builds

parent 59160f27
Pipeline #1388 passed with stage
in 36 minutes 29 seconds
......@@ -279,7 +279,7 @@ HXTStatus hxtLinearSystemLUCreate(HXTLinearSystemLU **pSystem, int nElements, in
}
free(nodeRowStart);
free(nodeRowEnd);
system->M = malloc(sizeof(double)*totalSize);
system->M = malloc(sizeof(double)*totalSize); // FIXME Gmsh instead of _mm_malloc
system->rows = malloc(sizeof(double*)*system->n);
for (int i = 0; i < totalSize; ++i)
system->M[i] = 0;
......@@ -291,7 +291,7 @@ HXTStatus hxtLinearSystemLUCreate(HXTLinearSystemLU **pSystem, int nElements, in
totalSize += system->rowEnd[i]-system->rowStart[i]+(paddedStart-start);
system->rows[i] = system->M + paddedStart;
}
system->x = malloc(sizeof(double)*system->n);
system->x = malloc(sizeof(double)*system->n); // FIXME Gmsh instead of _mm_malloc
return HXT_STATUS_OK;
}
......
......@@ -52,7 +52,7 @@ ___
| int arrayLength = ...;
| int *array;
| HXT_CHECK( hxtMalloc(&array, sizeof(int)*arrayLength) );
|
|
| array[0] = ...;
| [...]
| array[arrayLength-1] = ...;
......@@ -104,6 +104,15 @@ static inline HXTStatus hxtRealloc(void* ptrToPtr, size_t size)
}
// FIXME Gmsh: aligned routines do not seem to work on 32 bit machines
#include <stdint.h>
#if UINTPTR_MAX == 0xffffffff
static inline HXTStatus hxtGetAlignedBlockSize(void* ptrToPtr, size_t* size){ *size = 0; return HXT_STATUS_OK; }
static inline HXTStatus hxtAlignedMalloc(void* ptrToPtr, size_t size){ return hxtMalloc(ptrToPtr, size); }
static inline HXTStatus hxtAlignedFree(void* ptrToPtr){ return hxtFree(ptrToPtr); }
static inline HXTStatus hxtAlignedRealloc(void* ptrToPtr, size_t size){ return hxtRealloc(ptrToPtr, size); }
#else
/*********************************************************
* Hextreme aligned malloc implementation
*********************************************************/
......@@ -178,7 +187,7 @@ static inline HXTStatus hxtAlignedRealloc(void* ptrToPtr, size_t size)
HXT_CHECK(hxtAlignedFree(ptrToPtr));
return HXT_STATUS_OK;
}
size_t old_size;
HXT_CHECK( hxtGetAlignedBlockSize(ptrToPtr, &old_size) );
......@@ -196,6 +205,7 @@ static inline HXTStatus hxtAlignedRealloc(void* ptrToPtr, size_t size)
return HXT_STATUS_OK;
}
#endif // FIXME Gmsh
/*********************************************************
* Matrix operations
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment