~ubuntu-branches/ubuntu/raring/php5/raring

« back to all changes in this revision

Viewing changes to Zend/zend_ptr_stack.h

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-18 16:10:26 UTC
  • mfrom: (1.1.24) (0.3.58 sid)
  • Revision ID: package-import@ubuntu.com-20120618161026-hg1fc5r9z1a4hlqz
Tags: 5.4.4-1ubuntu1
* Merge from Debian unstable. Remaining changes:
  - d/rules: Simplify apache config settings since we never build 
    interbase or firebird.
  - debian/rules: export DEB_HOST_MULTIARCH properly.
  - Add build-dependency on lemon, which we now need.
  - Dropped firebird2.1-dev, libc-client-dev, libmcrypt-dev as it is in universe.
  - Dropped libcurl-dev not in the archive.
  - debian/control: replace build-depends on mysql-server with
    mysql-server-core-5.5 and mysql-client-5.5 to avoid upstart and
    mysql-server-5.5 postinst confusion with starting up multiple
    mysqlds listening on the same port.
  - Dropped php5-imap, php5-interbase, php5-mcrypt since we have versions
    already in universe.
  - Dropped libonig-dev and libqgdbm since its in universe. (libonig MIR
    has been declined due to an inactive upstream. So this is probably
    a permanent change).
  - modulelist: Drop imap, interbase, sybase, and mcrypt.
  - debian/rules:
    * Dropped building of mcrypt, imap, and interbase.
    * Install apport hook for php5.
    * stop mysql instance on clean just in case we failed in tests
* Dropped Changes:
  * d/rules: enable Suhosin patch with PHP5_SUHOSIN=yes -- Upstream suhosin
    has been slow to adopt PHP 5.4, and is showing signs of disengagement.
    Therefore, we will follow Debian's lead and drop Suhosin for now.
  - d/control: build-depend on mysql 5.5 instead of 5.1 for running tests.
    -- Debian just deps on mysql-server
  - Suggest php5-suhosin rather than recommends. -- Dropping suhosin
  - d/setup-mysql.sh: modify to work with mysql 5.5 differences -- superseded
    in Debian.
  - Only build php5-sqlite for sqlite3, dropping the obsolete sqlite2. --
    superseded in Debian
  - d/maxlifetime: Improve maxlifetime script to scan for more SAPIs and 
    scan all *.ini in conf.d directory. -- Change came from Debian
  - d/libapache2-mod-php5.postinst,libapache2-mod-php5filter.postinst: 
    Restart apache on first install to ensure module is fully enabled.
    -- Change came from Debian
  - debian/patches/php5-CVE-2012-1823.patch: filter query strings that
    are prefixed with '-' -- Fixed upstream
  - debian/control: Recommend php5-dev for php-pear. -- This was a poorly
    conceived idea anyway.
  - Pre-Depend on a new enough version of dpkg for dpkg-maintscript-helper
    rather than checking whether it exists at run-time, leading to more
    predictable behaviour on upgrades. -- Applied in Debian
  - d/p/gd-multiarch-fix.patch: superseded
* d/NEWS: add note explaining that SUHOSIN is no longer enabled in the
  Ubuntu packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
   +----------------------------------------------------------------------+
18
18
*/
19
19
 
20
 
/* $Id: zend_ptr_stack.h 321634 2012-01-01 13:15:04Z felipe $ */
 
20
/* $Id$ */
21
21
 
22
22
#ifndef ZEND_PTR_STACK_H
23
23
#define ZEND_PTR_STACK_H
46
46
#define ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count)           \
47
47
        if (stack->top+count > stack->max) {                                    \
48
48
                /* we need to allocate more memory */                           \
49
 
                stack->max *= 2;                                                                        \
50
 
                stack->max += count;                                                            \
 
49
                do {                                                                                            \
 
50
                        stack->max += PTR_STACK_BLOCK_SIZE;                             \
 
51
                } while (stack->top+count > stack->max);                        \
51
52
                stack->elements = (void **) perealloc(stack->elements, (sizeof(void *) * (stack->max)), stack->persistent);     \
52
53
                stack->top_element = stack->elements+stack->top;        \
53
54
        }
54
55
 
55
56
/*      Not doing this with a macro because of the loop unrolling in the element assignment.
56
57
        Just using a macro for 3 in the body for readability sake. */
57
 
static inline void zend_ptr_stack_3_push(zend_ptr_stack *stack, void *a, void *b, void *c)
 
58
static zend_always_inline void zend_ptr_stack_3_push(zend_ptr_stack *stack, void *a, void *b, void *c)
58
59
{
59
60
#define ZEND_PTR_STACK_NUM_ARGS 3
60
61
 
68
69
#undef ZEND_PTR_STACK_NUM_ARGS
69
70
}
70
71
 
71
 
static inline void zend_ptr_stack_2_push(zend_ptr_stack *stack, void *a, void *b)
 
72
static zend_always_inline void zend_ptr_stack_2_push(zend_ptr_stack *stack, void *a, void *b)
72
73
{
73
74
#define ZEND_PTR_STACK_NUM_ARGS 2
74
75
 
81
82
#undef ZEND_PTR_STACK_NUM_ARGS
82
83
}
83
84
 
84
 
static inline void zend_ptr_stack_3_pop(zend_ptr_stack *stack, void **a, void **b, void **c)
 
85
static zend_always_inline void zend_ptr_stack_3_pop(zend_ptr_stack *stack, void **a, void **b, void **c)
85
86
{
86
87
        *a = *(--stack->top_element);
87
88
        *b = *(--stack->top_element);
89
90
        stack->top -= 3;
90
91
}
91
92
 
92
 
static inline void zend_ptr_stack_2_pop(zend_ptr_stack *stack, void **a, void **b)
 
93
static zend_always_inline void zend_ptr_stack_2_pop(zend_ptr_stack *stack, void **a, void **b)
93
94
{
94
95
        *a = *(--stack->top_element);
95
96
        *b = *(--stack->top_element);
96
97
        stack->top -= 2;
97
98
}
98
99
 
99
 
static inline void zend_ptr_stack_push(zend_ptr_stack *stack, void *ptr)
 
100
static zend_always_inline void zend_ptr_stack_push(zend_ptr_stack *stack, void *ptr)
100
101
{
101
102
        ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, 1)
102
103
 
104
105
        *(stack->top_element++) = ptr;
105
106
}
106
107
 
107
 
static inline void *zend_ptr_stack_pop(zend_ptr_stack *stack)
 
108
static zend_always_inline void *zend_ptr_stack_pop(zend_ptr_stack *stack)
108
109
{
109
110
        stack->top--;
110
111
        return *(--stack->top_element);