1. 28 Jan, 2014 1 commit
    • Austin Seipp's avatar
      Refactor GCTDecl.h, and mitigate #7602 a bit · 28b031c5
      Austin Seipp authored
      This basically cleans a lot of GCTDecl up - I found it quite hard to
      read and a bit confusing. The changes are mostly cosmetic: better
      delineation between the alternative cases and light touchups, and tries
      to make every branch as consistent as possible.
      However, this patch does have one significant effect: it will ensure
      that any LLVM-based compilers will use __thread if they support it.
      Before, they would simply always use pthread_getspecific and
      pthread_setspecific, which are almost surely even *more* inefficient.
      The details are a bit too long and boring to go into here; see #7602.
      After talking with Simon, we decided to play it safe - __thread can at
      least be optimized by future clang releases even further on OS X if they
      choose, and it's safer until we can investigate the pthread
      implementation further on Mavericks.
      For Linux, the story isn't so bleak if you use Clang (for whatever
      reason) - Linux directly writes to `%fs` for __thread slots (while OS X
      will perform a load followed by an indirect call.) So it should still be
      fairly competitive, speed-wise.
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
  2. 01 Oct, 2013 1 commit
  3. 17 Jan, 2013 1 commit
    • Simon Marlow's avatar
      Hopefully fix breakage on OS X w/ LLVM · 0dcccf0c
      Simon Marlow authored
      Reordering of includes in GC.c broke on OS X because gctKey is
      declared in Task.h and is needed in the storage manager.  This is
      really the wrong place for it anyway, so I've moved the gctKey pieces
      to where they should be.
  4. 07 Oct, 2011 1 commit
    • dmp's avatar
      Enable pthread_getspecific() tls for LLVM compiler · dba72545
      dmp authored
      LLVM does not support the __thread attribute for thread
      local storage and may generate incorrect code for global
      register variables. We want to allow building the runtime with
      LLVM-based compilers such as llvm-gcc and clang,
      particularly for MacOS.
      This patch changes the gct variable used by the garbage
      collector to use pthread_getspecific() for thread local
      storage when an llvm based compiler is used to build the
  5. 11 Apr, 2011 1 commit
    • Simon Marlow's avatar
      Refactoring and tidy up · 1fb38442
      Simon Marlow authored
      This is a port of some of the changes from my private local-GC branch
      (which is still in darcs, I haven't converted it to git yet).  There
      are a couple of small functional differences in the GC stats: first,
      per-thread GC timings should now be more accurate, and secondly we now
      report average and maximum pause times. e.g. from minimax +RTS -N8 -s:
                                          Tot time (elapsed)  Avg pause  Max pause
        Gen  0      2755 colls,  2754 par   13.16s    0.93s     0.0003s    0.0150s
        Gen  1       769 colls,   769 par    3.71s    0.26s     0.0003s    0.0059s