Re: [go-nuts] Re: A question, simple for go team

2016-10-22 Thread Ian Lance Taylor
On Sat, Oct 22, 2016 at 6:40 PM, T L wrote: > > On Saturday, October 22, 2016 at 11:59:55 PM UTC+8, Ian Lance Taylor wrote: >> >> On Sat, Oct 22, 2016 at 2:01 AM, T L wrote: >> > >> > On Saturday, October 22, 2016 at 4:57:52 PM UTC+8, T L wrote: >> >> >> >> >> >> The string struct used internally

Re: [go-nuts] Re: A question, simple for go team

2016-10-22 Thread T L
On Saturday, October 22, 2016 at 11:59:55 PM UTC+8, Ian Lance Taylor wrote: > > On Sat, Oct 22, 2016 at 2:01 AM, T L > > wrote: > > > > On Saturday, October 22, 2016 at 4:57:52 PM UTC+8, T L wrote: > >> > >> > >> The string struct used internally is > >> > >> type stringStruct struct { >

Re: [go-nuts] Re: A question, simple for go team

2016-10-22 Thread Pietro Gagliardi
DIscounting even garbage collector: is there any memory allocator anywhere that provides a facility to only return bytes at the start of an allocation to the manager? realloc() only lets you return bytes at the end, and most other allocators I've seen are based on that one's API... > On Oct 22,

Re: [go-nuts] Re: A question, simple for go team

2016-10-22 Thread Ian Lance Taylor
On Sat, Oct 22, 2016 at 2:01 AM, T L wrote: > > On Saturday, October 22, 2016 at 4:57:52 PM UTC+8, T L wrote: >> >> >> The string struct used internally is >> >> type stringStruct struct { >> str unsafe.Pointer >> len int >> } >> >> When following f function is called and s is cleared, >>

Re: [go-nuts] Re: A question, simple for go team

2016-10-22 Thread Jan Mercl
On Sat, Oct 22, 2016 at 11:02 AM T L wrote: > I mean how do go runtime knows "abcdefg" instead of "cde" should be released. It's a simple case of some programming ;-) (More here: https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)) -- -j -- You received this message because

[go-nuts] Re: A question, simple for go team

2016-10-22 Thread T L
On Saturday, October 22, 2016 at 4:57:52 PM UTC+8, T L wrote: > > > The string struct used internally is > > type stringStruct struct { > str unsafe.Pointer > len int > } > > When following f function is called and s is cleared, > how do go runtime knows the starting memory address of th