Skip to content

Commit e4d2225

Browse files
committed
Auto merge of #2352 - samolisov:aligned_free_on_windows, r=Amanieu
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 <[email protected]>
2 parents 2e8a5e6 + 5942b3f commit e4d2225

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

libc-test/semver/windows.txt

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ abs
148148
accept
149149
access
150150
aligned_malloc
151+
aligned_free
151152
atexit
152153
atof
153154
atoi

src/windows/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,8 @@ extern "C" {
492492
pub fn wsetlocale(category: ::c_int, locale: *const wchar_t) -> *mut wchar_t;
493493
#[link_name = "_aligned_malloc"]
494494
pub fn aligned_malloc(size: size_t, alignment: size_t) -> *mut c_void;
495+
#[link_name = "_aligned_free"]
496+
pub fn aligned_free(ptr: *mut ::c_void);
495497
}
496498

497499
extern "system" {

0 commit comments

Comments
 (0)