Init Repo

This commit is contained in:
root
2019-09-06 23:53:10 +08:00
commit f0ef89dfbb
7905 changed files with 914138 additions and 0 deletions

13
vendor/swoole/examples/memory/pool.php vendored Executable file
View File

@ -0,0 +1,13 @@
<?php
use Swoole\Memory\Pool;
$pool = new Pool(2 * 1024 * 1024, Pool::TYPE_RING, 1024);
/**
* @var $p1 Swoole\Memory\Pool\Slice
*/
$p1 = $pool->alloc();
$p1->write("hello world");
echo $p1->read()."\n";
echo $p1->read(5, 6)."\n";