From fea1bd4cdf375fa097789b2484b746cacdfddb73 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 22 Sep 2016 00:10:37 +0000 Subject: std: Move platform specific memchr code into sys --- src/libstd/sys/windows/memchr.rs | 15 +++++++++++++++ src/libstd/sys/windows/mod.rs | 1 + 2 files changed, 16 insertions(+) create mode 100644 src/libstd/sys/windows/memchr.rs (limited to 'src/libstd/sys/windows') diff --git a/src/libstd/sys/windows/memchr.rs b/src/libstd/sys/windows/memchr.rs new file mode 100644 index 00000000000..5a5386acaa5 --- /dev/null +++ b/src/libstd/sys/windows/memchr.rs @@ -0,0 +1,15 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. +// +// Original implementation taken from rust-memchr +// Copyright 2015 Andrew Gallant, bluss and Nicolas Koch + +// Fallback memchr is fastest on windows +pub use sys_common::memchr::fallback::{memchr, memrchr}; diff --git a/src/libstd/sys/windows/mod.rs b/src/libstd/sys/windows/mod.rs index c31726a4a25..df9cef33927 100644 --- a/src/libstd/sys/windows/mod.rs +++ b/src/libstd/sys/windows/mod.rs @@ -26,6 +26,7 @@ pub mod env; pub mod ext; pub mod fs; pub mod handle; +pub mod memchr; pub mod mutex; pub mod net; pub mod os; -- cgit 1.4.1-3-g733a5