[gclist] Boehm's GC: allocating much mem atomically?

Stephan Rudlof Stephan.Rudlof@ipk.fhg.de
Wed, 08 Apr 1998 23:32:16 +0200


First I want to thank for Your patience, because of my many questions.
But currently I'm still in the design phase of a library for image
processing operation, which should be better than that before. And so
there are arising many questions at once and after each other.

But if there is a source, where my quiet special questions are answered
before, please let me know.
But now to the next...

Hans Boehm writes in README to version 4.12:
'...
6)  GC_malloc_ignore_off_page(bytes)
        - identical to GC_malloc, but the client promises to keep a
pointer to
          the somewhere within the first 256 bytes of the object while
it is
          live.  (This pointer should nortmally be declared volatile to
prevent
          interference from compiler optimizations.)  This is the
recommended
          way to allocate anything that is likely to be larger than
100Kbytes
          or so.  (GC_malloc may result in failure to reclaim such
objects.)
...'

I have to allocate much *atomic* mem, e.g. 1 MB images. But if I'd
allocate it with 'GC_malloc_ignore_off_page()' what behaves 'identical
to GC_malloc' it wouldn't be atomic and the collector scans it, I think.
But I'm afraid of the consequences of the last two sentences in the
citation, if I would use another function.

Is there any other way? (Perhaps GC_malloc_atomic() is robust for *much*
mem, but It's not so clear from README.)

Where is the limit for *safely* allocating mem by
- GC_malloc_atomic() and 
- GC_malloc?


Greetings,
-- 
sr (Stephan Rudlof (srudlof@ipk.fhg.de))
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3