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;
+ int final_size = size*nmemb;
HANDLE_BLOCK_INTERRUPTIONS();
p = _emalloc(final_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
HANDLE_UNBLOCK_INTERRUPTIONS();
return (void *) p;
}
- memset(p,(int)NULL, final_size);
+ memset(p, 0, final_size);
HANDLE_UNBLOCK_INTERRUPTIONS();
return p;
}
return (char *)NULL;
}
HANDLE_UNBLOCK_INTERRUPTIONS();
- memcpy(p,s,length);
+ memcpy(p, s, length);
return p;
}
return (char *)NULL;
}
HANDLE_UNBLOCK_INTERRUPTIONS();
- memcpy(p,s,length);
- p[length]=0;
+ memcpy(p, s, length);
+ p[length] = 0;
return p;
}
return (char *)NULL;
}
if (length) {
- memcpy(p,s,length);
+ memcpy(p, s, length);
}
- p[length]=0;
+ p[length] = 0;
return p;
}
AG(phead) = AG(head) = NULL;
#if MEMORY_LIMIT
- AG(memory_limit)=1<<30; /* rediculous limit, effectively no limit */
- AG(allocated_memory)=0;
- AG(memory_exhausted)=0;
+ AG(memory_limit) = 1<<30; /* rediculous limit, effectively no limit */
+ AG(allocated_memory) = 0;
+ AG(memory_exhausted) = 0;
#endif
memset(AG(fast_cache_list_head), 0, sizeof(AG(fast_cache_list_head)));
zend_mem_header *p, *t;
unsigned int fci, i, j;
#if ZEND_DEBUG
- int had_leaks=0;
+ int had_leaks = 0;
#endif
zend_fast_cache_list_entry *fast_cache_list_entry, *next_fast_cache_list_entry;
ALS_FETCH();
AG(fast_cache_list_head)[fci] = NULL;
}
- p=AG(head);
- t=AG(head);
+ p = AG(head);
+ t = AG(head);
while (t) {
if (!t->cached) {
#if ZEND_DEBUG
zend_mem_header *iterator;
int total_leak=0, total_leak_count=0;
- had_leaks=1;
+ had_leaks = 1;
if (!silent) {
zend_message_dispatcher(ZMSG_MEMORY_LEAK_DETECTED, t);
}
int had_problems=0;
if (silent==2) {
- silent=1;
- no_cache_notice=1;
+ silent = 1;
+ no_cache_notice = 1;
}
if (silent==3) {
- silent=0;
- no_cache_notice=1;
+ silent = 0;
+ no_cache_notice = 1;
}
if (!silent) {
zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL);
case MEM_BLOCK_FREED_MAGIC:
if (!silent) {
zend_debug_alloc_output("Freed\n");
- had_problems=1;
+ had_problems = 1;
} else {
return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
if (!silent) {
if (!no_cache_notice) {
zend_debug_alloc_output("Cached (allocated on %s:%d, %d bytes)\n", p->filename, p->lineno, p->size);
- had_problems=1;
+ had_problems = 1;
}
} else {
if (!no_cache_notice) {
} else {
return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
- had_problems=1;
- valid_beginning=0;
+ had_problems = 1;
+ valid_beginning = 0;
break;
}
if (silent) {
return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
- had_problems=1;
+ had_problems = 1;
overflow_ptr = ((char *) p)+sizeof(zend_mem_header)+REAL_SIZE(p->size)+PLATFORM_PADDING;
for (i=0; i<sizeof(long); i++) {
if (had_problems) {
int foo = 5;
- foo+=1;
+ foo += 1;
}
if (!silent) {