summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Samolysov <samolisov@gmail.com>2021-08-18 09:47:21 +0300
committerPavel Samolysov <samolisov@gmail.com>2021-08-18 09:48:29 +0300
commit5942b3fefd55241aa25c01685a8f475d39a78dbe (patch)
tree30b96bf8131da55fb86ef5c56f89f08309ca52a9
parent2e8a5e6fc9ae3eacabf558e678928f2ca963a110 (diff)
downloadrust-libc-5942b3fefd55241aa25c01685a8f475d39a78dbe.tar.gz
Add "_aligned_free" on the Windows platform
All the memory blocks allocated with "_aligned_malloc" must be deallocated using the "_aligned_free" function. Signed-off-by: Pavel Samolysov <samolisov@gmail.com>
-rw-r--r--libc-test/semver/windows.txt1
-rw-r--r--src/windows/mod.rs2
2 files changed, 3 insertions, 0 deletions
diff --git a/libc-test/semver/windows.txt b/libc-test/semver/windows.txt
index 1f66d622eb..5f1c97b8e4 100644
--- a/libc-test/semver/windows.txt
+++ b/libc-test/semver/windows.txt
@@ -148,6 +148,7 @@ abs
accept
access
aligned_malloc
+aligned_free
atexit
atof
atoi
diff --git a/src/windows/mod.rs b/src/windows/mod.rs
index ad0dc77d23..1b5de0bacb 100644
--- a/src/windows/mod.rs
+++ b/src/windows/mod.rs
@@ -492,6 +492,8 @@ extern "C" {
pub fn wsetlocale(category: ::c_int, locale: *const wchar_t) -> *mut wchar_t;
#[link_name = "_aligned_malloc"]
pub fn aligned_malloc(size: size_t, alignment: size_t) -> *mut c_void;
+ #[link_name = "_aligned_free"]
+ pub fn aligned_free(ptr: *mut ::c_void);
}
extern "system" {