Когда я запускаю valgrind для фрагмента кода, он говорит мне, что моя ошибка лежит в этой строке кода, но я не могу понять это (vector_size, если типа int):
float *rotations = (float *) calloc(vector_size*vector_size, sizeof(float));
И вотвывод valgrind:
Invalid write of size 4
==5488== at 0x109272: main (rotate_vector.c:20)
==5488== Address 0x4a47164 is 0 bytes after a block of size 196 alloc'd
==5488== at 0x4839775: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5488== by 0x1091D5: main (rotate_vector.c:8)
==5488==
==5488==
==5488== Process terminating with default action of signal 11 (SIGSEGV)
==5488== Access not within mapped region at address 0x4E47018
==5488== at 0x109272: main (rotate_vector.c:20)
==5488== If you believe this happened as a result of a stack
==5488== overflow in your program's main thread (unlikely but
==5488== possible), you can try to increase the size of the
==5488== main thread stack using the --main-stacksize= flag.
==5488== The main thread stack size used in this run was 8388608.
Есть предложения по исправлению?