Quote:
|
Originally Posted by DreamWarrior
...rather I must store offsets and let the application compute the actual pointer value by adding its individual "base address." This is obviously performance draining....
So...how is that "obstacle" usally overcome?
|
I do not share your trepidation regarding the performance hit. This is virtually the definition of of an array reference is performed and I use arrays quite a bit. Switching your app entirely to arrays and never using pointers at all might actually improve performance provided that you use the optimizer. In any event, many implementations to not allow you to choose the address of a shared memory segment and portable code should not rely on having that option. Shared libraries are compiled using PIC (position independent code) despite the fact that there is often a minor performance hit with PIC. Shared data segments should also be position independent. It's the cost of doing business.