hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Patrick McCabe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-3742) libhdfs symbol visibility issues
Date Tue, 31 Jul 2012 00:05:35 GMT

    [ https://issues.apache.org/jira/browse/HDFS-3742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425407#comment-13425407

Colin Patrick McCabe commented on HDFS-3742:

The last answer on that stackoverflow question says:

bq. The code generated to call any exported functions or use any exported globals is less
efficient than those that aren't exported. There is an extra level of indirection involved.
This applies to any function that might be exported at compile time. gcc will still produce
extra indirection for a function that is later un-exported by a linker script. So using the
visibility attribute will produce better code than the linker script.

In other words, linker version scripts are less efficient than just using __attribute__((visibility))

More importantly, I don't think new contributors will understand how to add new functions
to the API if we use a separate, magic script.  Whereas it's easy to copy and paste the old
function definition to the new one.  It's more obvious what's going on when the information
is in the code rather than a separate file.
> libhdfs symbol visibility issues
> --------------------------------
>                 Key: HDFS-3742
>                 URL: https://issues.apache.org/jira/browse/HDFS-3742
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 2.2.0-alpha
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>            Priority: Minor
> libhdfs symbols should be hidden unless they're part of the API.  If we don't hide symbols,
they could conflict with symbols in a library user's program.
> This can be accomplished with __attribute__((visibility)) like this:
> {code}
> void __attribute__((visibility("hidden"))) bar(int i);
> {code}

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message