Sanitized memory allocation scheme.