Re: [go-nuts] How to allocate memory from OS in compatible way.
On Tue, Jul 12, 2016 at 1:05 AM,wrote: > GCC slow, not GC. Sorry, my apologies for misreading. Ian > вторник, 12 июля 2016 г., 1:52:01 UTC+3 пользователь Ian Lance Taylor > написал: >> >> On Mon, Jul 11, 2016 at 1:25 PM, wrote: >> > Ohh that slow gcc. Sad. >> >> The GC in general is quite fast. If you have specific examples where >> the GC does poorly, please open issues for them with test cases. >> Thanks. >> >> Ian >> >> > понедельник, 11 июля 2016 г., 23:03:07 UTC+3 пользователь Ian Lance >> > Taylor >> > написал: >> >> >> >> On Mon, Jul 11, 2016 at 9:11 AM, wrote: >> >> > Thank for answer but I'm already implemented portable unmanaged >> >> > memory >> >> > pool >> >> > (https://github.com/ardente/goal/blob/master/gut/mempool.go). I'm >> >> > just >> >> > looking for standard direct analogue (incliding mapping of fd -1) of >> >> > unix's >> >> > syscall.Mmap for windows. Looks like there is none. There is some >> >> > rationale >> >> > behind this or just lack of time/interest? >> >> >> >> This is not something most Go programs are expected to do. >> >> >> >> Most Go programs that need to allocate memory that is not controlled >> >> by the Go garbage collector are programs that already use cgo. Those >> >> programs can use C.malloc, which works on all systems. >> >> >> >> Ian >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "golang-nuts" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> > an >> > email to golang-nuts...@googlegroups.com. >> > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] How to allocate memory from OS in compatible way.
GCC slow, not GC. Yes, Go's GC is quite fast and I like it alot, but there is cases where non-generational GC performs poorly, for example large nets of short living objects. I hope the new TOC will improve situation. вторник, 12 июля 2016 г., 1:52:01 UTC+3 пользователь Ian Lance Taylor написал: > > On Mon, Jul 11, 2016 at 1:25 PM,> wrote: > > Ohh that slow gcc. Sad. > > The GC in general is quite fast. If you have specific examples where > the GC does poorly, please open issues for them with test cases. > Thanks. > > Ian > > > понедельник, 11 июля 2016 г., 23:03:07 UTC+3 пользователь Ian Lance > Taylor > > написал: > >> > >> On Mon, Jul 11, 2016 at 9:11 AM, wrote: > >> > Thank for answer but I'm already implemented portable unmanaged > memory > >> > pool > >> > (https://github.com/ardente/goal/blob/master/gut/mempool.go). I'm > just > >> > looking for standard direct analogue (incliding mapping of fd -1) of > >> > unix's > >> > syscall.Mmap for windows. Looks like there is none. There is some > >> > rationale > >> > behind this or just lack of time/interest? > >> > >> This is not something most Go programs are expected to do. > >> > >> Most Go programs that need to allocate memory that is not controlled > >> by the Go garbage collector are programs that already use cgo. Those > >> programs can use C.malloc, which works on all systems. > >> > >> Ian > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "golang-nuts" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to golang-nuts...@googlegroups.com . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] How to allocate memory from OS in compatible way.
On Mon, Jul 11, 2016 at 1:25 PM,wrote: > Ohh that slow gcc. Sad. The GC in general is quite fast. If you have specific examples where the GC does poorly, please open issues for them with test cases. Thanks. Ian > понедельник, 11 июля 2016 г., 23:03:07 UTC+3 пользователь Ian Lance Taylor > написал: >> >> On Mon, Jul 11, 2016 at 9:11 AM, wrote: >> > Thank for answer but I'm already implemented portable unmanaged memory >> > pool >> > (https://github.com/ardente/goal/blob/master/gut/mempool.go). I'm just >> > looking for standard direct analogue (incliding mapping of fd -1) of >> > unix's >> > syscall.Mmap for windows. Looks like there is none. There is some >> > rationale >> > behind this or just lack of time/interest? >> >> This is not something most Go programs are expected to do. >> >> Most Go programs that need to allocate memory that is not controlled >> by the Go garbage collector are programs that already use cgo. Those >> programs can use C.malloc, which works on all systems. >> >> Ian > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] How to allocate memory from OS in compatible way.
Ohh that slow gcc. Sad. понедельник, 11 июля 2016 г., 23:03:07 UTC+3 пользователь Ian Lance Taylor написал: > > On Mon, Jul 11, 2016 at 9:11 AM,> wrote: > > Thank for answer but I'm already implemented portable unmanaged memory > pool > > (https://github.com/ardente/goal/blob/master/gut/mempool.go). I'm just > > looking for standard direct analogue (incliding mapping of fd -1) of > unix's > > syscall.Mmap for windows. Looks like there is none. There is some > rationale > > behind this or just lack of time/interest? > > This is not something most Go programs are expected to do. > > Most Go programs that need to allocate memory that is not controlled > by the Go garbage collector are programs that already use cgo. Those > programs can use C.malloc, which works on all systems. > > Ian > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] How to allocate memory from OS in compatible way.
On Mon, Jul 11, 2016 at 9:11 AM,wrote: > Thank for answer but I'm already implemented portable unmanaged memory pool > (https://github.com/ardente/goal/blob/master/gut/mempool.go). I'm just > looking for standard direct analogue (incliding mapping of fd -1) of unix's > syscall.Mmap for windows. Looks like there is none. There is some rationale > behind this or just lack of time/interest? This is not something most Go programs are expected to do. Most Go programs that need to allocate memory that is not controlled by the Go garbage collector are programs that already use cgo. Those programs can use C.malloc, which works on all systems. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] How to allocate memory from OS in compatible way.
Exactly. I don't know why I was misunderstood because topic title is "How to allocate memory from OS..." and in the first message I mentioned VirtualAllloc and mmap is used to obtain memory from os instead of sbrk in most unix clibs. About discussion - I think patch implementing syscall.Mmap on windows will be better. But I'm unsure that this patch will be accepted. понедельник, 11 июля 2016 г., 20:43:32 UTC+3 пользователь Konstantin Khomoutov написал: > > On Mon, 11 Jul 2016 09:11:14 -0700 (PDT) > sphil...@gmail.com wrote: > > > Thank for answer but I'm already implemented portable unmanaged > > memory pool > > (https://github.com/ardente/goal/blob/master/gut/mempool.go). I'm > > just looking for standard direct analogue (incliding mapping of fd > > -1) of unix's syscall.Mmap for windows. Looks like there is none. > > There is some rationale behind this or just lack of time/interest? > > Uh, since everyone answered to this thread appear to misunderstand your > question in one way or another let me do another stab: do I understand > correctly that you use the word "standard" to actually refer to a > package from the Go standard library or from its set of experimental > packages? > > If yes, then I think the answer would be no, Go does not appear to have > one. I don't know the reason. If you feel like creating a package for > the golang.org/x consider asking on the golang-dev mailing list for > further discussion of this idea. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] How to allocate memory from OS in compatible way.
Thank for answer but I'm already implemented portable unmanaged memory pool (https://github.com/ardente/goal/blob/master/gut/mempool.go). I'm just looking for standard direct analogue (incliding mapping of fd -1) of unix's syscall.Mmap for windows. Looks like there is none. There is some rationale behind this or just lack of time/interest? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] How to allocate memory from OS in compatible way.
On Mon, 11 Jul 2016 00:07:11 -0700 (PDT) sphilip...@gmail.com wrote: > I can allocated memory from OS using syscall.Mmap(-1...) on Unix and > VirtualAlloc on Windows. But may be there is standard and compatible > way to do this? There are none, and I'm pretty sure there simply can't be any: this stuff is pretty different between different OSes. Also note that you're actually confusing things here a bit: Unix's mmap() is actually for memory-mapping files, and creating an anonymous region -- not backed by a file -- is rather a special case. Conversely, VirtualAlloc() is one of several ways Win32 API offers to allocating memory. A Win32 API's cousin to mmap() is MapViewOfFile(), and it's for files. On the other hand, if your intent was more about "how do I handle allocating memory using OS-specific means in a way _my_ code is portable without fuss" then the answer is: use build tags and platform-specific source code files. Here's the good introductory material to this stuff [1]. Basically, you create a set of files named like malloc_{GOOS}.go (like malloc_linux.go, malloc_windows.go etc) and have them declare the same package and export the same API. The Go building toolchain will pick only the file matching the target GOOS it build for. 1. http://dave.cheney.net/2013/10/12/how-to-use-conditional-compilation-with-the-go-build-tool -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] How to allocate memory from OS in compatible way.
Thanks for info but I'm looking for standard way (package from runtime library or from golang.org/x). I'm already have a custom VAlloc/VFree implementation for windows and unix and now curious is there a standard way that I missed. > I unable to find standard mmap for windows in Go library, that was > originial question. Use case is processing of large (several millions of > nodes) trees. > > I have not used it yet: https://github.com/edsrzf/mmap-go > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] How to allocate memory from OS in compatible way.
On Mon, Jul 11, 2016 at 4:37 PMwrote: > I unable to find standard mmap for windows in Go library, that was originial question. Use case is processing of large (several millions of nodes) trees. I have not used it yet: https://github.com/edsrzf/mmap-go -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [go-nuts] How to allocate memory from OS in compatible way.
I unable to find standard mmap for windows in Go library, that was originial question. Use case is processing of large (several millions of nodes) trees. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.