[GHC] #11816: Refactor SymbolInfo out of Linker.c

GHC ghc-devs at haskell.org
Fri Jun 3 20:12:09 UTC 2016


#11816: Refactor SymbolInfo out of Linker.c
-------------------------------------+-------------------------------------
        Reporter:  Phyx-             |                Owner:  Phyx-
            Type:  task              |               Status:  closed
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Runtime System    |              Version:  8.1
  (Linker)                           |
      Resolution:  fixed             |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #11223            |  Differential Rev(s):  Phab:D2184
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"37473722960a1066c3b45c94377ba08769b1375b/ghc"
 37473722/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="37473722960a1066c3b45c94377ba08769b1375b"
 Refactored SymbolInfo to lower memory usage in RTS

 Previously as part of #11223 a new struct `SymbolInfo` was introduced to
 keep track it the weak symbol status of a symbol.

 This structure also kept a copy of the calculated address of the symbol
 which turns out was useful in ignoring non-weak zero-valued symbols.

 The information was kept in an array so it means for every symbol two
 extra bytes were kept even though the vast majority of symbols are
 non-weak and non-zero valued.

 This changes the array into a sparse map keeping this information only
 for the symbols that are weak or zero-valued. This allows for a
 reduction in the amount of information needed to be kept while giving up
 a small (negligable) hit in performance as this information now has to
 be looked up in hashmaps.

 Test Plan: ./validate on all platforms that use the runtime linker.

 For unix platforms please ensure `DYNAMIC_GHC_PROGRAMS=NO` is added to
 your validate file.

 Reviewers: simonmar, austin, erikd, bgamari

 Reviewed By: simonmar, bgamari

 Subscribers: thomie, #ghc_windows_task_force

 Differential Revision: https://phabricator.haskell.org/D2184

 GHC Trac Issues: #11816
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11816#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list