# AllocPP.pl -> The Missing Part of the C Preprocessor
This is a Perl script I have written for use in my projects, including [FunctionalGCC](https://github.com/Chubek/FunctionalGCC) and [Caraml](https://github.com/Chubek/Caraml).
Basically, what AllocPP.pl does is, it scans a C source code for the following directive
```c
#alloc , , ,
```
And it creates a linked list by that name, which has a size and a pointer member, and with it, you can allocate and reallocate values as your heart desires. And when you are done, you can dump that heap (as in, the linked list).
All the allocations and reallocations are safe. If a NULL pointer is returned, the program errors out. If you, by mistake, pass a smaller size to realloc function than the size it already is, it will warn you during runtime (but it won't exit).
The Perl script has POD documentation. You can use tools like pod2man to generat ea man file for example.
The script also has a shebang.
If no input file (the -i flag) is given, it will use stdin. If no output file (the -o) flag is given, it will use stdout.
Please read the POD for more info.
Notice that there's another directive which is mandatory. That is the `#hashfunc` directive.
```c
#hashfunc