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


pg_parquet - Postgres To Parquet Interoperability
28/11/2024

pg_parquet is a new extension by Crunchy Data that allows a PostgreSQL instance to work with Parquet files. With pg_duckdb, pg_analytics and pg_mooncake all of which can access Parquet files, is  [ ... ]



Remembering Grace Hopper On Her 114th Anniversary
09/12/2024

Today sees the start of Computer Science Education Week and  the 2024 Hour of Code. These educational event are timed to coincide with Grace Hopper's birthday on January 9th, 1906 due to her conc [ ... ]


More News

espbook

 

Comments




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