Skip to content

Commit

Permalink
Add "_aligned_free" on the Windows platform
Browse files Browse the repository at this point in the history
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
samolisov committed Aug 18, 2021
1 parent 2e8a5e6 commit 5942b3f
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 5942b3f

Please sign in to comment.