Don't have malloc-free pairs that cross DLL boundaries. (#17302)
Summary:
See https://blogs.msdn.microsoft.com/oldnewthing/20060915-04/?p=29723
for more background on this requirement on Windows.
Fixes #17239.
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
cc xkszltl peterjc123
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17302
Differential Revision: D14150067
Pulled By: ezyang
fbshipit-source-id: 9dc16ca781ff17515b8df1bb55492477e7843d4c