Configurable memory allocation functions.