digitalmars.D.learn - Keeping a subset of pages allocate via a single call to mmap()
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (10/10) Oct 13 2018 If a D-program GC-allocates via `new` an array spanning multiple
- Sjoerd Nijboer (4/14) Oct 13 2018 I don't believe the GC frees half of allocated memory if there
- Kagamin (3/7) Oct 13 2018 IIRC GC never frees anything
If a D-program GC-allocates via `new` an array spanning multiple pages but after processing only keeps a slice to it that fits inside a single `mmape`d page will GC-collection then free the other unreferenced pages? I realize that such a feature in a GC of any language and type must rely on the OS memory manager being able to free parts of a previously allocated set of continuously positioned pages. Does this depend on whether the used page is the first, last or a page in the middle of the set of pages allocated in one call to mmap.
Oct 13 2018
On Saturday, 13 October 2018 at 18:40:58 UTC, Per Nordlöw wrote:If a D-program GC-allocates via `new` an array spanning multiple pages but after processing only keeps a slice to it that fits inside a single `mmape`d page will GC-collection then free the other unreferenced pages? I realize that such a feature in a GC of any language and type must rely on the OS memory manager being able to free parts of a previously allocated set of continuously positioned pages. Does this depend on whether the used page is the first, last or a page in the middle of the set of pages allocated in one call to mmap.I don't believe the GC frees half of allocated memory if there are no references to the unreferenced point. It would break c style strings I think.
Oct 13 2018
On Saturday, 13 October 2018 at 18:40:58 UTC, Per Nordlöw wrote:If a D-program GC-allocates via `new` an array spanning multiple pages but after processing only keeps a slice to it that fits inside a single `mmape`d page will GC-collection then free the other unreferenced pages?IIRC GC never frees anything https://issues.dlang.org/show_bug.cgi?id=3284 was it fixed?
Oct 13 2018