Changeset 1217 in svn


Ignore:
Timestamp:
2012-12-20T12:40:04Z (3 years ago)
Author:
Xuefer
Message:

kill warning "function with _alloca() inlined into a loop"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mod_cacher/xc_cacher.c

    r1204 r1217  
    25602560    }
    25612561
    2562 static inline zend_bool xc_var_has_prefix(xc_entry_t *entry, zval *prefix TSRMLS_DC) /* {{{ */
     2562static inline zend_bool xc_var_has_prefix(const xc_entry_t *entry, zval *prefix, const xc_namebuffer_t *prefix_buffer TSRMLS_DC) /* {{{ */
    25632563{
    25642564    zend_bool result = 0;
    2565     VAR_BUFFER_FLAGS(prefix);
    25662565
    25672566    if (UNISW(IS_STRING, entry->name_type) != prefix->type) {
    25682567        return 0;
    25692568    }
    2570     VAR_BUFFER_INIT(prefix);
    25712569
    25722570#ifdef IS_UNICODE
    25732571    if (Z_TYPE(prefix) == IS_UNICODE) {
    2574         result = entry->name.ustr.len >= prefix_buffer.len
    2575          && memcmp(entry->name.ustr.val, prefix_buffer.buffer, prefix_buffer.len * sizeof(Z_USTRVAL_P(prefix)[0])) == 0;
    2576         goto finish;
    2577     }
    2578 #endif
    2579 
    2580     result = entry->name.str.len >= prefix_buffer.len
    2581      && memcmp(entry->name.str.val, prefix_buffer.buffer, prefix_buffer.len) == 0;
    2582     goto finish;
    2583 
    2584 finish:
    2585     VAR_BUFFER_FREE(prefix);
    2586     return result;
     2572        return result = entry->name.ustr.len >= prefix_buffer->len
     2573         && memcmp(entry->name.ustr.val, prefix_buffer->buffer, prefix_buffer->len * sizeof(Z_USTRVAL_P(prefix)[0])) == 0;
     2574    }
     2575#endif
     2576
     2577    return result = entry->name.str.len >= prefix_buffer->len
     2578     && memcmp(entry->name.str.val, prefix_buffer->buffer, prefix_buffer->len) == 0;
    25872579}
    25882580/* }}} */
     
    33203312    zval *prefix;
    33213313    int i, iend;
     3314    VAR_BUFFER_FLAGS(prefix);
    33223315
    33233316    if (!xc_var_caches) {
     
    33303323    }
    33313324
     3325    VAR_BUFFER_INIT(prefix);
    33323326    for (i = 0, iend = xc_var_hcache.size; i < iend; i ++) {
    33333327        xc_cache_t *cache = &xc_var_caches[i];
     
    33423336                for (entry = cache->cached->entries[entryslotid]; entry; entry = next) {
    33433337                    next = entry->next;
    3344                     if (xc_var_has_prefix(entry, prefix TSRMLS_CC)) {
     3338                    if (xc_var_has_prefix(entry, prefix, &prefix_buffer TSRMLS_CC)) {
    33453339                        xc_entry_remove_unlocked(XC_TYPE_VAR, cache, entryslotid, entry TSRMLS_CC);
    33463340                    }
     
    33493343        } LEAVE_LOCK(cache);
    33503344    }
     3345    VAR_BUFFER_FREE(prefix);
    33513346}
    33523347/* }}} */
Note: See TracChangeset for help on using the changeset viewer.