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. 

rust

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.

Banner


We Built A Software Engineer
20/03/2024

One of the most worrying things about being a programmer today is the threat from AI. It has gone so far that NVIDA CEO Jensen Huang proclaims that you really shouldn't start training as a programmer  [ ... ]



Amazon Ending Alexa Skills Payments
12/04/2024

Amazon has told developers who are signed up to the Alexa Developer Rewards Program that their monthly payments will end at the end of June. The announcement follows a decision to end the program unde [ ... ]


More News

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info