#3941: GC: excess of reserved space for bitmaps in case of mark/compact/sweep
-----------------------------+----------------------------------------------
  Reporter:  gabrielrf       |          Owner:                  
      Type:  bug             |         Status:  closed          
  Priority:  normal          |      Milestone:                  
 Component:  Runtime System  |        Version:  6.10.4          
Resolution:  invalid         |       Keywords:                  
Difficulty:                  |             Os:  Unknown/Multiple
  Testcase:                  |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown    |  
-----------------------------+----------------------------------------------
Changes (by simonmar):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 I think you're incorrect.  The bitmap requires 1 bit per word of heap,
 which is

 {{{
 1 bit per word
 == 1 bit per sizeof(W_) bytes
 == 8 bits per 8*sizeof(W_) bytes
 }}}

 so to get the number of bytes in the bitmap, we divide the number of bytes
 in the heap by `8*sizeof(W_)`, which is what the calculation does.

 The later calculation you referred to is in terms of words, because the
 variable `bitmap` has type `StgWord *`, and pointer arithmetic in C is in
 units of the pointed-to type.

 So I believe if you try to make the change you suggest, the result will be
 a resounding segfault.  Please try it!

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3941#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to