Skip to content

Commit 09368f9

Browse files
committed
Remove useless method
1 parent ed14332 commit 09368f9

File tree

5 files changed

+1
-47
lines changed

5 files changed

+1
-47
lines changed

README.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -191,25 +191,6 @@ The `examples/` directory at the root of the repository contains more detailed e
191191

192192
php examples/objects_list.php
193193

194-
## Information on structs size
195-
Display size in byte of main data structs size in PHP. Will mainly differ between 32bits et 64bits environments.
196-
197-
```php
198-
meminfo_structs_size(fopen('php://stdout','w'));
199-
```
200-
201-
It can be useful to understand difference in memory usage between two platforms.
202-
203-
Example Output on 64bits environment:
204-
205-
```
206-
Structs size on this platform:
207-
Class (zend_class_entry): 568 bytes.
208-
Object (zend_object): 32 bytes.
209-
Variable (zval): 24 bytes.
210-
Variable value (zvalue_value): 16 bytes.
211-
```
212-
213194
Usage in production
214195
-------------------
215196
PHP Meminfo can be used in production, as it does not have any impact on performances outside of the call to the `meminfo` functions.
@@ -219,7 +200,7 @@ Nevertheless, production environment is not where you debug ;)
219200
Other memory debugging tools for PHP
220201
-------------------------------------
221202
- XDebug (https://xdebug.org/)
222-
With the trace feature and the memory delta option (tool see XDebug documentation), you can trace function memory usage. You can use the provided script to get an aggregated view (TODO link)
203+
With the trace feature and the memory delta option (see XDebug documentation), you can trace function memory usage. You can use the provided script to get an aggregated view (TODO link)
223204

224205
- PHP Memprof (https://github.com/arnaud-lb/php-memory-profiler)
225206
Provides aggregated data about memory usage by functions. Far less resource intensive than a full trace from XDebug.

extension/php5/meminfo.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919

2020
const zend_function_entry meminfo_functions[] = {
21-
PHP_FE(meminfo_structs_size, NULL)
2221
PHP_FE(meminfo_objects_list, NULL)
2322
PHP_FE(meminfo_objects_summary, NULL)
2423
PHP_FE(meminfo_gc_roots_list, NULL)

extension/php5/php_meminfo.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#define MEMINFO_COPYRIGHT "Copyright (c) 2010-2016 by Benoit Jacquemont"
88
#define MEMINFO_COPYRIGHT_SHORT "Copyright (c) 2011-2016"
99

10-
PHP_FUNCTION(meminfo_structs_size);
1110
PHP_FUNCTION(meminfo_objects_list);
1211
PHP_FUNCTION(meminfo_objects_summary);
1312
PHP_FUNCTION(meminfo_gc_roots_list);

extension/php7/meminfo.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121

2222
const zend_function_entry meminfo_functions[] = {
23-
PHP_FE(meminfo_structs_size, NULL)
2423
PHP_FE(meminfo_objects_list, NULL)
2524
PHP_FE(meminfo_objects_summary, NULL)
2625
PHP_FE(meminfo_info_dump, NULL)
@@ -40,28 +39,6 @@ zend_module_entry meminfo_module_entry = {
4039
STANDARD_MODULE_PROPERTIES
4140
};
4241

43-
PHP_FUNCTION(meminfo_structs_size)
44-
{
45-
zval *zval_stream;
46-
php_stream *stream;
47-
48-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zval_stream) == FAILURE) {
49-
return;
50-
}
51-
52-
php_stream_from_zval(stream, zval_stream);
53-
54-
php_stream_printf(stream, "Simple Zend Type size on this platform\n");
55-
php_stream_printf(stream, " Zend Signed Integer (zend_long): %ld bytes.\n", sizeof(zend_long));
56-
php_stream_printf(stream, " Zend Unsigned Integer (zend_ulong): %ld bytes.\n", sizeof(zend_ulong));
57-
php_stream_printf(stream, " Zend Unsigned Char (zend_uchar): %ld bytes.\n", sizeof(zend_uchar));
58-
59-
php_stream_printf(stream, "Structs size on this platform:\n");
60-
php_stream_printf(stream, " Variable (zval): %ld bytes.\n", sizeof(zval));
61-
php_stream_printf(stream, " Class (zend_class_entry): %ld bytes.\n", sizeof(zend_class_entry));
62-
php_stream_printf(stream, " Object (zend_object): %ld bytes.\n", sizeof(zend_object));
63-
}
64-
6542
PHP_FUNCTION(meminfo_objects_list)
6643
{
6744
zval *zval_stream;

extension/php7/php_meminfo.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#define MEMINFO_COPYRIGHT "Copyright (c) 2010-2017 by Benoit Jacquemont"
1010
#define MEMINFO_COPYRIGHT_SHORT "Copyright (c) 2011-2017"
1111

12-
PHP_FUNCTION(meminfo_structs_size);
13-
1412
PHP_FUNCTION(meminfo_objects_list);
1513
PHP_FUNCTION(meminfo_objects_summary);
1614

0 commit comments

Comments
 (0)