This limits the path length to 64kb which is already far above the
use case. In return, the whole path cache storage size is reduced
by 8kb.
memcpy(bucket->realpath, realpath, realpath_len+1);
}
bucket->realpath_len = realpath_len;
- bucket->is_dir = is_dir;
+ bucket->is_dir = is_dir > 0;
#ifdef ZEND_WIN32
bucket->is_rvalid = 0;
bucket->is_readable = 0;
char *realpath;
struct _realpath_cache_bucket *next;
time_t expires;
- int path_len;
- int realpath_len;
- int is_dir;
+ uint16_t path_len;
+ uint16_t realpath_len;
+ uint8_t is_dir:1;
#ifdef ZEND_WIN32
- unsigned char is_rvalid;
- unsigned char is_readable;
- unsigned char is_wvalid;
- unsigned char is_writable;
+ uint8_t is_rvalid:1;
+ uint8_t is_readable:1;
+ uint8_t is_wvalid:1;
+ uint8_t is_writable:1;
#endif
} realpath_cache_bucket;