Make memory allocation macros windows-compatible (#4071)
Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/4071 Make windows-compatible versions of memory allocation macros `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR` by using lambda functions. Previously the preprocessing did not work because the windows compiler does not support expression statements. Keep the original implementations to maintain compatibility with other call-sites, which will eventually be refactored. Then refactor the `memory_allocator_test.cpp` to migrate away from using `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR`. Reviewed By: dbort Differential Revision: D58850316 fbshipit-source-id: 9ae4f0ec045afe8370f2d0037a2eee5308a6a6ec
J
Jack Zhang committed
748a4f8e4213618206783e0bdc3f5f209a6d5b60
Parent: 929fc80
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 6/28/2024, 6:05:49 AM