You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
13
vendor/swoole/examples/memory/pool.php
vendored
Executable file
13
vendor/swoole/examples/memory/pool.php
vendored
Executable 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";
|
Reference in New Issue
Block a user