diff options
author | Sebastian Bergmann <sebastian@php.net> | 2002-04-28 06:24:15 +0000 |
---|---|---|
committer | Sebastian Bergmann <sebastian@php.net> | 2002-04-28 06:24:15 +0000 |
commit | 8463225b494ebf0d82cdfea69df386699bbdd2df (patch) | |
tree | e402da97aaee6851ad738514bffd5f7a9b5465f5 /Zend/zend_alloc.c | |
parent | 305260ce4a2c03dc0a0c58f56f2bd1d0a5809cca (diff) | |
download | php-git-8463225b494ebf0d82cdfea69df386699bbdd2df.tar.gz |
Revert.
Diffstat (limited to 'Zend/zend_alloc.c')
-rw-r--r-- | Zend/zend_alloc.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 81ac7eafa1..b24e31c2a1 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -248,6 +248,23 @@ ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) } +ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) +{ + void *p; + int final_size = size*nmemb; + + HANDLE_BLOCK_INTERRUPTIONS(); + p = _emalloc(final_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); + if (!p) { + HANDLE_UNBLOCK_INTERRUPTIONS(); + return (void *) p; + } + memset(p, 0, final_size); + HANDLE_UNBLOCK_INTERRUPTIONS(); + return p; +} + + ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) { zend_mem_header *p; |