B
Bryan Parkoff
C/C++ Compiler encourages to limit 1,000 functions under function
pointer, but I am allowed to overlimit 4,096 functions. I am just for fun
to test how it works.
The problem is that source code can only limit 64K lines otherwise C/C++
Compiler will fail to compile. It can't be done in static, but it can be
done at run-time to save source code's space.
I wrote ten sample functions. I did allocate function pointer into
memory at run-time (256K memory space). Then for...loop copies one of ten
sample functions' memory address into function pointer 65,536 times.
Function Pointer is now contained 65,536 functions into memory. Another
for...loop did execute all 65,536 functions through function pointer using
fprintf(...).
Text.Log is created from fprintf(...) has shown all executed 65,536
functions through function pointer. It works perfectly for larger project.
Can you please comment your opinion? Do you think it is too much
functions like overhead CPU? Try to compare to switch(...) because it can
only limit 32K or less. I believe that function pointer is the best
solution for great cache because most functions are smaller.
Bryan Parkoff
pointer, but I am allowed to overlimit 4,096 functions. I am just for fun
to test how it works.
The problem is that source code can only limit 64K lines otherwise C/C++
Compiler will fail to compile. It can't be done in static, but it can be
done at run-time to save source code's space.
I wrote ten sample functions. I did allocate function pointer into
memory at run-time (256K memory space). Then for...loop copies one of ten
sample functions' memory address into function pointer 65,536 times.
Function Pointer is now contained 65,536 functions into memory. Another
for...loop did execute all 65,536 functions through function pointer using
fprintf(...).
Text.Log is created from fprintf(...) has shown all executed 65,536
functions through function pointer. It works perfectly for larger project.
Can you please comment your opinion? Do you think it is too much
functions like overhead CPU? Try to compare to switch(...) because it can
only limit 32K or less. I believe that function pointer is the best
solution for great cache because most functions are smaller.
Bryan Parkoff