FAQ

On Sat, Jun 20, 2015 at 10:07:56AM +0200, Jakob Borg wrote:
Is there a description out there about what the memory backing of a buffered channel looks like? I.e., does

c := make(chan int, 10000)

allocate something similar to a [10000]int up front, or is there a more append-like behavior that allocates slices on demand?
The current behaviour of make(chan T, n) is to allocate the whole buffer up front (src/runtime/chan.go +/makechan).

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJun 20, '15 at 8:08a
activeJun 20, '15 at 9:31a
posts2
users2
websitegolang.org

2 users in discussion

Michael Gehring: 1 post Jakob Borg: 1 post

People

Translate

site design / logo © 2021 Grokbase