Move heap allocator into a module

This commit is contained in:
Carl Lerche
2015-04-07 21:06:38 -07:00
parent dfe4cec871
commit c4f2e20eb1
5 changed files with 64 additions and 58 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
use {alloc, Bytes, SeqByteStr, MAX_CAPACITY};
use {alloc, heap, Bytes, SeqByteStr, MAX_CAPACITY};
use traits::{Buf, MutBuf, MutBufExt, ByteStr};
use std::{cmp, ptr};
@@ -59,7 +59,7 @@ impl ByteBuf {
capacity = capacity.next_power_of_two();
// Allocate the memory
let mem = alloc::HEAP.allocate(capacity as usize);
let mem = heap::allocate(capacity as usize);
// If the allocation failed, return a blank buf
if mem.is_none() {