Closed ghost closed 3 years ago
https://github.com/code-saturne/code_saturne/blob/a83128d0d5bb03bfd40d65e32215150e6f520529/src/mesh/cs_mesh_extrude.c#L2239
cs_mesh_extrude_face_info_create allocates cs_mesh_extrude_face_info_t.expansion_factor as an array of float_t while it should be an array of float, see https://github.com/code-saturne/code_saturne/blob/a83128d0d5bb03bfd40d65e32215150e6f520529/src/mesh/cs_mesh_extrude.h#L63 Even though float_t is typede'f to float on many architectures, it could also be double or long double. In that case, the allocation would waste memory.
cs_mesh_extrude_face_info_create
cs_mesh_extrude_face_info_t.expansion_factor
float_t
float
double
long double
Note that I found this during unrelated code inspection. I did not observe any real-world impact.
Thanks for reporting this.
I was not even aware float_t was defined on many architectures at all. This was a typo...
Fixed in master branch.
https://github.com/code-saturne/code_saturne/blob/a83128d0d5bb03bfd40d65e32215150e6f520529/src/mesh/cs_mesh_extrude.c#L2239
cs_mesh_extrude_face_info_create
allocatescs_mesh_extrude_face_info_t.expansion_factor
as an array offloat_t
while it should be an array offloat
, see https://github.com/code-saturne/code_saturne/blob/a83128d0d5bb03bfd40d65e32215150e6f520529/src/mesh/cs_mesh_extrude.h#L63 Even thoughfloat_t
is typede'f tofloat
on many architectures, it could also bedouble
orlong double
. In that case, the allocation would waste memory.Note that I found this during unrelated code inspection. I did not observe any real-world impact.