+3.0.19: 2008-05-14
+- Move expunge callback groundwork to 3.1 (Rasmus)
+- Fix fd-leak (Gopal)
+- Fix double-free on builtin functions (Gopal)
+- Initial PHP 5.3 support (Gopal)
+
3.0.18: 2008-03-28
- Revert memleak patch (Gopal)
- Fix for bug #13504 (David Fraser)
- Fix apc_add() cache expunge bug (Rasmus)
- Added parameter to apc_fetch to determine success/failure when fetching booleans (shire)
- Fix misc. memleaks (shire)
-
+
3.0.16: 2007-12-26
- Fix for longstanding cache-full crash (Christian Seiler)
http://news.php.net/php.pecl.dev/4951 for the details
--------------------------------------------------------------------
The PHP License, version 3.01
-Copyright (c) 1999 - 2006 The PHP Group. All rights reserved.
+Copyright (c) 1999 - 2008 The PHP Group. All rights reserved.
--------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc.c,v 3.18.2.1 2008/03/25 18:04:53 gopalv Exp $ */
+/* $Id: apc.c,v 3.18.2.3 2008/05/13 15:48:48 gopalv Exp $ */
#include "apc.h"
#include <regex.h> /* for POSIX regular expressions */
/* similar to php_stream_stat_path */
#ifdef ZEND_ENGINE_2
#define APC_URL_STAT(wrapper, filename, pstatbuf) \
- ((wrapper)->wops->url_stat((wrapper), (filename), 0, (pstatbuf), NULL TSRMLS_CC))
+ ((wrapper)->wops->url_stat((wrapper), (filename), PHP_STREAM_URL_STAT_QUIET, (pstatbuf), NULL TSRMLS_CC))
#else
#define APC_URL_STAT(wrapper, filename, pstatbuf) \
((wrapper)->wops->url_stat((wrapper), (filename), (pstatbuf) TSRMLS_CC))
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc.h,v 3.14.2.1 2008/03/25 18:04:53 gopalv Exp $ */
+/* $Id: apc.h,v 3.14.2.2 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_H
#define APC_H
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-$VERSION='$Id: apc.php,v 3.68.2.1 2008/03/25 18:04:53 gopalv Exp $';
+$VERSION='$Id: apc.php,v 3.68.2.2 2008/05/11 18:57:00 rasmus Exp $';
////////// READ OPTIONAL CONFIGURATION FILE ////////////
if (file_exists("apc.conf.php")) include("apc.conf.php");
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_cache.c,v 3.145.2.2 2008/03/25 18:24:57 gopalv Exp $ */
+/* $Id: apc_cache.c,v 3.145.2.4 2008/05/11 18:57:00 rasmus Exp $ */
#include "apc_cache.h"
#include "apc_lock.h"
#define key_equals(a, b) (a.inode==b.inode && a.device==b.device)
/* }}} */
-static void apc_cache_expunge(apc_cache_t* cache, size_t size);
-
/* {{{ hash */
static unsigned int hash(apc_cache_key_t key)
{
for (i = 0; i < num_slots; i++) {
cache->slots[i] = NULL;
}
- cache->expunge_cb = apc_cache_expunge;
return cache;
}
/* }}} */
/* {{{ apc_cache_expunge */
-static void apc_cache_expunge(apc_cache_t* cache, size_t size)
+void apc_cache_expunge(apc_cache_t* cache, time_t t)
{
int i;
- time_t t;
- TSRMLS_FETCH();
-
-#if PHP_API_VERSION < 20041225
-#if HAVE_APACHE && defined(APC_PHP4_STAT)
- t = ((request_rec *)SG(server_context))->request_time;
-#else
- t = time(0);
-#endif
-#else
- t = sapi_get_request_time(TSRMLS_C);
-#endif
if(!cache) return;
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_cache.h,v 3.46.2.2 2008/03/25 18:24:57 gopalv Exp $ */
+/* $Id: apc_cache.h,v 3.46.2.4 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_CACHE_H
#define APC_CACHE_H
};
/* }}} */
-typedef void (*apc_expunge_cb_t)(T cache, size_t n);
-
/* {{{ struct definition: apc_cache_t */
struct apc_cache_t {
void* shmaddr; /* process (local) address of shared cache */
int num_slots; /* number of slots in cache */
int gc_ttl; /* maximum time on GC list for a slot */
int ttl; /* if slot is needed and entry's access time is older than this ttl, remove it */
- apc_expunge_cb_t expunge_cb; /* cache specific expunge callback to free up sma memory */
};
/* }}} */
extern apc_cache_info_t* apc_cache_info(T cache, zend_bool limited);
extern void apc_cache_free_info(apc_cache_info_t* info);
+extern void apc_cache_expunge(apc_cache_t* cache, time_t t);
extern void apc_cache_unlock(apc_cache_t* cache);
extern zend_bool apc_cache_busy(apc_cache_t* cache);
extern zend_bool apc_cache_write_lock(apc_cache_t* cache);
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_compile.c,v 3.87.2.4 2008/03/28 21:05:14 rasmus Exp $ */
+/* $Id: apc_compile.c,v 3.87.2.8 2008/05/11 18:57:00 rasmus Exp $ */
#include "apc_compile.h"
#include "apc_globals.h"
static znode* my_copy_znode(znode*, znode*, apc_malloc_t, apc_free_t);
static zend_op* my_copy_zend_op(zend_op*, zend_op*, apc_malloc_t, apc_free_t);
static zend_function* my_copy_function(zend_function*, zend_function*, apc_malloc_t, apc_free_t);
-static zend_function_entry* my_copy_function_entry(zend_function_entry*, zend_function_entry*, apc_malloc_t, apc_free_t);
+static zend_function_entry* my_copy_function_entry(zend_function_entry*, const zend_function_entry*, apc_malloc_t, apc_free_t);
static zend_class_entry* my_copy_class_entry(zend_class_entry*, zend_class_entry*, apc_malloc_t, apc_free_t);
static HashTable* my_copy_hashtable_ex(HashTable*, HashTable*, ht_copy_fun_t, ht_free_fun_t, int, apc_malloc_t, apc_free_t, ht_check_copy_fun_t, ...);
#define my_copy_hashtable( dst, src, copy_fn, free_fn, holds_ptr, allocate, deallocate) \
static HashTable* my_copy_static_variables(zend_op_array* src, apc_malloc_t allocate, apc_free_t deallocate);
#ifdef ZEND_ENGINE_2
static zend_property_info* my_copy_property_info(zend_property_info* dst, zend_property_info* src, apc_malloc_t allocate, apc_free_t deallocate);
-static zend_arg_info* my_copy_arg_info_array(zend_arg_info*, zend_arg_info*, uint, apc_malloc_t, apc_free_t);
-static zend_arg_info* my_copy_arg_info(zend_arg_info*, zend_arg_info*, apc_malloc_t, apc_free_t);
+static zend_arg_info* my_copy_arg_info_array(zend_arg_info*, const zend_arg_info*, uint, apc_malloc_t, apc_free_t);
+static zend_arg_info* my_copy_arg_info(zend_arg_info*, const zend_arg_info*, apc_malloc_t, apc_free_t);
#endif
/*
* The "destroy" functions free the memory associated with a particular data
local_dst_alloc = 1;
}
+#ifdef ZEND_ENGINE_2_3
+ if(!(dst[0] = (zval*) allocate(sizeof(zval_gc_info)))) {
+ if(local_dst_alloc) deallocate(dst);
+ return NULL;
+ }
+
+ if(allocate == apc_php_malloc) {
+ GC_ZVAL_INIT(dst[0]);
+ }
+#else
if(!(dst[0] = (zval*) allocate(sizeof(zval)))) {
if(local_dst_alloc) deallocate(dst);
return NULL;
}
+#endif
if(!(dst_new = my_copy_zval(*dst, *src, allocate, deallocate))) {
if(local_dst_alloc) deallocate(dst);
return NULL;
*dst = dst_new;
}
- Z_SET_REFCOUNT_PP(dst, Z_REFCOUNT_PP(src));
- Z_SET_ISREF_TO_PP(dst, Z_ISREF_PP(src));
+ Z_SET_REFCOUNT_PP(dst, Z_REFCOUNT_PP((zval**)src));
+ Z_SET_ISREF_TO_PP(dst, Z_ISREF_PP((zval**)src));
return dst;
}
/* }}} */
/* {{{ my_copy_function_entry */
-static zend_function_entry* my_copy_function_entry(zend_function_entry* dst, zend_function_entry* src, apc_malloc_t allocate, apc_free_t deallocate)
+static zend_function_entry* my_copy_function_entry(zend_function_entry* dst, const zend_function_entry* src, apc_malloc_t allocate, apc_free_t deallocate)
{
int local_dst_alloc = 0;
assert(src != NULL);
return dst;
cleanup:
- if(dst->fname) deallocate(dst->fname);
+ if(dst->fname) deallocate((char*)dst->fname);
if(local_dst_alloc) deallocate(dst);
return NULL;
}
/* }}} */
/* {{{ my_copy_arg_info_array */
-static zend_arg_info* my_copy_arg_info_array(zend_arg_info* dst, zend_arg_info* src, uint num_args, apc_malloc_t allocate, apc_free_t deallocate)
+static zend_arg_info* my_copy_arg_info_array(zend_arg_info* dst, const zend_arg_info* src, uint num_args, apc_malloc_t allocate, apc_free_t deallocate)
{
int local_dst_alloc = 0;
int i = 0;
/* }}} */
/* {{{ my_copy_arg_info */
-static zend_arg_info* my_copy_arg_info(zend_arg_info* dst, zend_arg_info* src, apc_malloc_t allocate, apc_free_t deallocate)
+static zend_arg_info* my_copy_arg_info(zend_arg_info* dst, const zend_arg_info* src, apc_malloc_t allocate, apc_free_t deallocate)
{
int local_dst_alloc = 0;
return dst;
cleanup:
- if(dst->name) deallocate(dst->name);
- if(dst->class_name) deallocate(dst->name);
+ if(dst->name) deallocate((char*)dst->name);
+ if(dst->class_name) deallocate((char*)dst->class_name);
if(local_dst_alloc) deallocate(dst);
return NULL;
}
for (i = 0; i < n; i++) {
- if(!my_copy_function_entry(&dst->builtin_functions[i],
+ if(!my_copy_function_entry((zend_function_entry*)(&dst->builtin_functions[i]),
&src->builtin_functions[i],
allocate, deallocate)) {
int ii;
- for(ii=i-1; i>=0; i--) my_destroy_function_entry(&dst->builtin_functions[ii], deallocate);
+ for(ii=i-1; ii>=0; ii--) my_destroy_function_entry((zend_function_entry*)(&dst->builtin_functions[ii]), deallocate);
goto cleanup;
}
}
if(dst->refcount) deallocate(dst->refcount);
#endif
- if(dst->builtin_functions) deallocate(dst->builtin_functions);
+ if(dst->builtin_functions) deallocate((zend_function_entry*)dst->builtin_functions);
if(dst->function_table.arBuckets) my_destroy_hashtable(&dst->function_table, (ht_free_fun_t) my_free_function, deallocate);
if(dst->default_properties.arBuckets) my_destroy_hashtable(&dst->default_properties, (ht_free_fun_t) my_free_zval_ptr, deallocate);
assert(src != NULL);
if (!dst) {
+#ifdef ZEND_ENGINE_2_3
+ CHECK(dst = (zval*) allocate(sizeof(zval_gc_info)));
+
+ if(allocate == apc_php_malloc) {
+ GC_ZVAL_INIT(dst);
+ }
+#else
CHECK(dst = (zval*) allocate(sizeof(zval)));
+#endif
local_dst_alloc = 1;
}
{
assert(src != NULL);
- deallocate(src->fname);
+ deallocate((char*)src->fname);
#ifdef ZEND_ENGINE_2
if (src->arg_info) {
- my_free_arg_info_array(src->arg_info, src->num_args, deallocate);
+ my_free_arg_info_array((zend_arg_info*)src->arg_info, src->num_args, deallocate);
}
#else
if (src->func_arg_types) {
{
assert(src != NULL);
- deallocate(src->name);
- deallocate(src->class_name);
+ deallocate((char*)src->name);
+ deallocate((char*)src->class_name);
}
/* }}} */
#endif
if (src->builtin_functions) {
for (i = 0; src->builtin_functions[i].fname != NULL; i++) {
- my_destroy_function_entry(&src->builtin_functions[i], deallocate);
+ my_destroy_function_entry((zend_function_entry*)(&src->builtin_functions[i]), deallocate);
}
- deallocate(src->builtin_functions);
+ deallocate((zend_function_entry*)src->builtin_functions);
}
}
/* }}} */
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_compile.h,v 3.19 2007/03/08 22:03:35 gopalv Exp $ */
+/* $Id: apc_compile.h,v 3.19.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_COMPILE_H
#define APC_COMPILE_H
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
All other licensing and usage conditions are those of the PHP Group.
*/
-/* $Id: apc_debug.c,v 3.6 2006/12/07 23:51:28 gopalv Exp $ */
+/* $Id: apc_debug.c,v 3.6.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#include "apc.h"
#include <stdio.h>
#include "zend_compile.h"
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_fcntl.c,v 3.25 2006/06/19 02:52:49 rasmus Exp $ */
+/* $Id: apc_fcntl.c,v 3.25.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#include "apc_fcntl.h"
#include "apc.h"
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_fcntl.h,v 3.14 2006/05/31 22:24:48 rasmus Exp $ */
+/* $Id: apc_fcntl.h,v 3.14.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_FCNTL_H
#define APC_FCNTL_H
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_fcntl_win32.c,v 3.6 2006/03/12 00:31:45 rasmus Exp $ */
+/* $Id: apc_fcntl_win32.c,v 3.6.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#include "apc_fcntl.h"
#include "apc.h"
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_futex.c,v 3.2 2006/10/12 08:23:16 shire Exp $ */
+/* $Id: apc_futex.c,v 3.2.2.1 2008/05/11 18:57:00 rasmus Exp $ */
/***************************************************************************
* Futex (Fast Userspace Mutex) support for APC
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_futex.h,v 3.2 2006/10/12 08:23:16 shire Exp $ */
+/* $Id: apc_futex.h,v 3.2.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_FUTEX_H
#define APC_FUTEX_H
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_globals.h,v 3.70.2.5 2008/03/28 19:41:23 rasmus Exp $ */
+/* $Id: apc_globals.h,v 3.70.2.8 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_GLOBALS_H
#define APC_GLOBALS_H
-#define APC_VERSION "3.0.18"
+#define APC_VERSION "3.0.19"
#include "apc_cache.h"
#include "apc_stack.h"
zval *filehits; /* Files that came from the cache for this request */
#endif
zend_bool coredump_unmap; /* Trap signals that coredump and unmap shared memory */
- apc_cache_t *current_cache; /* current cache being modified/read */
ZEND_END_MODULE_GLOBALS(apc)
/* (the following declaration is defined in php_apc.c) */
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_lock.h,v 3.20 2007/01/29 07:39:02 shire Exp $ */
+/* $Id: apc_lock.h,v 3.20.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_LOCK
#define APC_LOCK
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_main.c,v 3.103.2.2 2008/03/28 18:35:40 gopalv Exp $ */
+/* $Id: apc_main.c,v 3.103.2.7 2008/05/11 18:57:00 rasmus Exp $ */
#include "apc_php.h"
#include "apc_main.h"
apc_cache_release(apc_cache, cache_entry);
/* cannot free up cache data yet, it maybe in use */
-
+
+ zend_llist_del_element(&CG(open_files), h, compare_file_handles); /* We leak fds without this hack */
+
h->type = ZEND_HANDLE_FILENAME;
return NULL;
if (cache_entry != NULL) {
int dummy = 1;
- int reset_opened_path = 0;
if (h->opened_path == NULL) {
- h->opened_path = cache_entry->data.file.filename;
- reset_opened_path = 1;
+ h->opened_path = estrdup(cache_entry->data.file.filename);
}
zend_hash_add(&EG(included_files), h->opened_path, strlen(h->opened_path)+1, (void *)&dummy, sizeof(int), NULL);
+
+ zend_llist_add_element(&CG(open_files), h); /* We leak fds without this hack */
+
apc_stack_push(APCG(cache_stack), cache_entry);
op_array = cached_compile(h, type TSRMLS_CC);
if(op_array) {
if(APCG(report_autofilter)) {
apc_wprint("Recompiling %s", h->opened_path);
}
- if (reset_opened_path == 1) {
- h->opened_path = NULL;
- }
/* TODO: check what happens with EG(included_files) */
}
mem_size = 0;
APCG(mem_size_ptr) = &mem_size;
- APCG(current_cache) = apc_cache;
if(!(alloc_op_array = apc_copy_op_array(NULL, op_array, apc_sma_malloc, apc_sma_free TSRMLS_CC))) {
+ apc_cache_expunge(apc_cache,t);
+ apc_cache_expunge(apc_user_cache,t);
APCG(mem_size_ptr) = NULL;
- APCG(current_cache) = NULL;
#if NONBLOCKING_LOCK_AVAILABLE
if(APCG(write_lock)) {
apc_cache_write_unlock(apc_cache);
if(!(alloc_functions = apc_copy_new_functions(num_functions, apc_sma_malloc, apc_sma_free TSRMLS_CC))) {
apc_free_op_array(alloc_op_array, apc_sma_free);
+ apc_cache_expunge(apc_cache,t);
+ apc_cache_expunge(apc_user_cache,t);
APCG(mem_size_ptr) = NULL;
- APCG(current_cache) = NULL;
#if NONBLOCKING_LOCK_AVAILABLE
if(APCG(write_lock)) {
apc_cache_write_unlock(apc_cache);
if(!(alloc_classes = apc_copy_new_classes(op_array, num_classes, apc_sma_malloc, apc_sma_free TSRMLS_CC))) {
apc_free_op_array(alloc_op_array, apc_sma_free);
apc_free_functions(alloc_functions, apc_sma_free);
+ apc_cache_expunge(apc_cache,t);
+ apc_cache_expunge(apc_user_cache,t);
APCG(mem_size_ptr) = NULL;
- APCG(current_cache) = NULL;
#if NONBLOCKING_LOCK_AVAILABLE
if(APCG(write_lock)) {
apc_cache_write_unlock(apc_cache);
apc_free_op_array(alloc_op_array, apc_sma_free);
apc_free_functions(alloc_functions, apc_sma_free);
apc_free_classes(alloc_classes, apc_sma_free);
+ apc_cache_expunge(apc_cache,t);
+ apc_cache_expunge(apc_user_cache,t);
APCG(mem_size_ptr) = NULL;
- APCG(current_cache) = NULL;
#if NONBLOCKING_LOCK_AVAILABLE
if(APCG(write_lock)) {
apc_cache_write_unlock(apc_cache);
if ((ret = apc_cache_insert(apc_cache, key, cache_entry, t)) != 1) {
apc_cache_free_entry(cache_entry);
+ if(ret==-1) {
+ apc_cache_expunge(apc_cache,t);
+ apc_cache_expunge(apc_user_cache,t);
+ }
}
- APCG(current_cache) = NULL;
-
#if NONBLOCKING_LOCK_AVAILABLE
if(APCG(write_lock)) {
apc_cache_write_unlock(apc_cache);
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_main.h,v 3.9.2.1 2008/03/25 18:04:53 gopalv Exp $ */
+/* $Id: apc_main.h,v 3.9.2.2 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_MAIN_H
#define APC_MAIN_H
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_mmap.c,v 3.7.2.1 2008/03/25 21:00:22 rasmus Exp $ */
+/* $Id: apc_mmap.c,v 3.7.2.2 2008/05/11 18:57:00 rasmus Exp $ */
#include "apc.h"
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_php.h,v 3.10 2006/11/16 20:24:48 gopalv Exp $ */
+/* $Id: apc_php.h,v 3.10.2.2 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_PHP_H
#define APC_PHP_H
#include "zend_hash.h"
#include "zend_extensions.h"
+#if ZEND_MODULE_API_NO > 20060613
+#define ZEND_ENGINE_2_3
+#endif
#if ZEND_MODULE_API_NO > 20050922
#define ZEND_ENGINE_2_2
#endif
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_pthreadmutex.c,v 3.3 2007/12/21 01:36:51 shire Exp $ */
+/* $Id: apc_pthreadmutex.c,v 3.3.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#include "apc_pthreadmutex.h"
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_pthreadmutex.h,v 3.3 2007/01/28 07:53:57 shire Exp $ */
+/* $Id: apc_pthreadmutex.h,v 3.3.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_PTHREADMUTEX_H
#define APC_PTHREADMUTEX_H
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_rfc1867.c,v 3.12 2007/10/18 20:37:20 rasmus Exp $*/
+/* $Id: apc_rfc1867.c,v 3.12.2.1 2008/05/11 18:57:00 rasmus Exp $*/
#include "apc.h"
#include "apc_globals.h"
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_sem.c,v 3.16 2006/03/12 00:31:45 rasmus Exp $ */
+/* $Id: apc_sem.c,v 3.16.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#include "apc_sem.h"
#include "apc.h"
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_sem.h,v 3.6 2006/03/12 00:31:45 rasmus Exp $ */
+/* $Id: apc_sem.h,v 3.6.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_SEM_H
#define APC_SEM_H
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_shm.c,v 3.11.2.1 2008/03/25 21:00:22 rasmus Exp $ */
+/* $Id: apc_shm.c,v 3.11.2.2 2008/05/11 18:57:00 rasmus Exp $ */
#include "apc_shm.h"
#include "apc.h"
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_shm.h,v 3.8 2007/05/23 01:23:21 auroraeosrose Exp $ */
+/* $Id: apc_shm.h,v 3.8.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_SHM_H
#define APC_SHM_H
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
All other licensing and usage conditions are those of the PHP Group.
*/
- /* $Id: apc_signal.c,v 1.2.2.2 2008/03/25 18:24:57 gopalv Exp $ */
+ /* $Id: apc_signal.c,v 1.2.2.3 2008/05/11 18:57:00 rasmus Exp $ */
/* Allows apc to install signal handlers and maintain signalling
to already registered handlers. Registers all signals that
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_signal.h,v 1.1.2.1 2008/03/25 18:24:57 gopalv Exp $ */
+/* $Id: apc_signal.h,v 1.1.2.2 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_SIGNAL_H
#define APC_SIGNAL_H
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_sma.c,v 1.69.2.2 2008/03/28 20:17:47 rasmus Exp $ */
+/* $Id: apc_sma.c,v 1.69.2.4 2008/05/11 18:57:00 rasmus Exp $ */
#include "apc_sma.h"
#include "apc.h"
{
size_t off;
int i;
- size_t *orig_mem_size_ptr;
TSRMLS_FETCH();
assert(sma_initialized);
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_sma.h,v 1.18.2.1 2008/03/25 18:04:53 gopalv Exp $ */
+/* $Id: apc_sma.h,v 1.18.2.2 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_SMA_H
#define APC_SMA_H
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2007 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_spin.c,v 3.1 2007/01/29 07:39:02 shire Exp $ */
+/* $Id: apc_spin.c,v 3.1.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#include "apc_spin.h"
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2007 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_spin.h,v 3.1 2007/01/29 07:39:02 shire Exp $ */
+/* $Id: apc_spin.h,v 3.1.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_SPIN_H
#define APC_SPIN_H
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_stack.c,v 3.4 2006/03/12 00:31:45 rasmus Exp $ */
+/* $Id: apc_stack.c,v 3.4.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#include "apc_stack.h"
#include "apc.h"
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_stack.h,v 3.4 2006/03/12 00:31:45 rasmus Exp $ */
+/* $Id: apc_stack.h,v 3.4.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_STACK_H
#define APC_STACK_H
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_zend.c,v 3.14 2007/04/02 22:57:10 rasmus Exp $ */
+/* $Id: apc_zend.c,v 3.14.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#include "apc_zend.h"
#include "apc_globals.h"
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: apc_zend.h,v 3.8 2006/09/01 21:59:16 pollita Exp $ */
+/* $Id: apc_zend.h,v 3.8.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef APC_ZEND_H
#define APC_ZEND_H
+php5-apc (3.0.19-1) stable; urgency=low
+
+ * New PHP5 APC - version 3.0.19, using PHP5 5.2.0-8+etch11,
+ 20060613+lfs.
+
+ -- Dragan Dosen <ddosen@ffzg.hr> Tue, 2 Sep 2008 22:00:57 +0200
+
php5-apc (3.0.18-1) stable; urgency=low
* New PHP5 APC - version 3.0.18, using PHP5 5.2.0-8+etch10,
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2007 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: pgsql_s_lock.c,v 3.2 2007/02/25 05:19:11 shire Exp $ */
+/* $Id: pgsql_s_lock.c,v 3.2.2.1 2008/05/11 18:57:00 rasmus Exp $ */
/*-------------------------------------------------------------------------
*
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2007 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: pgsql_s_lock.h,v 3.3 2007/02/16 21:28:04 shire Exp $ */
+/* $Id: pgsql_s_lock.h,v 3.3.2.1 2008/05/11 18:57:00 rasmus Exp $ */
/*-------------------------------------------------------------------------
*
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: php_apc.c,v 3.154.2.2 2008/03/28 18:35:41 gopalv Exp $ */
+/* $Id: php_apc.c,v 3.154.2.5 2008/05/11 18:57:00 rasmus Exp $ */
#include "apc_zend.h"
#include "apc_cache.h"
#else
php_info_print_table_row(2, "Locking type", "File Locks");
#endif
- php_info_print_table_row(2, "Revision", "$Revision: 3.154.2.2 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 3.154.2.5 $");
php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__);
php_info_print_table_end();
DISPLAY_INI_ENTRIES();
HANDLE_BLOCK_INTERRUPTIONS();
APCG(mem_size_ptr) = &mem_size;
- APCG(current_cache) = apc_user_cache;
if (!(entry = apc_cache_make_user_entry(strkey, strkey_len + 1, val, ttl))) {
APCG(mem_size_ptr) = NULL;
- APCG(current_cache) = NULL;
+ apc_cache_expunge(apc_cache,t);
+ apc_cache_expunge(apc_user_cache,t);
HANDLE_UNBLOCK_INTERRUPTIONS();
return 0;
}
if (!apc_cache_make_user_key(&key, strkey, strkey_len + 1, t)) {
APCG(mem_size_ptr) = NULL;
- APCG(current_cache) = NULL;
apc_cache_free_entry(entry);
+ /* make_user_key doesn't allocate anything, so no expunge */
HANDLE_UNBLOCK_INTERRUPTIONS();
return 0;
}
if (!apc_cache_user_insert(apc_user_cache, key, entry, t, exclusive TSRMLS_CC)) {
apc_cache_free_entry(entry);
APCG(mem_size_ptr) = NULL;
- APCG(current_cache) = NULL;
+ /*
+ No expunge here - user_insert can fail for non-memory related reasons
+ The alloc-based expunge hook in 3.1 will do a better job here
+ (removing the expunge here also fixes bug #13336)
+ */
HANDLE_UNBLOCK_INTERRUPTIONS();
return 0;
}
APCG(mem_size_ptr) = NULL;
- APCG(current_cache) = NULL;
HANDLE_UNBLOCK_INTERRUPTIONS();
+----------------------------------------------------------------------+
| APC |
+----------------------------------------------------------------------+
- | Copyright (c) 2006 The PHP Group |
+ | Copyright (c) 2008 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
*/
-/* $Id: php_apc.h,v 3.14 2006/03/12 00:31:45 rasmus Exp $ */
+/* $Id: php_apc.h,v 3.14.2.1 2008/05/11 18:57:00 rasmus Exp $ */
#ifndef PHP_APC_H
#define PHP_APC_H
class foo { }
$foo = new foo;
-var_dump($foo);
+print_r($foo);
apc_store('foo',$foo);
unset($foo);
$bar = apc_fetch('foo');
-var_dump($bar);
+print_r($bar);
$bar->a = true;
-var_dump($bar);
+print_r($bar);
class bar extends foo
{
}
$baz = new baz;
-var_dump($baz);
+print_r($baz);
$baz->change();
-var_dump($baz);
+print_r($baz);
apc_store('baz', $baz);
unset($baz);
-var_dump(apc_fetch('baz'));
+print_r(apc_fetch('baz'));
?>
===DONE===
<?php exit(0); ?>
--EXPECTF--
-object(foo)#%d (0) {
-}
-object(foo)#%d (0) {
-}
-object(foo)#%d (1) {
- ["a"]=>
- bool(true)
-}
-object(baz)#%d (6) {
- ["pri:private"]=>
- string(3) "baz"
- ["pub"]=>
- string(3) "bar"
- ["pro:protected"]=>
- string(3) "bar"
- ["pri:private"]=>
- string(3) "bar"
- ["bar"]=>
- bool(true)
- ["baz"]=>
- bool(true)
-}
-object(baz)#%d (6) {
- ["pri:private"]=>
- string(3) "baz"
- ["pub"]=>
- string(3) "bar"
- ["pro:protected"]=>
- string(3) "bar"
- ["pri:private"]=>
- string(3) "mod"
- ["bar"]=>
- bool(true)
- ["baz"]=>
- bool(true)
-}
-object(baz)#%d (6) {
- ["pri:private"]=>
- string(3) "baz"
- ["pub"]=>
- string(3) "bar"
- ["pro:protected"]=>
- string(3) "bar"
- ["pri:private"]=>
- string(3) "mod"
- ["bar"]=>
- bool(true)
- ["baz"]=>
- bool(true)
-}
+foo Object
+(
+)
+foo Object
+(
+)
+foo Object
+(
+ [a] => 1
+)
+baz Object
+(
+ [pri%sprivate] => baz
+ [pub] => bar
+ [pro:protected] => bar
+ [pri%sprivate] => bar
+ [bar] => 1
+ [baz] => 1
+)
+baz Object
+(
+ [pri%sprivate] => baz
+ [pub] => bar
+ [pro:protected] => bar
+ [pri%sprivate] => mod
+ [bar] => 1
+ [baz] => 1
+)
+baz Object
+(
+ [pri%sprivate] => baz
+ [pub] => bar
+ [pro:protected] => bar
+ [pri%sprivate] => mod
+ [bar] => 1
+ [baz] => 1
+)
===DONE===