> On 1/22/21 2:38 PM, Jan Hubicka wrote: > > This looks like reasonable solution for Linux (i was thinking of it too) > > but I wonder what about setups w/o mmap support, like mingw32? > > The code still uses malloc approach then. > > > I think we need some fallback there. I was wondering if simply > > disabling topn profiling until gcov_init time (where we seems to assume > > that malloc already works) would work in that case. > > We may lose some speculation during program construction, but that does > > not seem very bad... > > This does not help you as we may still potentially call malloc during context > when alternative allocator locks malloc/free functions. > > Note that situation is very rare and assuming mmap seems to me a reasonable.
I defnitly like using mmap since it should be quite robust on Posix platforms. However we essentially make it impossible to build firefox with profile feedback on Windows with jemalloc profilled, for example? I am not sure how deeply we care and I am sure Mingw must have way to implement memory allocation by hand as well, so we can just be ready to add more ifdef for targets where this become an issue. It would be nice to add some documentation of it, since the hang is very non-obvious, but I do not know if we have good place for this. Honza