Prevent malloc function wrapping

2019-09-22 01:25发布

问题:

How can we prevent wrapping the malloc by the gcc by some function in C programs?

I would like to use any other function to allocate memory (not calloc, realloc, etc.) to prevent wrapping malloc in tests of the program in which only these function are wrapped to take a lot of time.

My expectation is to see some useful example of any good way of allocating memory in C programs without using the malloc and similiar functions.

I have read something about mmap function but could't find any good example of it's usage instead of malloc.

There are speed tests in which malloc is called by wrapped function which is written to take more time and allocate memory. So every time when I call malloc in my pogram it is called but it takes more time so the tests can detect very often usage of malloc. The problem is that I use linked lists so the memory is allocated separately for every node of the list. I don't know how to change this implementation because it is really comfortable to use linked lists in my structure.