Go 1.19 Revises Memory Model |
Written by Kay Ewbank |
Monday, 15 August 2022 |
Go 1.19 has been released with a revised memory model, and changes to the implementation of the toolchain, runtime, and libraries. Go is an open source project developed by a team at Google and many contributors from the open source community over more than 8 years. The main intended use is as a systems programming language, and it has been used in high profile commercial successes such as Docker. The Go memory model has been revised to align Go with the memory model used by C, C++, Java, JavaScript, Rust, and Swift. Go only provides sequentially consistent atomics, not any of the more relaxed forms found in other languages. Along with the memory model update, Go 1.19 introduces new types in the sync/atomic package that make it easier to use atomic values. The runtime now includes support for a soft memory limit. This memory limit includes the Go heap and all other memory managed by the runtime, and excludes external memory sources such as mappings of the binary itself, memory managed in other languages, and memory held by the operating system on behalf of the Go program. Go 1.19 adds support for links, lists, and clearer headings in doc comments, and error checking has been improved with the vet checker “errorsas” now correctly reporting when errors.As is called with a second argument of type *error". The developers say this is a common mistake. The core library has also been improved with support for new atomic types, specifically Bool, Int32, Int64, Uint32, Uint64, Uintptr, and Pointer. Path lookups have also been changed so that Command and LookPath no longer allow results from a Path search to be found relative to the current directory - whether this is an improvement or not is questionable but the team says the change removes a common source of security problems in the form of issues involving Path lookups in untrusted directories that can lead to remote execution during the go get command. Go 1.19 is available for download now. More InformationRelated ArticlesGo 1.18 Released With Generics And Fuzzing Insights Into Where Go Is Going To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info |