Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions ext/gmp/gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,21 @@ static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned ch
}
/* }}} */

static void *gmp_alloc(size_t size)
{
return emalloc(size);
}

static void *gmp_realloc(void *ptr, size_t old_size, size_t new_size)
{
return erealloc(ptr, new_size);
}

static void gmp_free(void *ptr, size_t size)
{
efree(ptr);
}

/* {{{ ZEND_GINIT_FUNCTION */
static ZEND_GINIT_FUNCTION(gmp)
{
Expand Down Expand Up @@ -551,6 +566,8 @@ ZEND_MINIT_FUNCTION(gmp)

register_gmp_symbols(module_number);

mp_set_memory_functions(gmp_alloc, gmp_realloc, gmp_free);

return SUCCESS;
}
/* }}} */
Expand Down