{
void *ret;
zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
- size_t old_size = collect_memory_statistics && ptr? *(size_t *) (ptr - sizeof(size_t)) : 0;
+ size_t old_size = collect_memory_statistics && ptr? *(size_t *) (((char*)ptr) - sizeof(size_t)) : 0;
DBG_ENTER(mysqlnd_erealloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno);
DBG_INF_FMT("ptr=%p old_size=%lu, new_size=%lu", ptr, old_size, new_size);
{
void *ret;
zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
- size_t old_size = collect_memory_statistics && ptr? *(size_t *) (ptr - sizeof(size_t)) : 0;
+ size_t old_size = collect_memory_statistics && ptr? *(size_t *) (((char*)ptr) - sizeof(size_t)) : 0;
DBG_ENTER(mysqlnd_perealloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno);
DBG_INF_FMT("ptr=%p old_size=%lu new_size=%lu persist=%d", ptr, old_size, new_size, persistent);
if (ptr) {
if (collect_memory_statistics) {
- free_amount = *(size_t *)(ptr - sizeof(size_t));
- DBG_INF_FMT("ptr=%p size=%u", ptr - sizeof(size_t), (unsigned int) free_amount);
+ free_amount = *(size_t *)(((char*)ptr) - sizeof(size_t));
+ DBG_INF_FMT("ptr=%p size=%u", ((char*)ptr) - sizeof(size_t), (unsigned int) free_amount);
}
efree(REAL_PTR(ptr));
}
if (ptr) {
if (collect_memory_statistics) {
- free_amount = *(size_t *)(ptr - sizeof(size_t));
- DBG_INF_FMT("ptr=%p size=%u", ptr - sizeof(size_t), (unsigned int) free_amount);
+ free_amount = *(size_t *)(((char*)ptr) - sizeof(size_t));
+ DBG_INF_FMT("ptr=%p size=%u", ((char*)ptr) - sizeof(size_t), (unsigned int) free_amount);
}
pefree(REAL_PTR(ptr), persistent);
}
if (ptr) {
if (collect_memory_statistics) {
- free_amount = *(size_t *)(ptr - sizeof(size_t));
- DBG_INF_FMT("ptr=%p size=%u", ptr - sizeof(size_t), (unsigned int) free_amount);
+ free_amount = *(size_t *)(((char*)ptr) - sizeof(size_t));
+ DBG_INF_FMT("ptr=%p size=%u", ((char*)ptr) - sizeof(size_t), (unsigned int) free_amount);
}
free(REAL_PTR(ptr));
}
{
char * ret;
smart_str tmp_str = {0, 0, 0};
- char * p = ptr;
+ const char * p = ptr;
zend_bool collect_memory_statistics = MYSQLND_G(collect_memory_statistics);
DBG_ENTER(mysqlnd_pestrdup_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename, PHP_DIR_SEPARATOR) + 1, __zend_lineno);
MYSQLND_METHOD(mysqlnd_net, decode)(zend_uchar * uncompressed_data, size_t uncompressed_data_len,
const zend_uchar * const compressed_data, size_t compressed_data_len TSRMLS_DC)
{
+#ifdef MYSQLND_COMPRESSION_ENABLED
int error;
uLongf tmp_complen = uncompressed_data_len;
DBG_ENTER("mysqlnd_net::decode");
DBG_INF_FMT("decompression NOT successful. error=%d Z_OK=%d Z_BUF_ERROR=%d Z_MEM_ERROR=%d", error, Z_OK, Z_BUF_ERROR, Z_MEM_ERROR);
}
DBG_RETURN(error == Z_OK? PASS:FAIL);
+#else
+ DBG_ENTER("mysqlnd_net::decode");
+ DBG_RETURN(FAIL);
+#endif
}
/* }}} */
MYSQLND_METHOD(mysqlnd_net, encode)(zend_uchar * compress_buffer, size_t compress_buffer_len,
const zend_uchar * const uncompressed_data, size_t uncompressed_data_len TSRMLS_DC)
{
+#ifdef MYSQLND_COMPRESSION_ENABLED
int error;
uLongf tmp_complen = compress_buffer_len;
DBG_ENTER("mysqlnd_net::encode");
DBG_INF_FMT("compression successful. compressed size=%d", tmp_complen);
}
DBG_RETURN(error == Z_OK? PASS:FAIL);
+#else
+ DBG_ENTER("mysqlnd_net::encode");
+ DBG_RETURN(FAIL);
+#endif
}
/* }}} */