com php-src: reduce size of stream bucket struct by 8 bytes on 64-bit: main/streams/filter.c main/streams/php_stream_filter_api .h
| From: | Anatol Belski | Date: | Wed, 05 Oct 2016 20:53:21 +0000 |
| Subject: | com php-src: reduce size of stream bucket struct by 8 bytes on 64-bit: main/streams/filter.c main/streams/php_stream_filter_api .h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-94845@lists.php.net to get a copy of this message | ||
Commit: 41d04079e39747312ca8e7ba7117f06c399bd50e
Author: Anatol Belski <ab@php.net> Thu, 15 Sep 2016 13:08:54 +0200
Parents: 6e806b45609b5659fd7459cdf18fa477d9dda3ac
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=41d04079e39747312ca8e7ba7117f06c399bd50e
Log:
reduce size of stream bucket struct by 8 bytes on 64-bit
Changed paths:
M main/streams/filter.c
M main/streams/php_stream_filter_api.h
Diff:
diff --git a/main/streams/filter.c b/main/streams/filter.c
index e97dea9..c921d4c 100644
--- a/main/streams/filter.c
+++ b/main/streams/filter.c
@@ -68,7 +68,7 @@ PHPAPI int php_stream_filter_register_factory_volatile(const char *filterpattern
/* Buckets */
-PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, int
own_buf, int buf_persistent)
+PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen,
uint8_t own_buf, uint8_t buf_persistent)
{
int is_persistent = php_stream_is_persistent(stream);
php_stream_bucket *bucket;
diff --git a/main/streams/php_stream_filter_api.h b/main/streams/php_stream_filter_api.h
index 27a6da9..a0118da 100644
--- a/main/streams/php_stream_filter_api.h
+++ b/main/streams/php_stream_filter_api.h
@@ -48,8 +48,8 @@ struct _php_stream_bucket {
char *buf;
size_t buflen;
/* if non-zero, buf should be pefreed when the bucket is destroyed */
- int own_buf;
- int is_persistent;
+ uint8_t own_buf;
+ uint8_t is_persistent;
/* destroy this struct when refcount falls to zero */
int refcount;
@@ -67,7 +67,7 @@ typedef enum {
/* Buckets API. */
BEGIN_EXTERN_C()
-PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, int
own_buf, int buf_persistent);
+PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen,
uint8_t own_buf, uint8_t buf_persistent);
PHPAPI int php_stream_bucket_split(php_stream_bucket *in, php_stream_bucket **left,
php_stream_bucket **right, size_t length);
PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket);
#define php_stream_bucket_addref(bucket) (bucket)->refcount++