From 2a619ceba75a4c16b25de12d59a87eac795a4468 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 20 Sep 2022 15:07:40 +0200 Subject: Remove: unused wrappers --- wrappers/php/src/Impl/GoSlice.php | 43 --------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 wrappers/php/src/Impl/GoSlice.php (limited to 'wrappers/php/src/Impl') diff --git a/wrappers/php/src/Impl/GoSlice.php b/wrappers/php/src/Impl/GoSlice.php deleted file mode 100644 index b285cfd..0000000 --- a/wrappers/php/src/Impl/GoSlice.php +++ /dev/null @@ -1,43 +0,0 @@ -cData = $cData; - FFI::memcpy($cData, $data, $len); - - $slice = $ffi->new('GoSlice'); - if ($slice === null) throw new RuntimeException('error allocating buffer'); - $this->slice = $slice; - $slice->data = FFI::addr($cData); // $cData must not be destroyed while $slice is in use - $slice->cap = $slice->len = $len; - } - - public function slice(): CData - { - return $this->slice; - } - - public function __destruct() - { - // Make sure we do not unknowingly use a slice with deallocated data - $this->slice->data = null; - $this->slice->cap = $this->slice->len = 0; - } -} -- cgit v1.2.3