Skip to content

Commit

Permalink
Auto merge of #2352 - samolisov:aligned_free_on_windows, r=Amanieu
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bors committed Aug 18, 2021
2 parents 2e8a5e6 + 5942b3f commit e4d2225
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc-test/semver/windows.txt
Expand Up @@ -148,6 +148,7 @@ abs
accept
access
aligned_malloc
aligned_free
atexit
atof
atoi
Expand Down
2 changes: 2 additions & 0 deletions src/windows/mod.rs
Expand Up @@ -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" {
Expand Down

0 comments on commit e4d2225

Please sign in to comment.