orccodemem: Add support for Universal Windows Platform apps
authorNirbheek Chauhan <nirbheek@centricular.com>
Tue, 30 Jun 2020 10:46:39 +0000 (16:16 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Wed, 1 Jul 2020 01:56:16 +0000 (07:26 +0530)
commitcd8eabf041a14b5cdcc13c5436dbccdd66d558bb
treef8a0ada6c886a48707d6ac6898d988939cd0c9e3
parente990f2e17a1eb6c195583db15b25dd1bba88dfa9
orccodemem: Add support for Universal Windows Platform apps

VirtualAlloc is VirtualAllocFromApp when targeting UWP, and you can
only allocate executable pages if you have the codeGeneration
capability set in the app manifest. Check for that capability in
_orc_compiler_init() and switch to backup code or emulation if it
isn't available instead of crashing when VirtualAllocFromApp
returns NULL.

Also you cannot allocate pages that are both READWRITE and EXECUTE, so
we allocate as read-write first, then set the memory as execute-only
after the code has been compiled and copied over.

Part-of: <https://gitlab.freedesktop.org/gstreamer/orc/-/merge_requests/42>
meson.build
orc/orccodemem.c
orc/orccompiler.c