Skip to content

Commit

Permalink
Stabilize the System allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed May 31, 2018
1 parent 5f00d65 commit 39a6876
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/liballoc_system/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use core::alloc::{Alloc, GlobalAlloc, AllocErr, Layout};
use core::ptr::NonNull;

/// The default memory allocator provided by the operating system.
#[unstable(feature = "allocator_api", issue = "32838")]
#[stable(feature = "alloc_system_type", since = "1.28.0")]
pub struct System;

#[unstable(feature = "allocator_api", issue = "32838")]
Expand Down Expand Up @@ -107,7 +107,7 @@ mod platform {
use System;
use core::alloc::{GlobalAlloc, Layout};

#[unstable(feature = "allocator_api", issue = "32838")]
#[stable(feature = "alloc_system_type", since = "1.28.0")]
unsafe impl GlobalAlloc for System {
#[inline]
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
Expand Down Expand Up @@ -240,7 +240,7 @@ mod platform {
ptr as *mut u8
}

#[unstable(feature = "allocator_api", issue = "32838")]
#[stable(feature = "alloc_system_type", since = "1.28.0")]
unsafe impl GlobalAlloc for System {
#[inline]
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
Expand Down Expand Up @@ -304,7 +304,7 @@ mod platform {
// No need for synchronization here as wasm is currently single-threaded
static mut DLMALLOC: dlmalloc::Dlmalloc = dlmalloc::DLMALLOC_INIT;

#[unstable(feature = "allocator_api", issue = "32838")]
#[stable(feature = "alloc_system_type", since = "1.28.0")]
unsafe impl GlobalAlloc for System {
#[inline]
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use core::{mem, ptr};
#[doc(inline)]
pub use alloc_crate::alloc::*;

#[unstable(feature = "allocator_api", issue = "32838")]
#[stable(feature = "alloc_system_type", since = "1.28.0")]
#[doc(inline)]
pub use alloc_system::System;

Expand Down

0 comments on commit 39a6876

Please sign in to comment.