diff options
| author | Tim Diekmann <tim.diekmann@3dvision.de> | 2020-12-04 14:47:15 +0100 |
|---|---|---|
| committer | Tim Diekmann <tim.diekmann@3dvision.de> | 2020-12-04 14:47:15 +0100 |
| commit | 9274b37d99f608e5fde569788ee79bd72fc3cf13 (patch) | |
| tree | c42beb7089a4aea6d915167c837ab075a0f9d4ae /library/alloc/src/raw_vec/tests.rs | |
| parent | e6225434fff7d493baac0aa91c57f2da923ea196 (diff) | |
| download | rust-9274b37d99f608e5fde569788ee79bd72fc3cf13.tar.gz rust-9274b37d99f608e5fde569788ee79bd72fc3cf13.zip | |
Rename `AllocRef` to `Allocator` and `(de)alloc` to `(de)allocate`
Diffstat (limited to 'library/alloc/src/raw_vec/tests.rs')
| -rw-r--r-- | library/alloc/src/raw_vec/tests.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/library/alloc/src/raw_vec/tests.rs b/library/alloc/src/raw_vec/tests.rs index cb4fe1b46cd..8c15a24409b 100644 --- a/library/alloc/src/raw_vec/tests.rs +++ b/library/alloc/src/raw_vec/tests.rs @@ -20,13 +20,13 @@ fn allocator_param() { struct BoundedAlloc { fuel: Cell<usize>, } - unsafe impl AllocRef for BoundedAlloc { - fn alloc(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> { + unsafe impl Allocator for BoundedAlloc { + fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> { let size = layout.size(); if size > self.fuel.get() { return Err(AllocError); } - match Global.alloc(layout) { + match Global.allocate(layout) { ok @ Ok(_) => { self.fuel.set(self.fuel.get() - size); ok @@ -34,8 +34,8 @@ fn allocator_param() { err @ Err(_) => err, } } - unsafe fn dealloc(&self, ptr: NonNull<u8>, layout: Layout) { - unsafe { Global.dealloc(ptr, layout) } + unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) { + unsafe { Global.deallocate(ptr, layout) } } } |
