How to manage memory alignments and generic pointer arithmetics in a portable way in C?

后端 未结 6 479
暖寄归人
暖寄归人 2021-01-13 11:22

I have to implement an optimized version of malloc/realloc/free (tailored for my particular application). At the moment the code runs on a particular platform, but I would l

6条回答
  •  情话喂你
    2021-01-13 11:33

    If you have a look at #pragma pack, this may help you as it allows you to define structure packing and is implemented on most compilers.

提交回复
热议问题