herumi / xbyak

A JIT assembler for x86/x64 architectures supporting MMX, SSE (1-4), AVX (1-2, 512), FPU, APX, and AVX10.2
BSD 3-Clause "New" or "Revised" License
2.05k stars 278 forks source link

Name mmap pages on Linux with memfd_create #121

Closed captain5050 closed 3 years ago

captain5050 commented 3 years ago

It can be useful in profilers if the pages used for JIT execution are named to label the source. To do this the memfd_create syscall is used.

Before (from /proc/self/maps): 7ffff7ffb000-7ffff7ffc000 rw-p 00000000 00:00 0 After: 7ffff7ffb000-7ffff7ffc000 rw-s 00000000 00:01 63584 /memfd:xbyak (deleted)

herumi commented 3 years ago

Thank for the patch. I fixed some points. https://github.com/herumi/xbyak/compare/2fb843c...0ad9b9b

herumi commented 3 years ago

I changed the macro name to XBYAK_USE_MEMFD.

captain5050 commented 3 years ago

Cool, thanks!