mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 01:05:39 +03:00
Stabilize alloc free functions for the global allocators.
This commit is contained in:
@@ -56,7 +56,7 @@ fn __rust_realloc(ptr: *mut u8,
|
||||
/// # Safety
|
||||
///
|
||||
/// See [`GlobalAlloc::alloc`].
|
||||
#[unstable(feature = "allocator_api", issue = "32838")]
|
||||
#[stable(feature = "global_alloc", since = "1.28.0")]
|
||||
#[inline]
|
||||
pub unsafe fn alloc(layout: Layout) -> *mut u8 {
|
||||
__rust_alloc(layout.size(), layout.align())
|
||||
@@ -74,7 +74,7 @@ pub unsafe fn alloc(layout: Layout) -> *mut u8 {
|
||||
/// # Safety
|
||||
///
|
||||
/// See [`GlobalAlloc::dealloc`].
|
||||
#[unstable(feature = "allocator_api", issue = "32838")]
|
||||
#[stable(feature = "global_alloc", since = "1.28.0")]
|
||||
#[inline]
|
||||
pub unsafe fn dealloc(ptr: *mut u8, layout: Layout) {
|
||||
__rust_dealloc(ptr, layout.size(), layout.align())
|
||||
@@ -92,7 +92,7 @@ pub unsafe fn dealloc(ptr: *mut u8, layout: Layout) {
|
||||
/// # Safety
|
||||
///
|
||||
/// See [`GlobalAlloc::realloc`].
|
||||
#[unstable(feature = "allocator_api", issue = "32838")]
|
||||
#[stable(feature = "global_alloc", since = "1.28.0")]
|
||||
#[inline]
|
||||
pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 {
|
||||
__rust_realloc(ptr, layout.size(), layout.align(), new_size)
|
||||
@@ -110,7 +110,7 @@ pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8
|
||||
/// # Safety
|
||||
///
|
||||
/// See [`GlobalAlloc::alloc_zeroed`].
|
||||
#[unstable(feature = "allocator_api", issue = "32838")]
|
||||
#[stable(feature = "global_alloc", since = "1.28.0")]
|
||||
#[inline]
|
||||
pub unsafe fn alloc_zeroed(layout: Layout) -> *mut u8 {
|
||||
__rust_alloc_zeroed(layout.size(), layout.align())
|
||||
|
||||
Reference in New Issue
Block a user