Skip to content

anonymous /__thread-tls-2.patch
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
__thread-tls-2.patch
Index: acinclude.m4
===================================================================
RCS file: /repository/php-src/acinclude.m4,v
retrieving revision 1.332.2.14.2.26.2.9
diff -u -r1.332.2.14.2.26.2.9 acinclude.m4
--- acinclude.m4 24 Jul 2008 14:17:54 -0000 1.332.2.14.2.26.2.9
+++ acinclude.m4 24 Aug 2008 15:16:48 -0000
@@ -2703,7 +2703,7 @@
enable-libtool-lock | with-pic | with-tags | enable-shared | enable-static | enable-fast-install | with-gnu-ld[)];;
# Allow certain TSRM options
- with-tsrm-pth | with-tsrm-st | with-tsrm-pthreads[)];;
+ with-tsrm-pth | with-tsrm-st | with-tsrm-pthreads | with-tsrm-native-tls [)];;
# Allow certain Zend options
with-zend-vm | enable-maintainer-zts | enable-inline-optimization[)];;
Index: configure.in
===================================================================
RCS file: /repository/php-src/configure.in,v
retrieving revision 1.579.2.52.2.77.2.29
diff -u -r1.579.2.52.2.77.2.29 configure.in
--- configure.in 1 Aug 2008 00:46:20 -0000 1.579.2.52.2.77.2.29
+++ configure.in 24 Aug 2008 15:16:48 -0000
@@ -1088,6 +1088,7 @@
TSRM_BASIC_CHECKS
if test "$PHP_THREAD_SAFETY" = "yes"; then
TSRM_THREADS_CHECKS
+ TSRM___THREAD_CHECKS
fi
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS"
Index: TSRM/TSRM.c
===================================================================
RCS file: /repository/TSRM/TSRM.c,v
retrieving revision 1.68.2.3.2.1.2.2
diff -u -r1.68.2.3.2.1.2.2 TSRM.c
--- TSRM/TSRM.c 7 Feb 2008 09:06:45 -0000 1.68.2.3.2.1.2.2
+++ TSRM/TSRM.c 24 Aug 2008 15:16:48 -0000
@@ -23,7 +23,7 @@
typedef struct _tsrm_tls_entry tsrm_tls_entry;
struct _tsrm_tls_entry {
- void **storage;
+ void *storage;
int count;
THREAD_T thread_id;
tsrm_tls_entry *next;
@@ -31,6 +31,7 @@
typedef struct {
+ ts_rsrc_offset offset;
size_t size;
ts_allocate_ctor ctor;
ts_allocate_dtor dtor;
@@ -42,6 +43,7 @@
static tsrm_tls_entry **tsrm_tls_table=NULL;
static int tsrm_tls_table_size;
static ts_rsrc_id id_count;
+static size_t rsrcs_size;
/* The resource sizes table */
static tsrm_resource_type *resource_types_table=NULL;
@@ -61,31 +63,61 @@
static int tsrm_error_level;
static FILE *tsrm_error_file;
+#ifdef USE___THREAD
+TSRM_API TSRM_TLS void *tsrm_ls_cache = 0;
+#endif
+
+#ifdef PASS_TSRMLS
+# define CALL_TSRMG_CTOR(ctor, globale, storage) (ctor)((globale), (storage))
+# define CALL_TSRMG_DTOR(ctor, globale, storage) (ctor)((globale), (storage))
+# define CALL_NEW_THREAD_BEGIN_HANDLER(thread_id, storage) tsrm_new_thread_begin_handler((thread_id), (storage))
+# define CALL_NEW_THREAD_END_HANDLER(thread_id, storage) tsrm_new_thread_end_handler((thread_id), (storage))
+#else
+# define CALL_TSRMG_CTOR(ctor, globale, storage) (ctor)((globale))
+# define CALL_TSRMG_DTOR(ctor, globale, storage) (ctor)((globale))
+# define CALL_NEW_THREAD_BEGIN_HANDLER(thread_id, storage) tsrm_new_thread_begin_handler((thread_id))
+# define CALL_NEW_THREAD_END_HANDLER(thread_id, storage) tsrm_new_thread_end_handler((thread_id))
+#endif
+
+#ifndef TSRM_MM_ALIGNMENT
+# define TSRM_MM_ALIGNMENT 8
+#elif TSRM_MM_ALIGNMENT < 4
+# undef TSRM_MM_ALIGNMENT
+# define TSRM_MM_ALIGNMENT 8
+#endif
+
+#define TSRMG_PTR(storage, offset) ((void *)((tsrm_uintptr_t)storage + offset))
+
+#ifdef USE___THREAD
+# define TSRM_RETURN_TSRM_LS(array) array
+#else
+# define TSRM_RETURN_TSRM_LS(array) &array
+#endif
#if TSRM_DEBUG
#define TSRM_ERROR(args) tsrm_error args
-#define TSRM_SAFE_RETURN_RSRC(array, offset, range) \
+#define TSRM_SAFE_RETURN_RSRC(array, id, range) \
{ \
- int unshuffled_offset = TSRM_UNSHUFFLE_RSRC_ID(offset); \
+ int unshuffled_id = TSRM_UNSHUFFLE_RSRC_ID(id); \
\
- if (offset==0) { \
- return &array; \
- } else if ((unshuffled_offset)>=0 && (unshuffled_offset)<(range)) { \
+ if (id==0) { \
+ return TSRM_RETURN_TSRM_LS(array); \
+ } else if ((unshuffled_id)>=0 && (unshuffled_id)<(range)) { \
TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Successfully fetched resource id %d for thread id %ld - 0x%0.8X", \
- unshuffled_offset, (long) thread_resources->thread_id, array[unshuffled_offset])); \
- return array[unshuffled_offset]; \
+ unshuffled_id, (long) thread_resources->thread_id, TSRMG_PTR(array, resource_types_table[unshuffled_id].offset))); \
+ return TSRMG_PTR(array, resource_types_table[unshuffled_id].offset); \
} else { \
TSRM_ERROR((TSRM_ERROR_LEVEL_ERROR, "Resource id %d is out of range (%d..%d)", \
- unshuffled_offset, TSRM_SHUFFLE_RSRC_ID(0), TSRM_SHUFFLE_RSRC_ID(thread_resources->count-1))); \
+ unshuffled_id, TSRM_SHUFFLE_RSRC_ID(0), TSRM_SHUFFLE_RSRC_ID(thread_resources->count-1))); \
return NULL; \
} \
}
#else
#define TSRM_ERROR(args)
-#define TSRM_SAFE_RETURN_RSRC(array, offset, range) \
- if (offset==0) { \
- return &array; \
+#define TSRM_SAFE_RETURN_RSRC(array, id, range) \
+ if (id==0) { \
+ return TSRM_RETURN_TSRM_LS(array); \
} else { \
- return array[TSRM_UNSHUFFLE_RSRC_ID(offset)]; \
+ return TSRMG_PTR(array, resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(id)].offset); \
}
#endif
@@ -175,11 +207,8 @@
next_p = p->next;
for (j=0; j<p->count; j++) {
- if (p->storage[j]) {
- if (resource_types_table && !resource_types_table[j].done && resource_types_table[j].dtor) {
- resource_types_table[j].dtor(p->storage[j], &p->storage);
- }
- free(p->storage[j]);
+ if (resource_types_table && !resource_types_table[j].done && resource_types_table[j].dtor) {
+ CALL_TSRMG_CTOR(resource_types_table[j].dtor, TSRMG_PTR(p->storage, resource_types_table[j].offset), &p->storage);
}
}
free(p->storage);
@@ -212,9 +241,10 @@
/* allocates a new thread-safe-resource id */
-TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor)
+TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, ts_rsrc_offset *rsrc_offset, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor)
{
int i;
+ ts_rsrc_offset offset = 0;
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Obtaining a new resource id, %d bytes", size));
@@ -235,6 +265,16 @@
}
resource_types_table_size = id_count;
}
+ if (TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id) > 0) {
+ offset = resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id-1)].offset
+ + resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id-1)].size;
+ }
+ offset = ((TSRM_MM_ALIGNMENT + offset - 1) & ~(TSRM_MM_ALIGNMENT - 1));
+ if (rsrc_offset) {
+ *rsrc_offset = offset;
+ }
+
+ resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].offset = offset;
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].size = size;
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].ctor = ctor;
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].dtor = dtor;
@@ -248,11 +288,13 @@
if (p->count < id_count) {
int j;
- p->storage = (void *) realloc(p->storage, sizeof(void *)*id_count);
+ p->storage = realloc(p->storage, offset + size);
+#ifdef USE___THREAD
+ tsrm_ls_cache = p->storage;
+#endif
for (j=p->count; j<id_count; j++) {
- p->storage[j] = (void *) malloc(resource_types_table[j].size);
if (resource_types_table[j].ctor) {
- resource_types_table[j].ctor(p->storage[j], &p->storage);
+ CALL_TSRMG_CTOR(resource_types_table[j].ctor, TSRMG_PTR(p->storage, resource_types_table[j].offset), &p->storage);
}
}
p->count = id_count;
@@ -260,9 +302,10 @@
p = p->next;
}
}
+ rsrcs_size = offset + size;
tsrm_mutex_unlock(tsmm_mutex);
- TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Successfully allocated new resource id %d", *rsrc_id));
+ TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Successfully allocated new resource id %d, offset %u", *rsrc_id, *rsrc_offset));
return *rsrc_id;
}
@@ -273,31 +316,30 @@
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Creating data structures for thread %x", thread_id));
(*thread_resources_ptr) = (tsrm_tls_entry *) malloc(sizeof(tsrm_tls_entry));
- (*thread_resources_ptr)->storage = (void **) malloc(sizeof(void *)*id_count);
+ (*thread_resources_ptr)->storage = malloc(rsrcs_size);
(*thread_resources_ptr)->count = id_count;
(*thread_resources_ptr)->thread_id = thread_id;
(*thread_resources_ptr)->next = NULL;
/* Set thread local storage to this new thread resources structure */
tsrm_tls_set(*thread_resources_ptr);
+#ifdef USE___THREAD
+ tsrm_ls_cache = (*thread_resources_ptr)->storage;
+#endif
if (tsrm_new_thread_begin_handler) {
- tsrm_new_thread_begin_handler(thread_id, &((*thread_resources_ptr)->storage));
+ CALL_NEW_THREAD_BEGIN_HANDLER(thread_id, &(*thread_resources_ptr)->storage);
}
for (i=0; i<id_count; i++) {
- if (resource_types_table[i].done) {
- (*thread_resources_ptr)->storage[i] = NULL;
- } else
- {
- (*thread_resources_ptr)->storage[i] = (void *) malloc(resource_types_table[i].size);
+ if (!resource_types_table[i].done) {
if (resource_types_table[i].ctor) {
- resource_types_table[i].ctor((*thread_resources_ptr)->storage[i], &(*thread_resources_ptr)->storage);
+ CALL_TSRMG_CTOR(resource_types_table[i].ctor, TSRMG_PTR((*thread_resources_ptr)->storage, resource_types_table[i].offset), &(*thread_resources_ptr)->storage);
}
}
}
if (tsrm_new_thread_end_handler) {
- tsrm_new_thread_end_handler(thread_id, &((*thread_resources_ptr)->storage));
+ CALL_NEW_THREAD_END_HANDLER(thread_id, &(*thread_resources_ptr)->storage);
}
tsrm_mutex_unlock(tsmm_mutex);
@@ -390,12 +432,9 @@
for (i=0; i<thread_resources->count; i++) {
if (resource_types_table[i].dtor) {
- resource_types_table[i].dtor(thread_resources->storage[i], &thread_resources->storage);
+ CALL_TSRMG_DTOR(resource_types_table[i].dtor, TSRMG_PTR(thread_resources->storage, resource_types_table[i].offset), &thread_resources->storage);
}
}
- for (i=0; i<thread_resources->count; i++) {
- free(thread_resources->storage[i]);
- }
free(thread_resources->storage);
free(thread_resources);
thread_resources = next;
@@ -413,6 +452,9 @@
/* Set thread local storage to this new thread resources structure */
tsrm_tls_set(new_ctx);
+#ifdef USE___THREAD
+ tsrm_ls_cache = ((tsrm_tls_entry*)new_ctx)->storage;
+#endif
/* return old context, so caller can restore it when they're done */
return current;
@@ -455,12 +497,9 @@
if (thread_resources->thread_id == thread_id) {
for (i=0; i<thread_resources->count; i++) {
if (resource_types_table[i].dtor) {
- resource_types_table[i].dtor(thread_resources->storage[i], &thread_resources->storage);
+ CALL_TSRMG_DTOR(resource_types_table[i].dtor, TSRMG_PTR(thread_resources->storage, resource_types_table[i].offset), &thread_resources->storage);
}
}
- for (i=0; i<thread_resources->count; i++) {
- free(thread_resources->storage[i]);
- }
free(thread_resources->storage);
if (last) {
last->next = thread_resources->next;
@@ -497,12 +536,9 @@
if (thread_resources->thread_id != thread_id) {
for (i=0; i<thread_resources->count; i++) {
if (resource_types_table[i].dtor) {
- resource_types_table[i].dtor(thread_resources->storage[i], &thread_resources->storage);
+ CALL_TSRMG_DTOR(resource_types_table[i].dtor, TSRMG_PTR(thread_resources->storage, resource_types_table[i].offset), &thread_resources->storage);
}
}
- for (i=0; i<thread_resources->count; i++) {
- free(thread_resources->storage[i]);
- }
free(thread_resources->storage);
if (last) {
last->next = thread_resources->next;
@@ -541,12 +577,10 @@
tsrm_tls_entry *p = tsrm_tls_table[i];
while (p) {
- if (p->count > j && p->storage[j]) {
+ if (p->count > j) {
if (resource_types_table && resource_types_table[j].dtor) {
- resource_types_table[j].dtor(p->storage[j], &p->storage);
+ CALL_TSRMG_DTOR(resource_types_table[j].dtor, TSRMG_PTR(p->storage, resource_types_table[j].offset), &p->storage);
}
- free(p->storage[j]);
- p->storage[j] = NULL;
}
p = p->next;
}
Index: TSRM/TSRM.h
===================================================================
RCS file: /repository/TSRM/TSRM.h,v
retrieving revision 1.50.2.2.2.4.2.2
diff -u -r1.50.2.2.2.4.2.2 TSRM.h
--- TSRM/TSRM.h 30 Jan 2008 09:41:11 -0000 1.50.2.2.2.4.2.2
+++ TSRM/TSRM.h 24 Aug 2008 15:16:48 -0000
@@ -61,6 +61,7 @@
#endif
typedef int ts_rsrc_id;
+typedef tsrm_uintptr_t ts_rsrc_offset;
/* Define THREAD_T and MUTEX_T */
#ifdef TSRM_WIN32
@@ -90,21 +91,78 @@
# define MUTEX_T beos_ben *
#endif
-typedef void (*ts_allocate_ctor)(void *, void ***);
-typedef void (*ts_allocate_dtor)(void *, void ***);
-
#define THREAD_HASH_OF(thr,ts) (unsigned long)thr%(unsigned long)ts
#ifdef __cplusplus
extern "C" {
#endif
+#ifdef USE___THREAD
+
+# ifdef TSRM_WIN32
+# define TSRM_TLS __declspec(thread)
+# else
+# define TSRM_TLS __thread
+# endif
+
+TSRM_API extern TSRM_TLS void *tsrm_ls_cache;
+
+#define TSRMG(id, type, element) \
+ ((type)((tsrm_uintptr_t)tsrm_ls_cache + id##_offset))->element
+
+#define TSRMLS_INIT() tsrm_ls_cache = (void *) ts_resource_ex(0, NULL);
+#define TSRMLS_FETCH()
+#define TSRMLS_FETCH_FROM_CTX(ctx)
+#define TSRMLS_SET_CTX(ctx)
+#define TSRMLS_D void
+#define TSRMLS_DC
+#define TSRMLS_C
+#define TSRMLS_CC
+
+#else /* USE___THREAD */
+
+#define TSRMG(id, type, element) \
+ ((type)(*(tsrm_uintptr_t *)tsrm_ls + id##_offset))->element
+
+#define TSRMLS_INIT() TSRMLS_FETCH()
+#define TSRMLS_FETCH() void **tsrm_ls = (void **) ts_resource_ex(0, NULL);
+
+#define TSRMLS_FETCH_FROM_CTX(ctx) void **tsrm_ls = (void **) ctx
+#define TSRMLS_SET_CTX(ctx) ctx = (void **) tsrm_ls
+#define TSRMLS_D void **tsrm_ls
+#define TSRMLS_DC , TSRMLS_D
+#define TSRMLS_C tsrm_ls
+#define TSRMLS_CC , TSRMLS_C
+#define PASS_TSRMLS 1
+
+#endif /* USE___THREAD */
+
+#define TSRMG_DH(type, id) \
+ TSRM_API extern ts_rsrc_id id; \
+ TSRM_API extern ts_rsrc_offset id##_offset;
+
+#define TSRMG_D(type, id) \
+ TSRM_API ts_rsrc_id id; \
+ TSRM_API ts_rsrc_offset id##_offset;
+
+#define TSRMG_ALLOCATE(id, size, ctor, dtor) \
+ TSRMG_ALLOCATE_EX(id, id##_offset, size, ctor, dtor);
+
+#define TSRMG_ALLOCATE_EX(id, offset, size, ctor, dtor) \
+ ts_allocate_id(&(id), &(offset), (size), (ctor), (dtor));
+
+#define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1)
+#define TSRM_UNSHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)-1)
+
+typedef void (*ts_allocate_ctor)(void * TSRMLS_DC);
+typedef void (*ts_allocate_dtor)(void * TSRMLS_DC);
+
/* startup/shutdown */
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename);
TSRM_API void tsrm_shutdown(void);
/* allocates a new thread-safe-resource id */
-TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor);
+TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, ts_rsrc_offset *rsrc_offset, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor);
/* fetches the requested resource for the current thread */
TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id);
@@ -125,8 +183,8 @@
#define TSRM_ERROR_LEVEL_CORE 2
#define TSRM_ERROR_LEVEL_INFO 3
-typedef void (*tsrm_thread_begin_func_t)(THREAD_T thread_id, void ***tsrm_ls);
-typedef void (*tsrm_thread_end_func_t)(THREAD_T thread_id, void ***tsrm_ls);
+typedef void (*tsrm_thread_begin_func_t)(THREAD_T thread_id TSRMLS_DC);
+typedef void (*tsrm_thread_end_func_t)(THREAD_T thread_id TSRMLS_DC);
TSRM_API int tsrm_error(int level, const char *format, ...);
@@ -148,24 +206,13 @@
TSRM_API void *tsrm_set_interpreter_context(void *new_ctx);
TSRM_API void tsrm_free_interpreter_context(void *context);
-#define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1)
-#define TSRM_UNSHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)-1)
-
-#define TSRMLS_FETCH() void ***tsrm_ls = (void ***) ts_resource_ex(0, NULL)
-#define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = (void ***) ctx
-#define TSRMLS_SET_CTX(ctx) ctx = (void ***) tsrm_ls
-#define TSRMG(id, type, element) (((type) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(id)])->element)
-#define TSRMLS_D void ***tsrm_ls
-#define TSRMLS_DC , TSRMLS_D
-#define TSRMLS_C tsrm_ls
-#define TSRMLS_CC , TSRMLS_C
-
#ifdef __cplusplus
}
#endif
#else /* non ZTS */
+#define TSRMLS_INIT()
#define TSRMLS_FETCH()
#define TSRMLS_FETCH_FROM_CTX(ctx)
#define TSRMLS_SET_CTX(ctx)
Index: TSRM/configure.in
===================================================================
RCS file: /repository/TSRM/configure.in,v
retrieving revision 1.17
diff -u -r1.17 configure.in
--- TSRM/configure.in 8 Aug 2001 10:26:21 -0000 1.17
+++ TSRM/configure.in 24 Aug 2008 15:16:49 -0000
@@ -11,6 +11,7 @@
TSRM_BASIC_CHECKS
TSRM_THREADS_CHECKS
+TSRM___THREAD_CHECKS
AM_PROG_LIBTOOL
if test "$enable_debug" != "yes"; then
Index: TSRM/tsrm.m4
===================================================================
RCS file: /repository/TSRM/tsrm.m4,v
retrieving revision 1.17.4.1
diff -u -r1.17.4.1 tsrm.m4
--- TSRM/tsrm.m4 22 Aug 2006 13:01:44 -0000 1.17.4.1
+++ TSRM/tsrm.m4 24 Aug 2008 15:16:49 -0000
@@ -21,6 +21,71 @@
fi
])
+AC_DEFUN([TSRM___THREAD_CHECKS],[
+ AC_ARG_WITH(tsrm-native-tls,
+ [ --with-tsrm-native-tls
+ Use native TLS],[
+ USE___THREAD=yes
+ ],[
+ USE___THREAD=no
+ ])
+
+ if test $USE___THREAD = yes; then
+ AC_CACHE_CHECK([for __thread specifier], ac_cv_tsrm_have___thread, [
+ AC_TRY_RUN([
+ __thread int foo = 42;
+ int main() {
+ return foo - 42;
+ }
+ ],[
+ ac_cv_tsrm_have___thread=yes
+ ],[
+ ac_cv_tsrm_have___thread=no
+ ])
+ ])
+ AC_MSG_CHECKING(wether to use native TLS)
+ if test $ac_cv_tsrm_have___thread = yes; then
+ AC_DEFINE(USE___THREAD, 1, [wether to use native TLS])
+ else
+ AC_MSG_ERROR([__thread specifier not available])
+ fi
+ AC_MSG_RESULT(yes)
+ fi
+])
+
+dnl test and set the memory alignment
+AC_DEFUN([TSRM_MM_ALIGN_CHECK], [
+ AC_CACHE_CHECK([for MM alignment], ac_cv_tsrm_mm_align, [
+ AC_TRY_RUN([
+ #include <stdio.h>
+
+ typedef union _mm_align_test {
+ void *ptr;
+ double dbl;
+ long lng;
+ } mm_align_test;
+
+ #if (defined (__GNUC__) && __GNUC__ >= 2)
+ #define TSRM_MM_ALIGNMENT (__alignof__ (mm_align_test))
+ #else
+ #define TSRM_MM_ALIGNMENT (sizeof(mm_align_test))
+ #endif
+
+ int main()
+ {
+ FILE *fp;
+ fp = fopen("conftest.tsrm", "w");
+ fprintf(fp, "%d\n", TSRM_MM_ALIGNMENT);
+ fclose(fp);
+ return 0;
+ }
+ ],[
+ ac_cv_tsrm_mm_align=`cat conftest.tsrm | cut -d ' ' -f 1`
+ ])
+ ])
+ AC_DEFINE_UNQUOTED(TSRM_MM_ALIGNMENT, $ac_cv_tsrm_mm_align, [ ])
+])
+
AC_DEFUN([TSRM_BASIC_CHECKS],[
AC_REQUIRE([AC_PROG_CC])dnl
@@ -29,6 +94,7 @@
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_CHECK_HEADERS(stdarg.h)
+TSRM_MM_ALIGN_CHECK()
])
Index: TSRM/tsrm_virtual_cwd.c
===================================================================
RCS file: /repository/TSRM/tsrm_virtual_cwd.c,v
retrieving revision 1.74.2.9.2.35.2.13
diff -u -r1.74.2.9.2.35.2.13 tsrm_virtual_cwd.c
--- TSRM/tsrm_virtual_cwd.c 19 Aug 2008 15:00:20 -0000 1.74.2.9.2.35.2.13
+++ TSRM/tsrm_virtual_cwd.c 24 Aug 2008 15:16:49 -0000
@@ -55,7 +55,7 @@
#endif
#ifdef ZTS
-ts_rsrc_id cwd_globals_id;
+TSRMG_D(virtual_cwd_globals, cwd_globals_id);
#else
virtual_cwd_globals cwd_globals;
#endif
@@ -311,7 +311,7 @@
main_cwd_state.cwd = strdup(cwd);
#ifdef ZTS
- ts_allocate_id(&cwd_globals_id, sizeof(virtual_cwd_globals), (ts_allocate_ctor) cwd_globals_ctor, (ts_allocate_dtor) cwd_globals_dtor);
+ TSRMG_ALLOCATE(cwd_globals_id, sizeof(virtual_cwd_globals), (ts_allocate_ctor) cwd_globals_ctor, (ts_allocate_dtor) cwd_globals_dtor);
#else
cwd_globals_ctor(&cwd_globals TSRMLS_CC);
#endif
Index: TSRM/tsrm_virtual_cwd.h
===================================================================
RCS file: /repository/TSRM/tsrm_virtual_cwd.h,v
retrieving revision 1.48.2.5.2.8.2.5
diff -u -r1.48.2.5.2.8.2.5 tsrm_virtual_cwd.h
--- TSRM/tsrm_virtual_cwd.h 12 Aug 2008 08:01:24 -0000 1.48.2.5.2.8.2.5
+++ TSRM/tsrm_virtual_cwd.h 24 Aug 2008 15:16:49 -0000
@@ -222,7 +222,7 @@
} virtual_cwd_globals;
#ifdef ZTS
-extern ts_rsrc_id cwd_globals_id;
+TSRMG_DH(virtual_cwd_globals, cwd_globals_id);
# define CWDG(v) TSRMG(cwd_globals_id, virtual_cwd_globals *, v)
#else
extern virtual_cwd_globals cwd_globals;
Index: TSRM/tsrm_win32.c
===================================================================
RCS file: /repository/TSRM/tsrm_win32.c,v
retrieving revision 1.27.2.1.2.7.2.2
diff -u -r1.27.2.1.2.7.2.2 tsrm_win32.c
--- TSRM/tsrm_win32.c 29 May 2008 11:31:02 -0000 1.27.2.1.2.7.2.2
+++ TSRM/tsrm_win32.c 24 Aug 2008 15:16:49 -0000
@@ -71,7 +71,7 @@
TSRM_API void tsrm_win32_startup(void)
{
#ifdef ZTS
- ts_allocate_id(&win32_globals_id, sizeof(tsrm_win32_globals), (ts_allocate_ctor)tsrm_win32_ctor, (ts_allocate_ctor)tsrm_win32_dtor);
+ TSRMG_ALLOCATE(win32_globals_id, sizeof(tsrm_win32_globals), (ts_allocate_ctor)tsrm_win32_ctor, (ts_allocate_dtor)tsrm_win32_dtor);
#else
tsrm_win32_ctor(&win32_globals TSRMLS_CC);
#endif
Index: Zend/zend.c
===================================================================
RCS file: /repository/ZendEngine2/zend.c,v
retrieving revision 1.308.2.12.2.35.2.23
diff -u -r1.308.2.12.2.35.2.23 zend.c
--- Zend/zend.c 15 Aug 2008 19:47:23 -0000 1.308.2.12.2.35.2.23
+++ Zend/zend.c 24 Aug 2008 15:16:49 -0000
@@ -98,8 +98,8 @@
#ifdef ZTS
-ZEND_API int compiler_globals_id;
-ZEND_API int executor_globals_id;
+TSRMG_D(zend_compiler_globals, compiler_globals_id);
+TSRMG_D(zend_executor_globals, executor_globals_id);
static HashTable *global_function_table = NULL;
static HashTable *global_class_table = NULL;
static HashTable *global_constants_table = NULL;
@@ -606,8 +606,8 @@
#ifdef ZTS
zend_compiler_globals *compiler_globals;
zend_executor_globals *executor_globals;
- extern ZEND_API ts_rsrc_id ini_scanner_globals_id;
- extern ZEND_API ts_rsrc_id language_scanner_globals_id;
+ TSRMG_DH(zend_ini_scanner_globals, ini_scanner_globals_id);
+ TSRMG_DH(zend_php_scanner_globals, language_scanner_globals_id);
#else
extern zend_ini_scanner_globals ini_scanner_globals;
extern zend_php_scanner_globals language_scanner_globals;
@@ -673,10 +673,10 @@
Z_TYPE(zval_used_for_init) = IS_NULL;
#ifdef ZTS
- ts_allocate_id(&compiler_globals_id, sizeof(zend_compiler_globals), (ts_allocate_ctor) compiler_globals_ctor, (ts_allocate_dtor) compiler_globals_dtor);
- ts_allocate_id(&executor_globals_id, sizeof(zend_executor_globals), (ts_allocate_ctor) executor_globals_ctor, (ts_allocate_dtor) executor_globals_dtor);
- ts_allocate_id(&language_scanner_globals_id, sizeof(zend_php_scanner_globals), (ts_allocate_ctor) php_scanner_globals_ctor, NULL);
- ts_allocate_id(&ini_scanner_globals_id, sizeof(zend_ini_scanner_globals), (ts_allocate_ctor) ini_scanner_globals_ctor, NULL);
+ TSRMG_ALLOCATE(compiler_globals_id, sizeof(zend_compiler_globals), (ts_allocate_ctor) compiler_globals_ctor, (ts_allocate_dtor) compiler_globals_dtor);
+ TSRMG_ALLOCATE(executor_globals_id, sizeof(zend_executor_globals), (ts_allocate_ctor) executor_globals_ctor, (ts_allocate_dtor) executor_globals_dtor);
+ TSRMG_ALLOCATE(language_scanner_globals_id, sizeof(zend_php_scanner_globals), (ts_allocate_ctor) php_scanner_globals_ctor, NULL);
+ TSRMG_ALLOCATE(ini_scanner_globals_id, sizeof(zend_ini_scanner_globals), (ts_allocate_ctor) ini_scanner_globals_ctor, NULL);
compiler_globals = ts_resource(compiler_globals_id);
executor_globals = ts_resource(executor_globals_id);
@@ -750,9 +750,9 @@
zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
free(compiler_globals->function_table);
free(compiler_globals->class_table);
- compiler_globals_ctor(compiler_globals, tsrm_ls);
+ compiler_globals_ctor(compiler_globals TSRMLS_CC);
free(EG(zend_constants));
- executor_globals_ctor(executor_globals, tsrm_ls);
+ executor_globals_ctor(executor_globals TSRMLS_CC);
global_persistent_list = &EG(persistent_list);
zend_copy_ini_directives(TSRMLS_C);
#endif
Index: Zend/zend_API.c
===================================================================
RCS file: /repository/ZendEngine2/zend_API.c,v
retrieving revision 1.296.2.27.2.34.2.53
diff -u -r1.296.2.27.2.34.2.53 zend_API.c
--- Zend/zend_API.c 22 Aug 2008 14:51:30 -0000 1.296.2.27.2.34.2.53
+++ Zend/zend_API.c 24 Aug 2008 15:16:49 -0000
@@ -1574,7 +1574,7 @@
/* Initialize module globals */
if (module->globals_size) {
#ifdef ZTS
- ts_allocate_id(module->globals_id_ptr, module->globals_size, (ts_allocate_ctor) module->globals_ctor, (ts_allocate_dtor) module->globals_dtor);
+ TSRMG_ALLOCATE_EX((*module->globals_id_ptr), (*module->globals_offset), module->globals_size, module->globals_ctor, module->globals_dtor);
#else
if (module->globals_ctor) {
module->globals_ctor(module->globals_ptr TSRMLS_CC);
Index: Zend/zend_API.h
===================================================================
RCS file: /repository/ZendEngine2/zend_API.h,v
retrieving revision 1.207.2.8.2.8.2.18
diff -u -r1.207.2.8.2.8.2.18 zend_API.h
--- Zend/zend_API.h 12 Aug 2008 21:45:52 -0000 1.207.2.8.2.8.2.18
+++ Zend/zend_API.h 24 Aug 2008 15:16:49 -0000
@@ -140,11 +140,11 @@
#ifdef ZTS
#define ZEND_DECLARE_MODULE_GLOBALS(module_name) \
- ts_rsrc_id module_name##_globals_id;
+ TSRMG_D(zend_##module_name##_globals, module_name##_globals_id);
#define ZEND_EXTERN_MODULE_GLOBALS(module_name) \
- extern ts_rsrc_id module_name##_globals_id;
+ TSRMG_DH(zend_##module_name##_globals, module_name##_globals_id);
#define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \
- ts_allocate_id(&module_name##_globals_id, sizeof(zend_##module_name##_globals), (ts_allocate_ctor) globals_ctor, (ts_allocate_dtor) globals_dtor);
+ TSRMG_ALLOCATE(module_name##_globals_id, sizeof(zend_##module_name##_globals), (ts_allocate_ctor) globals_ctor, (ts_allocate_dtor) globals_dtor);
#else
Index: Zend/zend_alloc.c
===================================================================
RCS file: /repository/ZendEngine2/zend_alloc.c,v
retrieving revision 1.144.2.3.2.43.2.16
diff -u -r1.144.2.3.2.43.2.16 zend_alloc.c
--- Zend/zend_alloc.c 15 Aug 2008 19:47:23 -0000 1.144.2.3.2.43.2.16
+++ Zend/zend_alloc.c 24 Aug 2008 15:16:50 -0000
@@ -2265,7 +2265,7 @@
} zend_alloc_globals;
#ifdef ZTS
-static int alloc_globals_id;
+TSRMG_D(zend_alloc_globals, alloc_globals_id);
# define AG(v) TSRMG(alloc_globals_id, zend_alloc_globals *, v)
#else
# define AG(v) (alloc_globals.v)
@@ -2521,7 +2521,7 @@
ZEND_API void start_memory_manager(TSRMLS_D)
{
#ifdef ZTS
- ts_allocate_id(&alloc_globals_id, sizeof(zend_alloc_globals), (ts_allocate_ctor) alloc_globals_ctor, (ts_allocate_dtor) alloc_globals_dtor);
+ TSRMG_ALLOCATE(alloc_globals_id, sizeof(zend_alloc_globals), (ts_allocate_ctor) alloc_globals_ctor, (ts_allocate_dtor) alloc_globals_dtor);
#else
alloc_globals_ctor(&alloc_globals);
#endif
Index: Zend/zend_compile.c
===================================================================
RCS file: /repository/ZendEngine2/zend_compile.c,v
retrieving revision 1.647.2.27.2.41.2.83
diff -u -r1.647.2.27.2.41.2.83 zend_compile.c
--- Zend/zend_compile.c 22 Aug 2008 15:54:20 -0000 1.647.2.27.2.41.2.83
+++ Zend/zend_compile.c 24 Aug 2008 15:16:50 -0000
@@ -2197,7 +2197,7 @@
start_op_number = get_next_op_number(CG(active_op_array));
-#ifdef ZTS
+#ifdef PASS_TSRMLS
zend_stack_apply_with_argument(&CG(switch_cond_stack), ZEND_STACK_APPLY_TOPDOWN, (int (*)(void *element, void *)) generate_free_switch_expr TSRMLS_CC);
zend_stack_apply_with_argument(&CG(foreach_copy_stack), ZEND_STACK_APPLY_TOPDOWN, (int (*)(void *element, void *)) generate_free_foreach_copy TSRMLS_CC);
#else
Index: Zend/zend_gc.c
===================================================================
RCS file: /repository/ZendEngine2/zend_gc.c,v
retrieving revision 1.1.2.16
diff -u -r1.1.2.16 zend_gc.c
--- Zend/zend_gc.c 15 Aug 2008 19:47:24 -0000 1.1.2.16
+++ Zend/zend_gc.c 24 Aug 2008 15:16:50 -0000
@@ -25,7 +25,7 @@
#define GC_ROOT_BUFFER_MAX_ENTRIES 10000
#ifdef ZTS
-ZEND_API int gc_globals_id;
+TSRMG_D(zend_gc_globals, gc_globals_id);
#else
ZEND_API zend_gc_globals gc_globals;
#endif
@@ -78,7 +78,7 @@
ZEND_API void gc_globals_ctor(TSRMLS_D)
{
#ifdef ZTS
- ts_allocate_id(&gc_globals_id, sizeof(zend_gc_globals), (ts_allocate_ctor) gc_globals_ctor_ex, (ts_allocate_dtor) root_buffer_dtor);
+ TSRMG_ALLOCATE(gc_globals_id, sizeof(zend_gc_globals), (ts_allocate_ctor) gc_globals_ctor_ex, (ts_allocate_dtor) root_buffer_dtor);
#else
gc_globals_ctor_ex(&gc_globals);
#endif
Index: Zend/zend_gc.h
===================================================================
RCS file: /repository/ZendEngine2/zend_gc.h,v
retrieving revision 1.1.2.8
diff -u -r1.1.2.8 zend_gc.h
--- Zend/zend_gc.h 15 Aug 2008 19:47:24 -0000 1.1.2.8
+++ Zend/zend_gc.h 24 Aug 2008 15:16:50 -0000
@@ -130,7 +130,7 @@
#ifdef ZTS
BEGIN_EXTERN_C()
-ZEND_API extern int gc_globals_id;
+TSRMG_DH(zend_gc_globals, gc_globals_id);
END_EXTERN_C()
#define GC_G(v) TSRMG(gc_globals_id, zend_gc_globals *, v)
#else
Index: Zend/zend_globals.h
===================================================================
RCS file: /repository/ZendEngine2/zend_globals.h,v
retrieving revision 1.141.2.3.2.7.2.19
diff -u -r1.141.2.3.2.7.2.19 zend_globals.h
--- Zend/zend_globals.h 14 Aug 2008 10:24:51 -0000 1.141.2.3.2.7.2.19
+++ Zend/zend_globals.h 24 Aug 2008 15:16:50 -0000
@@ -45,8 +45,8 @@
#ifdef ZTS
BEGIN_EXTERN_C()
-ZEND_API extern int compiler_globals_id;
-ZEND_API extern int executor_globals_id;
+TSRMG_DH(zend_compiler_globals, compiler_globals_id);
+TSRMG_DH(zend_executor_globals, executor_globals_id);
END_EXTERN_C()
#endif
Index: Zend/zend_globals_macros.h
===================================================================
RCS file: /repository/ZendEngine2/zend_globals_macros.h,v
retrieving revision 1.22.2.1.2.4.2.2
diff -u -r1.22.2.1.2.4.2.2 zend_globals_macros.h
--- Zend/zend_globals_macros.h 16 Mar 2008 21:05:33 -0000 1.22.2.1.2.4.2.2
+++ Zend/zend_globals_macros.h 24 Aug 2008 15:16:50 -0000
@@ -32,10 +32,13 @@
/* Compiler */
#ifdef ZTS
# define CG(v) TSRMG(compiler_globals_id, zend_compiler_globals *, v)
-int zendparse(void *compiler_globals);
#else
# define CG(v) (compiler_globals.v)
extern ZEND_API struct _zend_compiler_globals compiler_globals;
+#endif
+#ifdef PASS_TSRMLS
+int zendparse(void *compiler_globals);
+#else
int zendparse(void);
#endif
@@ -51,7 +54,7 @@
/* Language Scanner */
#ifdef ZTS
# define LANG_SCNG(v) TSRMG(language_scanner_globals_id, zend_php_scanner_globals *, v)
-extern ZEND_API ts_rsrc_id language_scanner_globals_id;
+TSRMG_DH(zend_php_scanner_globals, language_scanner_globals_id);
#else
# define LANG_SCNG(v) (language_scanner_globals.v)
extern ZEND_API zend_php_scanner_globals language_scanner_globals;
@@ -61,7 +64,7 @@
/* INI Scanner */
#ifdef ZTS
# define INI_SCNG(v) TSRMG(ini_scanner_globals_id, zend_ini_scanner_globals *, v)
-extern ZEND_API ts_rsrc_id ini_scanner_globals_id;
+TSRMG_DH(zend_ini_scanner_globals, ini_scanner_globals_id);
#else
# define INI_SCNG(v) (ini_scanner_globals.v)
extern ZEND_API zend_ini_scanner_globals ini_scanner_globals;
Index: Zend/zend_ini_parser.y
===================================================================
RCS file: /repository/ZendEngine2/zend_ini_parser.y,v
retrieving revision 1.41.2.2.2.2.2.5
diff -u -r1.41.2.2.2.2.2.5 zend_ini_parser.y
--- Zend/zend_ini_parser.y 16 Mar 2008 21:05:33 -0000 1.41.2.2.2.2.2.5
+++ Zend/zend_ini_parser.y 24 Aug 2008 15:16:50 -0000
@@ -32,7 +32,7 @@
#define YYERROR_VERBOSE
#define YYSTYPE zval
-#ifdef ZTS
+#ifdef PASS_TSRMLS
#define YYPARSE_PARAM tsrm_ls
#define YYLEX_PARAM tsrm_ls
int ini_parse(void *arg);
Index: Zend/zend_ini_scanner.l
===================================================================
RCS file: /repository/ZendEngine2/zend_ini_scanner.l,v
retrieving revision 1.41.2.2.2.2.2.10
diff -u -r1.41.2.2.2.2.2.10 zend_ini_scanner.l
--- Zend/zend_ini_scanner.l 17 Aug 2008 21:55:26 -0000 1.41.2.2.2.2.2.10
+++ Zend/zend_ini_scanner.l 24 Aug 2008 15:16:50 -0000
@@ -98,7 +98,7 @@
/* Globals Macros */
#define SCNG INI_SCNG
#ifdef ZTS
-ZEND_API ts_rsrc_id ini_scanner_globals_id;
+TSRMG_D(zend_ini_scanner_globals, ini_scanner_globals_id);
#else
ZEND_API zend_ini_scanner_globals ini_scanner_globals;
#endif
Index: Zend/zend_language_parser.y
===================================================================
RCS file: /repository/ZendEngine2/zend_language_parser.y,v
retrieving revision 1.160.2.4.2.8.2.25
diff -u -r1.160.2.4.2.8.2.25 zend_language_parser.y
--- Zend/zend_language_parser.y 12 Aug 2008 10:23:02 -0000 1.160.2.4.2.8.2.25
+++ Zend/zend_language_parser.y 24 Aug 2008 15:16:51 -0000
@@ -38,7 +38,7 @@
#define YYERROR_VERBOSE
#define YYSTYPE znode
-#ifdef ZTS
+#ifdef PASS_TSRMLS
# define YYPARSE_PARAM tsrm_ls
# define YYLEX_PARAM tsrm_ls
#endif
Index: Zend/zend_language_scanner.l
===================================================================
RCS file: /repository/ZendEngine2/zend_language_scanner.l,v
retrieving revision 1.131.2.11.2.13.2.31
diff -u -r1.131.2.11.2.13.2.31 zend_language_scanner.l
--- Zend/zend_language_scanner.l 15 Aug 2008 19:47:28 -0000 1.131.2.11.2.13.2.31
+++ Zend/zend_language_scanner.l 24 Aug 2008 15:16:52 -0000
@@ -85,7 +85,7 @@
/* Globals Macros */
#define SCNG LANG_SCNG
#ifdef ZTS
-ZEND_API ts_rsrc_id language_scanner_globals_id;
+TSRMG_D(zend_php_scanner_globals, language_scanner_globals_id);
#else
ZEND_API zend_php_scanner_globals language_scanner_globals;
#endif
Index: Zend/zend_modules.h
===================================================================
RCS file: /repository/ZendEngine2/zend_modules.h,v
retrieving revision 1.67.2.3.2.4.2.6
diff -u -r1.67.2.3.2.4.2.6 zend_modules.h
--- Zend/zend_modules.h 12 Aug 2008 17:20:24 -0000 1.67.2.3.2.4.2.6
+++ Zend/zend_modules.h 24 Aug 2008 15:16:52 -0000
@@ -50,7 +50,7 @@
#define NO_MODULE_GLOBALS 0, NULL, NULL, NULL
#ifdef ZTS
-# define ZEND_MODULE_GLOBALS(module_name) sizeof(zend_##module_name##_globals), &module_name##_globals_id
+# define ZEND_MODULE_GLOBALS(module_name) sizeof(zend_##module_name##_globals), &module_name##_globals_id, &module_name##_globals_id_offset
#else
# define ZEND_MODULE_GLOBALS(module_name) sizeof(zend_##module_name##_globals), &module_name##_globals
#endif
@@ -85,6 +85,7 @@
size_t globals_size;
#ifdef ZTS
ts_rsrc_id* globals_id_ptr;
+ ts_rsrc_offset* globals_offset;
#else
void* globals_ptr;
#endif
Index: ext/standard/basic_functions.c
===================================================================
RCS file: /repository/php-src/ext/standard/basic_functions.c,v
retrieving revision 1.725.2.31.2.64.2.62
diff -u -r1.725.2.31.2.64.2.62 basic_functions.c
--- ext/standard/basic_functions.c 23 Aug 2008 19:22:08 -0000 1.725.2.31.2.64.2.62
+++ ext/standard/basic_functions.c 24 Aug 2008 15:17:01 -0000
@@ -109,7 +109,7 @@
#include "php_ticks.h"
#ifdef ZTS
-PHPAPI int basic_globals_id;
+TSRMG_D(php_basic_globals, basic_globals_id);
#else
PHPAPI php_basic_globals basic_globals;
#endif
@@ -3980,9 +3980,9 @@
PHP_MINIT_FUNCTION(basic) /* {{{ */
{
#ifdef ZTS
- ts_allocate_id(&basic_globals_id, sizeof(php_basic_globals), (ts_allocate_ctor) basic_globals_ctor, (ts_allocate_dtor) basic_globals_dtor);
+ TSRMG_ALLOCATE(basic_globals_id, sizeof(php_basic_globals), (ts_allocate_ctor) basic_globals_ctor, (ts_allocate_dtor) basic_globals_dtor);
#ifdef PHP_WIN32
- ts_allocate_id(&php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor)php_win32_core_globals_ctor, (ts_allocate_dtor)php_win32_core_globals_dtor );
+ TSRMG_ALLOCATE(php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor)php_win32_core_globals_ctor, (ts_allocate_dtor)php_win32_core_globals_dtor);
#endif
#else
basic_globals_ctor(&basic_globals TSRMLS_CC);
Index: ext/standard/basic_functions.h
===================================================================
RCS file: /repository/php-src/ext/standard/basic_functions.h,v
retrieving revision 1.139.2.4.2.6.2.9
diff -u -r1.139.2.4.2.6.2.9 basic_functions.h
--- ext/standard/basic_functions.h 15 Apr 2008 08:44:21 -0000 1.139.2.4.2.6.2.9
+++ ext/standard/basic_functions.h 24 Aug 2008 15:17:01 -0000
@@ -228,7 +228,7 @@
#ifdef ZTS
#define BG(v) TSRMG(basic_globals_id, php_basic_globals *, v)
-PHPAPI extern int basic_globals_id;
+TSRMG_DH(php_basic_globals, basic_globals_id);
#else
#define BG(v) (basic_globals.v)
PHPAPI extern php_basic_globals basic_globals;
Index: ext/standard/dir.c
===================================================================
RCS file: /repository/php-src/ext/standard/dir.c,v
retrieving revision 1.147.2.3.2.12.2.11
diff -u -r1.147.2.3.2.12.2.11 dir.c
--- ext/standard/dir.c 11 Aug 2008 23:14:36 -0000 1.147.2.3.2.12.2.11
+++ ext/standard/dir.c 24 Aug 2008 15:17:01 -0000
@@ -57,7 +57,7 @@
#ifdef ZTS
#define DIRG(v) TSRMG(dir_globals_id, php_dir_globals *, v)
-int dir_globals_id;
+TSRMG_D(php_dir_globals, dir_globals_id);
#else
#define DIRG(v) (dir_globals.v)
php_dir_globals dir_globals;
@@ -131,7 +131,7 @@
dir_class_entry_ptr = zend_register_internal_class(&dir_class_entry TSRMLS_CC);
#ifdef ZTS
- ts_allocate_id(&dir_globals_id, sizeof(php_dir_globals), NULL, NULL);
+ TSRMG_ALLOCATE(dir_globals_id, sizeof(php_dir_globals), NULL, NULL);
#endif
dirsep_str[0] = DEFAULT_SLASH;
Index: ext/standard/file.c
===================================================================
RCS file: /repository/php-src/ext/standard/file.c,v
retrieving revision 1.409.2.6.2.28.2.21
diff -u -r1.409.2.6.2.28.2.21 file.c
--- ext/standard/file.c 12 Aug 2008 19:38:54 -0000 1.409.2.6.2.28.2.21
+++ ext/standard/file.c 24 Aug 2008 15:17:01 -0000
@@ -111,7 +111,7 @@
#include "zend_API.h"
#ifdef ZTS
-int file_globals_id;
+TSRMG_D(php_file_globals, file_globals_id);
#else
php_file_globals file_globals;
#endif
@@ -183,7 +183,7 @@
le_stream_context = zend_register_list_destructors_ex(file_context_dtor, NULL, "stream-context", module_number);
#ifdef ZTS
- ts_allocate_id(&file_globals_id, sizeof(php_file_globals), (ts_allocate_ctor) file_globals_ctor, (ts_allocate_dtor) file_globals_dtor);
+ TSRMG_ALLOCATE(file_globals_id, sizeof(php_file_globals), (ts_allocate_ctor) file_globals_ctor, (ts_allocate_dtor) file_globals_dtor);
#else
file_globals_ctor(&file_globals TSRMLS_CC);
#endif
Index: ext/standard/file.h
===================================================================
RCS file: /repository/php-src/ext/standard/file.h,v
retrieving revision 1.94.2.2.2.5.2.2
diff -u -r1.94.2.2.2.5.2.2 file.h
--- ext/standard/file.h 31 Dec 2007 07:17:14 -0000 1.94.2.2.2.5.2.2
+++ ext/standard/file.h 24 Aug 2008 15:17:01 -0000
@@ -126,7 +126,7 @@
#ifdef ZTS
#define FG(v) TSRMG(file_globals_id, php_file_globals *, v)
-extern PHPAPI int file_globals_id;
+TSRMG_DH(php_file_globals, file_globals_id);
#else
#define FG(v) (file_globals.v)
extern PHPAPI php_file_globals file_globals;
Index: ext/standard/info.c
===================================================================
RCS file: /repository/php-src/ext/standard/info.c,v
retrieving revision 1.249.2.10.2.14.2.11
diff -u -r1.249.2.10.2.14.2.11 info.c
--- ext/standard/info.c 13 Aug 2008 00:53:28 -0000 1.249.2.10.2.14.2.11
+++ ext/standard/info.c 24 Aug 2008 15:17:01 -0000
@@ -503,7 +503,11 @@
#endif
#ifdef ZTS
+# ifdef USE___THREAD
+ php_info_print_table_row(2, "Thread Safety", "enabled, native TLS" );
+# else
php_info_print_table_row(2, "Thread Safety", "enabled" );
+# endif
#else
php_info_print_table_row(2, "Thread Safety", "disabled" );
#endif
Index: ext/standard/lcg.c
===================================================================
RCS file: /repository/php-src/ext/standard/lcg.c,v
retrieving revision 1.41.2.1.2.2.2.2
diff -u -r1.41.2.1.2.2.2.2 lcg.c
--- ext/standard/lcg.c 31 Dec 2007 07:17:15 -0000 1.41.2.1.2.2.2.2
+++ ext/standard/lcg.c 24 Aug 2008 15:17:01 -0000
@@ -32,7 +32,7 @@
#endif
#ifdef ZTS
-int lcg_globals_id;
+TSRMG_D(php_lcg_globals, lcg_globals_id);
#else
static php_lcg_globals lcg_globals;
#endif
@@ -101,7 +101,7 @@
PHP_MINIT_FUNCTION(lcg) /* {{{ */
{
#ifdef ZTS
- ts_allocate_id(&lcg_globals_id, sizeof(php_lcg_globals), (ts_allocate_ctor) lcg_init_globals, NULL);
+ TSRMG_ALLOCATE(lcg_globals_id, sizeof(php_lcg_globals), (ts_allocate_ctor) lcg_init_globals, NULL);
#else
lcg_init_globals(&lcg_globals);
#endif
Index: main/SAPI.c
===================================================================
RCS file: /repository/php-src/main/SAPI.c,v
retrieving revision 1.202.2.7.2.15.2.4
diff -u -r1.202.2.7.2.15.2.4 SAPI.c
--- main/SAPI.c 18 Mar 2008 21:42:50 -0000 1.202.2.7.2.15.2.4
+++ main/SAPI.c 24 Aug 2008 15:17:02 -0000
@@ -53,7 +53,7 @@
#include "php_content_types.h"
#ifdef ZTS
-SAPI_API int sapi_globals_id;
+TSRMG_D(sapi_globals_struct, sapi_globals_id);
#else
sapi_globals_struct sapi_globals;
#endif
@@ -80,7 +80,7 @@
sapi_module = *sf;
#ifdef ZTS
- ts_allocate_id(&sapi_globals_id, sizeof(sapi_globals_struct), (ts_allocate_ctor) sapi_globals_ctor, (ts_allocate_dtor) sapi_globals_dtor);
+ TSRMG_ALLOCATE(sapi_globals_id, sizeof(sapi_globals_struct), (ts_allocate_ctor) sapi_globals_ctor, (ts_allocate_dtor) sapi_globals_dtor);
#else
sapi_globals_ctor(&sapi_globals);
#endif
Index: main/SAPI.h
===================================================================
RCS file: /repository/php-src/main/SAPI.h,v
retrieving revision 1.114.2.1.2.3.2.3
diff -u -r1.114.2.1.2.3.2.3 SAPI.h
--- main/SAPI.h 18 Mar 2008 21:42:50 -0000 1.114.2.1.2.3.2.3
+++ main/SAPI.h 24 Aug 2008 15:17:02 -0000
@@ -137,7 +137,7 @@
BEGIN_EXTERN_C()
#ifdef ZTS
# define SG(v) TSRMG(sapi_globals_id, sapi_globals_struct *, v)
-SAPI_API extern int sapi_globals_id;
+TSRMG_DH(sapi_globals_struct, sapi_globals_id);
#else
# define SG(v) (sapi_globals.v)
extern SAPI_API sapi_globals_struct sapi_globals;
Index: main/main.c
===================================================================
RCS file: /repository/php-src/main/main.c,v
retrieving revision 1.640.2.23.2.57.2.31
diff -u -r1.640.2.23.2.57.2.31 main.c
--- main/main.c 23 Aug 2008 17:55:50 -0000 1.640.2.23.2.57.2.31
+++ main/main.c 24 Aug 2008 15:17:02 -0000
@@ -96,7 +96,7 @@
#ifndef ZTS
php_core_globals core_globals;
#else
-PHPAPI int core_globals_id;
+TSRMG_D(php_core_globals, core_globals_id);
#endif
#define SAFE_FILENAME(f) ((f)?(f):"-")
@@ -1657,8 +1657,6 @@
char *php_os;
#ifdef ZTS
zend_executor_globals *executor_globals;
- void ***tsrm_ls;
-
php_core_globals *core_globals;
#endif
#if defined(PHP_WIN32) || (defined(NETWARE) && defined(USE_WINSOCK))
@@ -1691,7 +1689,7 @@
#endif
#ifdef ZTS
- tsrm_ls = ts_resource(0);
+ TSRMLS_INIT();
#endif
module_shutdown = 0;
@@ -1725,10 +1723,10 @@
#ifdef ZTS
executor_globals = ts_resource(executor_globals_id);
- ts_allocate_id(&core_globals_id, sizeof(php_core_globals), (ts_allocate_ctor) core_globals_ctor, (ts_allocate_dtor) core_globals_dtor);
+ TSRMG_ALLOCATE(core_globals_id, sizeof(php_core_globals), (ts_allocate_ctor) core_globals_ctor, (ts_allocate_dtor) core_globals_dtor);
core_globals = ts_resource(core_globals_id);
#ifdef PHP_WIN32
- ts_allocate_id(&php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor) php_win32_core_globals_ctor, (ts_allocate_dtor) php_win32_core_globals_dtor);
+ TSRMG_ALLOCATE(php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor) php_win32_core_globals_ctor, (ts_allocate_dtor) php_win32_core_globals_dtor);
#endif
#endif
gc_globals_ctor(TSRMLS_C);
Index: main/output.c
===================================================================
RCS file: /repository/php-src/main/output.c,v
retrieving revision 1.167.2.3.2.4.2.9
diff -u -r1.167.2.3.2.4.2.9 output.c
--- main/output.c 18 Aug 2008 07:46:31 -0000 1.167.2.3.2.4.2.9
+++ main/output.c 24 Aug 2008 15:17:02 -0000
@@ -41,7 +41,7 @@
#endif
#ifdef ZTS
-int output_globals_id;
+TSRMG_D(php_output_globals, output_globals_id);
#else
php_output_globals output_globals;
#endif
@@ -71,7 +71,7 @@
PHPAPI void php_output_startup(void)
{
#ifdef ZTS
- ts_allocate_id(&output_globals_id, sizeof(php_output_globals), (ts_allocate_ctor) php_output_init_globals, NULL);
+ TSRMG_ALLOCATE(output_globals_id, sizeof(php_output_globals), (ts_allocate_ctor) php_output_init_globals, NULL);
#else
php_output_init_globals(&output_globals TSRMLS_CC);
#endif
Index: main/php.h
===================================================================
RCS file: /repository/php-src/main/php.h,v
retrieving revision 1.221.2.4.2.8.2.10
diff -u -r1.221.2.4.2.8.2.10 php.h
--- main/php.h 22 Aug 2008 12:59:46 -0000 1.221.2.4.2.8.2.10
+++ main/php.h 24 Aug 2008 15:17:02 -0000
@@ -289,7 +289,7 @@
PHPAPI void php_verror(const char *docref, const char *params, int type, const char *format, va_list args TSRMLS_DC) PHP_ATTRIBUTE_FORMAT(printf, 4, 0);
-#ifdef ZTS
+#ifdef PASS_TSRMLS
#define PHP_ATTR_FMT_OFFSET 1
#else
#define PHP_ATTR_FMT_OFFSET 0
Index: main/php_globals.h
===================================================================
RCS file: /repository/php-src/main/php_globals.h,v
retrieving revision 1.98.2.1.2.7.2.5
diff -u -r1.98.2.1.2.7.2.5 php_globals.h
--- main/php_globals.h 18 Mar 2008 21:42:50 -0000 1.98.2.1.2.7.2.5
+++ main/php_globals.h 24 Aug 2008 15:17:02 -0000
@@ -27,7 +27,7 @@
#ifdef ZTS
# define PG(v) TSRMG(core_globals_id, php_core_globals *, v)
-extern PHPAPI int core_globals_id;
+TSRMG_DH(php_core_globals, core_globals_id);
#else
# define PG(v) (core_globals.v)
extern ZEND_API struct _php_core_globals core_globals;
Index: main/php_output.h
===================================================================
RCS file: /repository/php-src/main/php_output.h,v
retrieving revision 1.53.2.1.2.1.2.1
diff -u -r1.53.2.1.2.1.2.1 php_output.h
--- main/php_output.h 31 Dec 2007 07:17:17 -0000 1.53.2.1.2.1.2.1
+++ main/php_output.h 24 Aug 2008 15:17:02 -0000
@@ -94,7 +94,7 @@
#ifdef ZTS
#define OG(v) TSRMG(output_globals_id, php_output_globals *, v)
-ZEND_API extern int output_globals_id;
+TSRMG_DH(php_output_globals, output_globals_id);
#else
#define OG(v) (output_globals.v)
ZEND_API extern php_output_globals output_globals;
Index: sapi/apache/php_apache.c
===================================================================
RCS file: /repository/php-src/sapi/apache/php_apache.c,v
retrieving revision 1.89.2.4.2.6.2.5
diff -u -r1.89.2.4.2.6.2.5 php_apache.c
--- sapi/apache/php_apache.c 20 Jul 2008 14:28:41 -0000 1.89.2.4.2.6.2.5
+++ sapi/apache/php_apache.c 24 Aug 2008 15:17:02 -0000
@@ -139,7 +139,7 @@
static PHP_MINIT_FUNCTION(apache)
{
#ifdef ZTS
- ts_allocate_id(&php_apache_info_id, sizeof(php_apache_info_struct), (ts_allocate_ctor) php_apache_globals_ctor, NULL);
+ TSRMG_ALLOCATE(php_apache_info_id, sizeof(php_apache_info_struct), (ts_allocate_ctor) php_apache_globals_ctor, NULL);
#else
php_apache_globals_ctor(&php_apache_info TSRMLS_CC);
#endif
Index: sapi/apache2handler/php_apache.h
===================================================================
RCS file: /repository/php-src/sapi/apache2handler/php_apache.h,v
retrieving revision 1.8.2.1.2.2.2.2
diff -u -r1.8.2.1.2.2.2.2 php_apache.h
--- sapi/apache2handler/php_apache.h 30 Jan 2008 09:41:12 -0000 1.8.2.1.2.2.2.2
+++ sapi/apache2handler/php_apache.h 24 Aug 2008 15:17:03 -0000
@@ -75,7 +75,7 @@
extern zend_module_entry apache2_module_entry;
#ifdef ZTS
-extern int php_apache2_info_id;
+TSRMG_DH(php_apache2_info_struct, php_apache2_info_id);
#define AP2(v) TSRMG(php_apache2_info_id, php_apache2_info_struct *, v)
#else
extern php_apache2_info_struct php_apache2_info;
Index: sapi/apache2handler/php_functions.c
===================================================================
RCS file: /repository/php-src/sapi/apache2handler/php_functions.c,v
retrieving revision 1.18.2.6.2.5.2.4
diff -u -r1.18.2.6.2.5.2.4 php_functions.c
--- sapi/apache2handler/php_functions.c 16 Jul 2008 11:59:15 -0000 1.18.2.6.2.5.2.4
+++ sapi/apache2handler/php_functions.c 24 Aug 2008 15:17:03 -0000
@@ -49,7 +49,7 @@
#include "php_apache.h"
#ifdef ZTS
-int php_apache2_info_id;
+TSRMG_D(php_apache2_info_struct, php_apache2_info_id);
#else
php_apache2_info_struct php_apache2_info;
#endif
@@ -548,7 +548,7 @@
static PHP_MINIT_FUNCTION(apache)
{
#ifdef ZTS
- ts_allocate_id(&php_apache2_info_id, sizeof(php_apache2_info_struct), (ts_allocate_ctor) NULL, NULL);
+ TSRMG_ALLOCATE(php_apache2_info_id, sizeof(php_apache2_info_struct), NULL, NULL);
#endif
REGISTER_INI_ENTRIES();
return SUCCESS;
Index: sapi/apache2handler/sapi_apache2.c
===================================================================
RCS file: /repository/php-src/sapi/apache2handler/sapi_apache2.c,v
retrieving revision 1.57.2.10.2.15.2.3
diff -u -r1.57.2.10.2.15.2.3 sapi_apache2.c
--- sapi/apache2handler/sapi_apache2.c 18 Mar 2008 22:23:20 -0000 1.57.2.10.2.15.2.3
+++ sapi/apache2handler/sapi_apache2.c 24 Aug 2008 15:17:03 -0000
@@ -417,6 +417,7 @@
}
#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
+ TSRMLS_INIT();
#endif
sapi_startup(&apache2_sapi_module);
apache2_sapi_module.startup(&apache2_sapi_module);
@@ -504,7 +505,7 @@
apr_bucket *bucket;
apr_status_t rv;
request_rec * volatile parent_req = NULL;
- TSRMLS_FETCH();
+ TSRMLS_INIT();
#define PHPAP_INI_OFF php_apache_ini_dtor(r, parent_req TSRMLS_CC);
Index: sapi/apache_hooks/php_apache.c
===================================================================
RCS file: /repository/php-src/sapi/apache_hooks/php_apache.c,v
retrieving revision 1.19.2.3.2.5.2.4
diff -u -r1.19.2.3.2.5.2.4 php_apache.c
--- sapi/apache_hooks/php_apache.c 20 Jul 2008 14:28:41 -0000 1.19.2.3.2.5.2.4
+++ sapi/apache_hooks/php_apache.c 24 Aug 2008 15:17:03 -0000
@@ -1436,7 +1436,7 @@
zend_class_entry ce;
#ifdef ZTS
- ts_allocate_id(&php_apache_info_id, sizeof(php_apache_info_struct), (ts_allocate_ctor) php_apache_globals_ctor, NULL);
+ TSRMG_ALLOCATE(php_apache_info_id, sizeof(php_apache_info_struct), (ts_allocate_ctor) php_apache_globals_ctor, NULL);
#else
php_apache_globals_ctor(&php_apache_info TSRMLS_CC);
#endif
Index: sapi/cgi/cgi_main.c
===================================================================
RCS file: /repository/php-src/sapi/cgi/cgi_main.c,v
retrieving revision 1.267.2.15.2.50.2.25
diff -u -r1.267.2.15.2.50.2.25 cgi_main.c
--- sapi/cgi/cgi_main.c 18 Aug 2008 10:49:35 -0000 1.267.2.15.2.50.2.25
+++ sapi/cgi/cgi_main.c 24 Aug 2008 15:17:03 -0000
@@ -183,7 +183,7 @@
/* }}} */
#ifdef ZTS
-static int php_cgi_globals_id;
+TSRMG_D(php_cgi_globals_struct, php_cgi_globals_id);
#define CGIG(v) TSRMG(php_cgi_globals_id, php_cgi_globals_struct *, v)
#else
static php_cgi_globals_struct php_cgi_globals;
@@ -1317,7 +1317,7 @@
static PHP_MINIT_FUNCTION(cgi)
{
#ifdef ZTS
- ts_allocate_id(&php_cgi_globals_id, sizeof(php_cgi_globals_struct), (ts_allocate_ctor) php_cgi_globals_ctor, NULL);
+ TSRMG_ALLOCATE(php_cgi_globals_id, sizeof(php_cgi_globals_struct), (ts_allocate_ctor) php_cgi_globals_ctor, NULL);
#else
php_cgi_globals_ctor(&php_cgi_globals TSRMLS_CC);
#endif
@@ -1377,10 +1377,6 @@
int ini_entries_len = 0;
/* end of temporary locals */
-#ifdef ZTS
- void ***tsrm_ls;
-#endif
-
int max_requests = 500;
int requests = 0;
int fastcgi = fcgi_is_fastcgi();
@@ -1422,7 +1418,7 @@
#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
- tsrm_ls = ts_resource(0);
+ TSRMLS_INIT();
#endif
sapi_startup(&cgi_sapi_module);
Index: sapi/cli/php_cli.c
===================================================================
RCS file: /repository/php-src/sapi/cli/php_cli.c,v
retrieving revision 1.129.2.13.2.22.2.15
diff -u -r1.129.2.13.2.22.2.15 php_cli.c
--- sapi/cli/php_cli.c 14 Aug 2008 09:46:26 -0000 1.129.2.13.2.22.2.15
+++ sapi/cli/php_cli.c 24 Aug 2008 15:17:03 -0000
@@ -603,9 +603,6 @@
const char *param_error=NULL;
int hide_argv = 0;
/* end of temporary locals */
-#ifdef ZTS
- void ***tsrm_ls;
-#endif
#ifdef PHP_CLI_WIN32_NO_CONSOLE
int argc = __argc;
char **argv = __argv;
@@ -641,7 +638,7 @@
#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
- tsrm_ls = ts_resource(0);
+ TSRMLS_INIT();
#endif
cli_sapi_module.ini_defaults = sapi_cli_ini_defaults;
Index: sapi/embed/php_embed.c
===================================================================
RCS file: /repository/php-src/sapi/embed/php_embed.c,v
retrieving revision 1.11.2.1.2.5.2.3
diff -u -r1.11.2.1.2.5.2.3 php_embed.c
--- sapi/embed/php_embed.c 25 Mar 2008 22:05:22 -0000 1.11.2.1.2.5.2.3
+++ sapi/embed/php_embed.c 24 Aug 2008 15:17:03 -0000
@@ -143,9 +143,6 @@
int php_embed_init(int argc, char **argv PTSRMLS_DC)
{
zend_llist global_vars;
-#ifdef ZTS
- void ***tsrm_ls = NULL;
-#endif
#ifdef HAVE_SIGNAL_H
#if defined(SIGPIPE) && defined(SIG_IGN)
@@ -160,8 +157,8 @@
#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
- tsrm_ls = ts_resource(0);
- *ptsrm_ls = tsrm_ls;
+ TSRMLS_INIT();
+ *ptsrm_ls = ts_resource_ex(0, NULL);
#endif
sapi_startup(&php_embed_module);
Index: sapi/embed/php_embed.h
===================================================================
RCS file: /repository/php-src/sapi/embed/php_embed.h,v
retrieving revision 1.6.2.2.2.1.2.1
diff -u -r1.6.2.2.2.1.2.1 php_embed.h
--- sapi/embed/php_embed.h 31 Dec 2007 07:17:18 -0000 1.6.2.2.2.1.2.1
+++ sapi/embed/php_embed.h 24 Aug 2008 15:17:03 -0000
@@ -27,14 +27,14 @@
#include <main/php_ini.h>
#include <zend_ini.h>
-#ifdef ZTS
-#define PTSRMLS_D void ****ptsrm_ls
+#ifdef PASS_TSRMLS
+#define PTSRMLS_D void ***ptsrm_ls
#define PTSRMLS_DC , PTSRMLS_D
#define PTSRMLS_C &tsrm_ls
#define PTSRMLS_CC , PTSRMLS_C
#define PHP_EMBED_START_BLOCK(x,y) { \
- void ***tsrm_ls; \
+ void **tsrm_ls; \
php_embed_init(x, y PTSRMLS_CC); \
zend_first_try {
Index: sapi/litespeed/lsapi_main.c
===================================================================
RCS file: /repository/php-src/sapi/litespeed/lsapi_main.c,v
retrieving revision 1.7.2.2
diff -u -r1.7.2.2 lsapi_main.c
--- sapi/litespeed/lsapi_main.c 5 Aug 2008 22:37:32 -0000 1.7.2.2
+++ sapi/litespeed/lsapi_main.c 24 Aug 2008 15:17:03 -0000
@@ -80,7 +80,6 @@
zend_executor_globals *executor_globals;
php_core_globals *core_globals;
sapi_globals_struct *sapi_globals;
-void ***tsrm_ls;
#endif
zend_module_entry litespeed_module_entry;
@@ -706,6 +705,7 @@
#ifdef ZTS
tsrm_startup(1, 1, 0, NULL);
+ TSRMLS_INIT();
#endif
if (argc > 1 ) {
@@ -724,7 +724,6 @@
executor_globals = ts_resource(executor_globals_id);
core_globals = ts_resource(core_globals_id);
sapi_globals = ts_resource(sapi_globals_id);
- tsrm_ls = ts_resource(0);
SG(request_info).path_translated = NULL;
#endif
Index: sapi/milter/php_milter.c
===================================================================
RCS file: /repository/php-src/sapi/milter/php_milter.c,v
retrieving revision 1.14.2.2.2.3.2.6
diff -u -r1.14.2.2.2.3.2.6 php_milter.c
--- sapi/milter/php_milter.c 13 Aug 2008 00:53:28 -0000 1.14.2.2.2.3.2.6
+++ sapi/milter/php_milter.c 24 Aug 2008 15:17:03 -0000
@@ -1000,8 +1000,6 @@
char *param_error=NULL;
/* end of temporary locals */
- void ***tsrm_ls;
-
#ifdef HAVE_SIGNAL_H
#if defined(SIGPIPE) && defined(SIG_IGN)
signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so
@@ -1015,6 +1013,7 @@
tsrm_startup(1, 1, 0, NULL);
+ TSRMLS_INIT();
sapi_startup(&milter_sapi_module);
while ((c=ap_php_getopt(argc, argv, OPTSTRING))!=-1) {
@@ -1032,8 +1031,6 @@
milter_sapi_module.executable_location = argv[0];
- tsrm_ls = ts_resource(0);
-
sapi_module.startup(&milter_sapi_module);
zend_first_try {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.