It is safe to assume that GC scanner will never go into maped by user 
regions? I.e. we can safely use mmapped pools for small objects that 
references only other objects from that pool?

воскресенье, 10 июля 2016 г., 5:07:19 UTC+3 пользователь Ian Lance Taylor 
написал:
>
> On Fri, Jul 8, 2016 at 10:11 PM, Arthur <tianc...@gmail.com <javascript:>> 
> wrote: 
> > my program allocates many different kinds of small object, and that 
> gives GC 
> > a lot pressure. 
> > so I wan't to make a big slice and split object from it manually. 
> > 
> > block = make([]byte, 30*1024) 
> > myObj := (*myObjType)(unsafe.Pointer(&block[offset])) 
> > 
> > I write a simple allocator to do it, but I meet strange panic. 
> > so my question is, can't go alloc custom objects from byte slice's 
> memory 
> > address? 
>
> As you've discovered, that can't work. 
>
> On a Unix system you can do this kind of thing safely using Syscall.Mmap. 
>
> 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.

Reply via email to