com php-src: sync libmbfl allocator with the size_t changes : ext/mbstring/libmbfl/mbfl/mbfl_allocators.c ext/mbs tring/libmbfl/mbfl/mbfl_allocators.h
ext/mbstring/mbstrin g.c
| From: | Anatol Belski | Date: | Sat, 22 Jul 2017 21:53:00 +0000 |
| Subject: | com php-src: sync libmbfl allocator with the size_t changes : ext/mbstring/libmbfl/mbfl/mbfl_allocators.c ext/mbs tring/libmbfl/mbfl/mbfl_allocators.h ext/mbstring/mbstrin g.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-98723@lists.php.net to get a copy of this message | ||
Commit: 61784bcb718b924acaad084a8ac2ed273e57f8fa
Author: Anatol Belski <ab@php.net> Sat, 22 Jul 2017 23:53:00 +0200
Parents: e0825ec60fc4e4aa3f026c832c26be51b23b4f09
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=61784bcb718b924acaad084a8ac2ed273e57f8fa
Log:
sync libmbfl allocator with the size_t changes
Changed paths:
M ext/mbstring/libmbfl/mbfl/mbfl_allocators.c
M ext/mbstring/libmbfl/mbfl/mbfl_allocators.h
M ext/mbstring/mbstring.c
Diff:
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_allocators.c
b/ext/mbstring/libmbfl/mbfl/mbfl_allocators.c
index f52c94c..aa468da 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_allocators.c
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_allocators.c
@@ -54,9 +54,9 @@
#include "mbfl_allocators.h"
-static void *__mbfl__malloc(unsigned int);
-static void *__mbfl__realloc(void *, unsigned int);
-static void *__mbfl__calloc(unsigned int, unsigned int);
+static void *__mbfl__malloc(size_t);
+static void *__mbfl__realloc(void *, size_t);
+static void *__mbfl__calloc(size_t, size_t);
static void __mbfl__free(void *);
static mbfl_allocators default_allocators = {
@@ -71,17 +71,17 @@ static mbfl_allocators default_allocators = {
mbfl_allocators *__mbfl_allocators = &default_allocators;
-static void *__mbfl__malloc(unsigned int sz)
+static void *__mbfl__malloc(size_t sz)
{
return malloc(sz);
}
-static void *__mbfl__realloc(void *ptr, unsigned int sz)
+static void *__mbfl__realloc(void *ptr, size_t sz)
{
return realloc(ptr, sz);
}
-static void *__mbfl__calloc(unsigned int nelems, unsigned int szelem)
+static void *__mbfl__calloc(size_t nelems, size_t szelem)
{
return calloc(nelems, szelem);
}
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_allocators.h
b/ext/mbstring/libmbfl/mbfl/mbfl_allocators.h
index b2981c6..38a3f81 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_allocators.h
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_allocators.h
@@ -34,12 +34,12 @@
#include "mbfl_defs.h"
typedef struct _mbfl_allocators {
- void *(*malloc)(unsigned int);
- void *(*realloc)(void *, unsigned int);
- void *(*calloc)(unsigned int, unsigned int);
+ void *(*malloc)(size_t);
+ void *(*realloc)(void *, size_t);
+ void *(*calloc)(size_t, size_t);
void (*free)(void *);
- void *(*pmalloc)(unsigned int);
- void *(*prealloc)(void *, unsigned int);
+ void *(*pmalloc)(size_t);
+ void *(*prealloc)(void *, size_t);
void (*pfree)(void *);
} mbfl_allocators;
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index afc6870..41cfb25 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -654,17 +654,17 @@ static char *get_output_encoding(void) {
/* {{{ allocators */
-static void *_php_mb_allocators_malloc(unsigned int sz)
+static void *_php_mb_allocators_malloc(size_t sz)
{
return emalloc(sz);
}
-static void *_php_mb_allocators_realloc(void *ptr, unsigned int sz)
+static void *_php_mb_allocators_realloc(void *ptr, size_t sz)
{
return erealloc(ptr, sz);
}
-static void *_php_mb_allocators_calloc(unsigned int nelems, unsigned int szelem)
+static void *_php_mb_allocators_calloc(size_t nelems, size_t szelem)
{
return ecalloc(nelems, szelem);
}
@@ -674,12 +674,12 @@ static void _php_mb_allocators_free(void *ptr)
efree(ptr);
}
-static void *_php_mb_allocators_pmalloc(unsigned int sz)
+static void *_php_mb_allocators_pmalloc(size_t sz)
{
return pemalloc(sz, 1);
}
-static void *_php_mb_allocators_prealloc(void *ptr, unsigned int sz)
+static void *_php_mb_allocators_prealloc(void *ptr, size_t sz)
{
return perealloc(ptr, sz, 1);
}