c9s / r3

libr3 is a high-performance path dispatching library. It compiles your route paths into a prefix tree (trie). By using the constructed prefix trie in the start-up time, you may dispatch your routes with efficiency
http://c9s.github.com/r3/bench.html
MIT License
814 stars 83 forks source link

Export symbols only when it matches regex '^r3_' #23

Closed czchen closed 10 years ago

czchen commented 10 years ago

struct name does not need to be exported since they are just offset and size in application binary interface (ABI). As for symbol match_entry, updated regex will export them.

The command objdump -t libr3.so.0 can be used to see export symbols. If the second column of a symbol is marked as g, it is exported.

c9s commented 10 years ago

Looks nice! thanks!

c9s commented 10 years ago

Merged thanks!

c9s commented 10 years ago

The r3_tree_insert_pathl is actually a macro of _r3_tree_insert_pathl, so I commented the regexp statement.

czchen commented 10 years ago

I think adding prefix r3 and using -export-symbols-regex are necessary to avoid name collision problem.

In current code, some generic names like str_split are exported. These symbols are easily cause name collision. This can be avoid by adding unique prefix.

As for testing, if testing internal functions is necessary, we can just link testing program against static library so that testing internal functions is okay.

c9s commented 10 years ago

Agree~