edsrzf / mmap-go

A portable mmap package for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: expose the maximum configured number of mmaped regions.

cznic opened this issue · comments

commented

Can we please have added a cross-platform API call which will parse and return /proc/sys/vm/max_map_count on Linux and whatever it is on other platforms? Something like

// MaxMapCount returns the per process limit on the maximum number of mmaped regions,
// or an error, if any.
func MaxMapCount() (int, error)

If accepted, I'll be happy to submit the Linux implementation PR.

I'm not sure such a thing exists on all platforms, and it seems a little niche on top of that. If it can be supported on all currently-supported platforms and if someone's willing to put in some effort to help, I'm willing to add it, but it seems pretty unlikely to be honest.

commented

OK, no problem,