In our project, we have pretty big C file of around 50K lines, written in 90's. I wanted to split the file based on the functionality. But, all the functions in this file are declared as static. So, file scoped. If I split the file, then the function in file1 cannot call function in file2 and vice-versa.
But, My TL feels like that there could be memory optimization by using static functions. I wrote some sample code to see if the stacks are different for different threads. It seemed like it was. Could someone please enlighten me the difference between static function and a normal one other an file scope?
static
is to avoid name collisions, not any optimization or efficiency concerns. So if you can add a unique enough prefix or suffix to the function names, it could be just fine to make themextern
.