Changeset 163 in svn for trunk/xcache.c


Ignore:
Timestamp:
2006-09-13T14:11:36+02:00 (9 years ago)
Author:
Xuefer
Message:

show available shm scheme in moduleinfo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache.c

    r154 r163  
    21232123    char buf[100];
    21242124    char *ptr;
     2125    int left, len;
     2126    xc_shm_scheme_t *scheme;
    21252127
    21262128    php_info_print_table_start();
     
    21322134    if (xc_php_size) {
    21332135        ptr = _php_math_number_format(xc_php_size, 0, '.', ',');
    2134         sprintf(buf, "enabled, %s bytes, %d split(s), with %d slots each", ptr, xc_php_hcache.size, xc_php_hentry.size);
     2136        snprintf(buf, sizeof(buf), "enabled, %s bytes, %d split(s), with %d slots each", ptr, xc_php_hcache.size, xc_php_hentry.size);
    21352137        php_info_print_table_row(2, "Opcode Cache", buf);
    21362138        efree(ptr);
     
    21412143    if (xc_var_size) {
    21422144        ptr = _php_math_number_format(xc_var_size, 0, '.', ',');
    2143         sprintf(buf, "enabled, %s bytes, %d split(s), with %d slots each", ptr, xc_var_hcache.size, xc_var_hentry.size);
     2145        snprintf(buf, sizeof(buf), "enabled, %s bytes, %d split(s), with %d slots each", ptr, xc_var_hcache.size, xc_var_hentry.size);
    21442146        php_info_print_table_row(2, "Variable Cache", buf);
    21452147        efree(ptr);
     
    21482150        php_info_print_table_row(2, "Variable Cache", "disabled");
    21492151    }
     2152
     2153    left = sizeof(buf);
     2154    ptr = buf;
     2155    buf[0] = '\0';
     2156    for (scheme = xc_shm_scheme_first(); scheme; scheme = xc_shm_scheme_next(scheme)) {
     2157        len = snprintf(ptr, left, ptr == buf ? "%s" : ", %s", xc_shm_scheme_name(scheme));
     2158        left -= len;
     2159        ptr += len;
     2160    }
     2161    php_info_print_table_row(2, "Shared Memory Schemes", buf);
     2162
    21502163#ifdef HAVE_XCACHE_COVERAGER
    21512164    php_info_print_table_row(2, "Coverage Dumper", XG(coveragedumper) && xc_coveragedump_dir && xc_coveragedump_dir[0] ? "enabled" : "disabled");
Note: See TracChangeset for help on using the changeset viewer.