crc table

Asked by regulararmy

Hello Didier,
          In your lib,there is five crc tables with 256 char elements in the comp and decomp struct, I find they are same, why do you define the tables as global variable only in one file. Thank you.

Regards,
cxs

Question information

Language:
English Edit question
Status:
Solved
For:
rohc Edit question
Assignee:
No assignee Edit question
Solved by:
Didier Barvaux
Solved:
Last query:
Last reply:
Revision history for this message
Didier Barvaux (didier-barvaux) said :
#1

Hello,

The tables are defined in crc.c but they are declared as 'extern' in rohc.h so they could be used anywhere in the ROHC library.

Please note that those global variables are deprecated, they are not used anymore. They are kept for compatibility with earlier versions.

Regards,
Didier

Revision history for this message
regulararmy (regulararmy) said :
#2

why do you not use the global variables anymore, are there some special reasons?

Revision history for this message
Best Didier Barvaux (didier-barvaux) said :
#3

Global variables are not great for multi-threaded environments.

Didier

Revision history for this message
regulararmy (regulararmy) said :
#4

Thanks Didier Barvaux, that solved my question.