https://gitlab.onelab.info/gmsh/gmsh/-/issues/2915
diff --git a/contrib/hxt/tetMesh/src/hxt_tetRefine.c b/contrib/hxt/tetMesh/src/hxt_tetRefine.c
index d4c23f3..ac404f3 100644
--- a/contrib/hxt/tetMesh/src/hxt_tetRefine.c
+++ b/contrib/hxt/tetMesh/src/hxt_tetRefine.c
@@ -297,9 +297,9 @@ static uint64_t* scanbsearch(uint64_t* array, uint64_t key, size_t num)
  *  - startTet[maxThreads] = mesh->tetrahedra.num
  *  - `startPt[t+1] - startPt[t]` gives how many point will be created by thread t
  */
-static HXTStatus balanceRefineWork(HXTMesh* mesh, uint32_t* startPt, size_t* startTet, int maxThreads)
+static HXTStatus balanceRefineWork(HXTMesh* mesh, uint32_t* startPt, uint64_t* startTet, int maxThreads)
 {
-  size_t* scan;
+  uint64_t* scan;
   uint32_t ptPerThreadGoal;
   HXT_CHECK( hxtAlignedMalloc(&scan, sizeof(size_t) * mesh->tetrahedra.num) );

@@ -343,7 +343,7 @@ static HXTStatus balanceRefineWork(HXTMesh* mesh, uint32_t* startPt, size_t* sta

     // we want to find i such that scan[i] = scanToFind.
     // we do a simple binary search in the prefix scan array to find `i`
-    size_t* pfnd = scanbsearch(scan, scanToFind, mesh->tetrahedra.num);
+    uint64_t* pfnd = scanbsearch(scan, scanToFind, mesh->tetrahedra.num);
     startTet[threadID] = pfnd  - scan;
     if(startTet[threadID] < mesh->tetrahedra.num)
       startPt[threadID] = *pfnd;
