diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2014-10-24 17:34:37 -0400 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2014-10-25 12:33:27 -0400 |
| commit | 6f253bd49e80c809b7c22fd257bcef06a8ca7c30 (patch) | |
| tree | e1de58dad366100d17e67191e47d98bbe381ffcb /src | |
| parent | 6c18e508f10aa5bf42dc80691654b9cde2a661cd (diff) | |
rm unnecessary libc allocator usage
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustrt/mutex.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustrt/mutex.rs b/src/librustrt/mutex.rs index b328df1949e..838dfd6b7ab 100644 --- a/src/librustrt/mutex.rs +++ b/src/librustrt/mutex.rs @@ -516,7 +516,7 @@ mod imp { #[cfg(windows)] mod imp { - use alloc::libc_heap::malloc_raw; + use alloc::heap; use core::atomic; use core::ptr; use libc::{HANDLE, BOOL, LPSECURITY_ATTRIBUTES, c_void, DWORD, LPCSTR}; @@ -607,7 +607,7 @@ mod imp { } pub unsafe fn init_lock() -> uint { - let block = malloc_raw(CRIT_SECTION_SIZE as uint) as *mut c_void; + let block = heap::allocate(CRIT_SECTION_SIZE, 8) as *mut c_void; InitializeCriticalSectionAndSpinCount(block, SPIN_COUNT); return block as uint; } @@ -619,7 +619,7 @@ mod imp { pub unsafe fn free_lock(h: uint) { DeleteCriticalSection(h as LPCRITICAL_SECTION); - libc::free(h as *mut c_void); + heap::deallocate(h as *mut u8, CRIT_SECTION_SIZE, 8); } pub unsafe fn free_cond(h: uint) { |
