[ruby/prism] Only define xallocator when not defined

https://github.com/ruby/prism/commit/919d682379
This commit is contained in:
Kevin Newton 2024-03-04 11:49:09 -05:00 коммит произвёл git
Родитель 6ad0f89d5a
Коммит f7adee34a3
1 изменённых файлов: 28 добавлений и 20 удалений

Просмотреть файл

@ -145,29 +145,37 @@
#ifdef PRISM_XALLOCATOR
#include "prism_xallocator.h"
#else
/**
* The malloc function that should be used. This can be overriden with the
* PRISM_XALLOCATOR define.
*/
#define xmalloc malloc
#ifndef xmalloc
/**
* The malloc function that should be used. This can be overriden with
* the PRISM_XALLOCATOR define.
*/
#define xmalloc malloc
#endif
/**
* The realloc function that should be used. This can be overriden with the
* PRISM_XALLOCATOR define.
*/
#define xrealloc realloc
#ifndef xrealloc
/**
* The realloc function that should be used. This can be overriden with
* the PRISM_XALLOCATOR define.
*/
#define xrealloc realloc
#endif
/**
* The calloc function that should be used. This can be overriden with the
* PRISM_XALLOCATOR define.
*/
#define xcalloc calloc
#ifndef xcalloc
/**
* The calloc function that should be used. This can be overriden with
* the PRISM_XALLOCATOR define.
*/
#define xcalloc calloc
#endif
/**
* The free function that should be used. This can be overriden with the
* PRISM_XALLOCATOR define.
*/
#define xfree free
#ifndef xfree
/**
* The free function that should be used. This can be overriden with the
* PRISM_XALLOCATOR define.
*/
#define xfree free
#endif
#endif
#endif