<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/132300>132300</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [libc] implement memalignment
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            good first issue,
            libc
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          michaelrj-google
      </td>
    </tr>
</table>

<pre>
    Described in C23 (page 374): https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf#page=387

`memalignment` takes a `void*`and returns its alignment.

Here's a checklist for what you'll need to do for this:
- [ ] Add the implementation of `memalignment` in [`/src/stdlib`](https://github.com/llvm/llvm-project/tree/main/libc/src/stdlib)
- [ ] Add tests for `memalignment` in [`/test/src/stdlib`](https://github.com/llvm/llvm-project/tree/main/libc/test/src/stdlib)
- [ ] Add `memalignment` to [`entrypoints.txt`](https://github.com/llvm/llvm-project/blob/main/libc/config/linux/x86_64/entrypoints.txt) for at least x86_64 and whatever you're building on
- [ ] Add `memalignment` to [`include/stdlib.yaml`](https://github.com/llvm/llvm-project/blob/main/libc/include/stdlib.yaml)

Comment if you're interested in working on this, and feel free to reach out if you need help. 
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0VN2OozgTfZriptTIlCEJF1xkOkLfW3wyuAB3GzuyTaf77VcmPdO7M5FWs9qVoiBw_ZxzqnxUjGZ2zB0036C5FGpLiw_dasZFsQ0vT7P3s-Vi8Pqju3AcgxlYo3H4TBKBTlc1M8pjDdSCPOOS0jWCPAP1QP3tdiv9ld1TTLr0YQbqX9JYAfVxJMoBc1Xf44B67ccI1DtJJMqrnoBkrg7yIk9HEOf8O4iVV2XN7FZ2CQ4Ck3rliArhIN680UA5SDmNgdMWXESTIv7IKO91_seBgY45b1x4fLUmJpx8wNuiEn74DehoLTpmjcmj9vthWszOTZyfEJpvCM0Fz1pjWhjNerWcO6hkvEM_4QOsxuU8OIisQBjzf9LWDPlLcwE6_VW-2aRlG8rRr0C9tW_fH0_X4F94TEB9CsxA_aqMy4dmGH8uTe2veDmmuDP6G4w58L-F-qjDA8SP5u4_cbJL4ePqjUuxTO_pnwMcrB9-ATh6N5l5f3fbO1D_fjr8_5CX9ue-1O6SqoSWVUx4D8S8inmr-I3D52YFxmEzVhs3o3e_Rda40W6af4hVfqjV_suUH_fYpwLi_OzXjArN9MXGuMSBY7o7w82H1zu1-42h512EidniFJgzm8BqXNBv3-vcr9rC9lpioTupW9mqgrvqWFNTEbXHYunqWtUnoaeWJ1XLejpIUbVTO7SnY6NPigvTkaBGSBIkq0oeS6mqg5CT0kMjFekBasGrMrbMOmRHKkyMG3eVJClEYdXANu5eSDR7r3EyISbcgyA71jMQ3WWibJeh2wUdtjlCLbKLxK_SySS7G-ue0Fy-PAL_PN9iC7b77cntkLJdfkJ_6-iPAAAA___Ly9iW">