Rust 1.28 Improves Memory Use
Written by Kay Ewbank   
Tuesday, 14 August 2018

More effective use of system memory at run time is the main improvement to the latest Rust, version 1.28.

The improvements fall squarely into the original design goals for Rust, which set out to be safe, fast and concurrent without having a garbage collector. It is constructed so that problems are detected at compile time so that it can be used safely for systems programming. Rust was originally sponsored by Mozilla, and is intended for use in situations including embedding in other languages, writing programs with specific space and time requirements, and writing low-level code, like device drivers and operating systems. 

The first improvement is a newly stabilized global allocators that handle how programs in Rust obtain memory from the system at runtime.In previous releases,it wasn't possible to change the way memory is obtained, so developers had to use alternative options such as jemalloc or the system allocator depending on the underlying system. In this version the global allocator attribute is now stable, which allows Rust programs to set their allocator to the system allocator. Developers can also define new allocators based on the GlobalAlloc trait.

In addition to the stabilized GlobalAlloc trait, other libraries have also been stabilized. In particular, NonZero number types can now be used to wrap around standard unsigned integer types to provide size optimization when there's no need to handle data that won't ever be zero.

Cargo is the other main area to have received attention. Cargo is the Rust package manager, and it will no longer allow you to publish crates with build scripts that modify the src directory. The src directory in a crate should be considered to be immutable, according to the Rust developers.

Work has also continued on the diagnostics options in this release, with an emphasis on error messages about formatting. Previously, you were only told that a format string was invalid; now, you're told the specific reason the format string is invalid.

Rust 1.28 is now available on GitHub. 


More Information

Rust Website

Related Articles

Rust 1.26 Adds Existential Types

Rust 1.24 Adds Reformatter

Rust 1.23 Uses Less Memory

Rust 1.20 Adds Associated Contents

Rust 1.16

Updated Rust Improves Documentation

Rust 1.6 Released

Rust 1.3 Released

Rust Releases New Versions

Rust Hits Stable 1.0 - So What?

Rust 1.0 Alpha Released       

Rust Reaches 0.9

Rust 0.7 Released

Rust 0.4 Full Integration of Borrowed Pointers


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.


Can C++ Be As Safe As Rust?

Herb Sutter is a well known and respected C++ champion and he thinks that the language only needs a few tweaks to make it as safe as Rust. Can this be true?

Angular and Wiz To Merge

Two web development frameworks used at Google are merging. One, Angular is open source and widely known, while the other, Wiz, is an internal web framework developed and used by Google for some o [ ... ]

More News

raspberry pi books



or email your comment to: