summaryrefslogtreecommitdiff
path: root/main/php_streams.h
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2016-09-15 16:48:29 +0200
committerAnatol Belski <ab@php.net>2016-10-05 22:53:21 +0200
commit0ca15cbeba8b8289ee6171bd30850fe06880dc2c (patch)
treea9d36287e154c09858690d31b2fa3b5288d622b1 /main/php_streams.h
parent4b41973ba12947d569c436db2162d0be7c25e365 (diff)
downloadphp-git-0ca15cbeba8b8289ee6171bd30850fe06880dc2c.tar.gz
reduce size of stream struct
32 bytes are spared on 64-bit build
Diffstat (limited to 'main/php_streams.h')
-rw-r--r--main/php_streams.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/main/php_streams.h b/main/php_streams.h
index e205118bd7..1bdee95d17 100644
--- a/main/php_streams.h
+++ b/main/php_streams.h
@@ -197,22 +197,26 @@ struct _php_stream {
void *wrapperthis; /* convenience pointer for a instance of a wrapper */
zval wrapperdata; /* fgetwrapperdata retrieves this */
- int fgetss_state; /* for fgetss to handle multiline tags */
- int is_persistent;
- char mode[16]; /* "rwb" etc. ala stdio */
- zend_resource *res; /* used for auto-cleanup */
- int in_free; /* to prevent recursion during free */
+ uint8_t is_persistent:1;
+ uint8_t in_free:1; /* to prevent recursion during free */
+ uint8_t eof:1;
+ uint8_t __exposed:1; /* non-zero if exposed as a zval somewhere */
+
/* so we know how to clean it up correctly. This should be set to
* PHP_STREAM_FCLOSE_XXX as appropriate */
- int fclose_stdiocast;
+ uint8_t fclose_stdiocast:2;
+
+ uint8_t fgetss_state; /* for fgetss to handle multiline tags */
+
+ char mode[16]; /* "rwb" etc. ala stdio */
+
+ uint32_t flags; /* PHP_STREAM_FLAG_XXX */
+
+ zend_resource *res; /* used for auto-cleanup */
FILE *stdiocast; /* cache this, otherwise we might leak! */
- int __exposed; /* non-zero if exposed as a zval somewhere */
char *orig_path;
zend_resource *ctx;
- uint32_t flags; /* PHP_STREAM_FLAG_XXX */
-
- int eof;
/* buffer */
zend_off_t position; /* of underlying stream */