How to modify the malloc behavior in glibc and test if it works as expected?
问题 I want to use malloc to allocate memory, but I don't want to use a dynamic allocation way in malloc. Instead, I want to use malloc to allocate a large block/pool so that I can "new" some variables/objects into this large memory block/pool. Therefore, I would like to modify the malloc source code (e.g., malloc/malloc.c ) in glibc to make it work for my scenario. What is the most convenient and efficient way to modify glibc source codes and also test its functionality? One way that comes to my