SlideShare a Scribd company logo
1 of 53
2011.12.10 hiratara
d.hatena.ne.jp/hiratara

twitter.com/hiratara



Perl

YAPC   gihyo.jp
my ($ref1, $ref2, $ref3);
        $ref1 = $ref2;
        $ref2 = $ref3;
        $ref3 = $ref1;



$ref1            $ref2              $ref3
GC

Perl   GC
mark-and-sweep GC
mark-and-sweep GC
mark-and-sweep GC
mark-and-sweep GC
reference counting
     1

              1



1
          1       2


                         1

          2       1
reference counting
     1

              0



1
          1       2


                         1

          2       1
reference counting
     1

              0



1
          0       1


                         1

          2       1
reference counting
     1

              0



1
          0       1


                         1

          1       1
reference counting
     1

              0



1
          0       1   Leak

                         1

          1       1
(1)

    Template::Plugin::Filter
    (TT-2.2)

    Template::Plugin


return $self->{ _STATIC_FILTER } ||= sub {
      $self->filter(shift);
};
(2)
    AnyEvent

my $t; $t = AE::timer 1, 0, sub {
   ...;
   undef $t;
};


            $t           sub { ... }
(2)
    AnyEvent

my $t; $t = AE::timer 1, 0, sub {
   ...;
   undef $t;
};


            $t           sub { ... }
(2)
    AnyEvent

my $t; $t = AE::timer 1, 0, sub {
   ...;
   undef $t;
};


            $t
(2)
    AnyEvent

my $t; $t = AE::timer 1, 0, sub {
   ...;
   undef $t;
};


            $t
(2)
    AnyEvent

my $t; $t = AE::timer 1, 0, sub {
   ...;
   undef $t;
};
(3)


my ($f, $x);
(sub { $f = sub { $x } })->();


                    OUTSIDE



     sub {...}            $f == sub { ... }
(3)
use Devel::Peek; Dump($f);

SV = IV(0x100827fd8) at 0x100827fe0
 REFCNT = 2
 RV = 0x100827878
 SV = PVCV(0x10082b5f8) at 0x100827878
   REFCNT = 1
   GVGV::GV = 0x100856bc0      "main" :: "__ANON__"
   OUTSIDE = 0x1008032a0 (ANON)
   SV = PVCV(0x100852a90) at 0x1008032a0
    REFCNT = 1
    GVGV::GV = 0x100856bc0     "main" :: "__ANON__"
    PADNAME = 0x1008277e8(0x100287000) PAD = 0x100827800(0x10025c0e0)
       1. 0x100827fe0<2> FAKE "$f" flags=0x0 index=1
5
(   ≒       )
1) ps
% perl
 for (1 .. 10000) {
    my $ref; $ref = $ref;

        warn `ps -o rss= -p $$` if $_ % 1000 == 0;
      }
      1272
      1304
      1328
      1352
      1376
...
2) Test::LeakTrace
use Test::LeakTrace;
no_leaks_ok { my $ref; $ref = $ref };
2) Test::LeakTrace
use Test::LeakTrace;
no_leaks_ok { my $ref; $ref = $ref };

               not ok 1 - leaks 1 <= 0
               # Failed test 'leaks 1 <= 0'
               # at - line 4.
               #     '1'
               #           <=
               #     '0'
               # leaked REF(0x10083b610) from - line 4.
               # SV = IV(0x10083b608) at 0x10083b610
               # REFCNT = 1
               # FLAGS = (PADMY,ROK)
               # RV = 0x10083b610
               #     SV = IV(0x10083b608) at 0x10083b610
               #         REFCNT = 1
               #         FLAGS = (PADMY,ROK)
               #         RV = 0x10083b610
               #           SV = IV(0x10083b608) at 0x10083b610
               #             REFCNT = 1
               #             FLAGS = (PADMY,ROK)
               #             RV = 0x10083b610
               #               SV = IV(0x10083b608) at 0x10083b610
               ...
3) Devel::Cycle
use Devel::Cycle;

my ($ref1, $ref2, $ref3);
$ref1 = $ref2;
$ref2 = sub { $ref3 };
$ref3 = [$ref1];

find_cycle($ref1);
Cycle (1):
                          $$A => &B
              $B variable $ref3 => $C
                          $$C => @D
                      $D->[0] => $A
4) Devel::Leak::Object
use Devel::Leak::Object qw{GLOBAL_bless};
$Devel::Leak::Object::TRACKSOURCELINES = 1;

my $ref; $ref = bless $ref => "XXX";

Tracked objects by class:
      XXX                               1

Sources of leaks:
XXX
    1 from - line: 3
5) DESTROY
sub Ref1::DESTROY { warn "destroyed REF1" }
sub Ref2::DESTROY { warn "destroyed REF2" }

my $x;
my $f = bless sub {
    $x;
    bless sub { $x } => "Ref2";
} => "Ref1";
$f->();

destroyed REF2 at - line 2.
destroyed REF1 at - line 1.
Devel::Gladiator



PASS (181) FAIL (436)
5
$self   sub { ... }
my $self = {name => "Hokkaido.pm", handler => undef};
$self->{handler} = sub {
   print "Hello, ", $self->{name}, ".n";
};

$self->{handler}->();




                                sub { ... }

       $self                   “Hokkaido.pm”
1)
my $self = {name => "Hokkaido.pm", handler => undef};
$self->{handler} = sub {
   print "Hello, ", $self->{name}, ".n";
   undef $self;
};

$self->{handler}->();



                                sub { ... }

       $self                   “Hokkaido.pm”
1)
my $self = {name => "Hokkaido.pm", handler => undef};
$self->{handler} = sub {
   print "Hello, ", $self->{name}, ".n";
   undef $self;
};

$self->{handler}->();



                                sub { ... }

       $self                   “Hokkaido.pm”
1)
my $self = {name => "Hokkaido.pm", handler => undef};
$self->{handler} = sub {
   print "Hello, ", $self->{name}, ".n";
   undef $self;
};

$self->{handler}->();



                                sub { ... }


                               “Hokkaido.pm”
1)
my $self = {name => "Hokkaido.pm", handler => undef};
$self->{handler} = sub {
   print "Hello, ", $self->{name}, ".n";
   undef $self;
};

$self->{handler}->();



                                sub { ... }


                               “Hokkaido.pm”
1)
my $self = {name => "Hokkaido.pm", handler => undef};
$self->{handler} = sub {
   print "Hello, ", $self->{name}, ".n";
   undef $self;
};

$self->{handler}->();
1)


(                   )



($self->{handler}       )
2) Scalar::Util::weaken
my $self = {name => "Hokkaido.pm", handler => undef};
Scalar::Util::weaken(my $weaken_self = $self);
$self->{handler} = sub {
   print "Hello, ", $weaken_self->{name}, ".n";
};

$self->{handler}->();


                                sub { ... }

       $self                   “Hokkaido.pm”
2) Scalar::Util::weaken



my $self = {name => "Hokkaido.pm", handler => undef};
Scalar::Util::weaken($self); #
$self->{handler} = sub {
   print "Hello, ", $self->{name}, ".n";
};

$self->{handler}->();
3)
my $self = {name => "Hokkaido.pm", handler => undef};
my $name = $self->{name};
$self->{handler} = sub {
   print "Hello, ", $name, ".n";
};

$self->{handler}->();


                                sub { ... }

       $self                   “Hokkaido.pm”
4)
my $self = {name => "Hokkaido.pm", handler => undef};
$self->{handler} = sub {
   my $self = shift;
   print "Hello, ", $self->{name}, ".n";
};

$self->{handler}->($self);



                                sub { ... }

       $self                   “Hokkaido.pm”
4)

AnyEvent::Handler




   $hdl->push_read (line => sub {
       my ($hdl, $line) = @_;
       ...
   });
5) Data::Decycle

use Data::Decycle;
my $guard = Data::Decycle->new(
    my $self = {name => "Hokkaido.pm", handler => undef}
);
$self->{handler} = sub {
    "Hello, ", $self->{name}, ".n";
};

$self->{handler}->();
5) Data::Decycle

dankogai

            guard

           1)
:Perl 5.8.8


use Devel::Leak::Object qw{GLOBAL_bless};
bless my $x = {}, "Dummy";
(sub { sub { $x } })->();


Tracked objects by class:
      Dummy                                 1
:Perl 5.8.8


my $x = bless {}, "Dummy";
(sub { $x; sub { $x } })->();

my $x = bless {}, "Dummy";
(sub { my $x = $x; sub { warn $x } })->();
:Obj-C              ARC

retain   release                Perl



CBRFuture *future = [[CBRFuture alloc] init];
__weak CBRFuture *weakenFuture = future;
leftHandle(self, ^(id e) {
    current = nil;
    leftSend(weakenFuture, e);
});
:Obj-C             Guard
NSString *local = @"OK";

static void changeLocalValue(BOOL willBreak) {
    id original = local;
    CBRGuard *guard = [[CBRGuard alloc] initGuard:^{
        local = original;
    }];

    local = @"LOCALVALUE1";
}
:Obj-C     Guard



   autorelease

More Related Content

What's hot

Electrify your code with PHP Generators
Electrify your code with PHP GeneratorsElectrify your code with PHP Generators
Electrify your code with PHP GeneratorsMark Baker
 
Object Calisthenics Applied to PHP
Object Calisthenics Applied to PHPObject Calisthenics Applied to PHP
Object Calisthenics Applied to PHPGuilherme Blanco
 
Crafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterCrafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterRicardo Signes
 
R57shell
R57shellR57shell
R57shellady36
 
Parsing JSON with a single regex
Parsing JSON with a single regexParsing JSON with a single regex
Parsing JSON with a single regexbrian d foy
 
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonfRafael Dohms
 
PHP for Adults: Clean Code and Object Calisthenics
PHP for Adults: Clean Code and Object CalisthenicsPHP for Adults: Clean Code and Object Calisthenics
PHP for Adults: Clean Code and Object CalisthenicsGuilherme Blanco
 
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Masahiro Nagano
 
You code sucks, let's fix it
You code sucks, let's fix itYou code sucks, let's fix it
You code sucks, let's fix itRafael Dohms
 
Object Calisthenics Adapted for PHP
Object Calisthenics Adapted for PHPObject Calisthenics Adapted for PHP
Object Calisthenics Adapted for PHPChad Gray
 
Symfony components in the wild, PHPNW12
Symfony components in the wild, PHPNW12Symfony components in the wild, PHPNW12
Symfony components in the wild, PHPNW12Jakub Zalas
 
Symfony War Stories
Symfony War StoriesSymfony War Stories
Symfony War StoriesJakub Zalas
 
An Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackAn Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackVic Metcalfe
 
Gta v savegame
Gta v savegameGta v savegame
Gta v savegamehozayfa999
 

What's hot (20)

Electrify your code with PHP Generators
Electrify your code with PHP GeneratorsElectrify your code with PHP Generators
Electrify your code with PHP Generators
 
Object Calisthenics Applied to PHP
Object Calisthenics Applied to PHPObject Calisthenics Applied to PHP
Object Calisthenics Applied to PHP
 
Crafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterCrafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::Exporter
 
R57shell
R57shellR57shell
R57shell
 
Parsing JSON with a single regex
Parsing JSON with a single regexParsing JSON with a single regex
Parsing JSON with a single regex
 
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonf
 
PHP 5.4
PHP 5.4PHP 5.4
PHP 5.4
 
PHP for Adults: Clean Code and Object Calisthenics
PHP for Adults: Clean Code and Object CalisthenicsPHP for Adults: Clean Code and Object Calisthenics
PHP for Adults: Clean Code and Object Calisthenics
 
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
 
You code sucks, let's fix it
You code sucks, let's fix itYou code sucks, let's fix it
You code sucks, let's fix it
 
Bag of tricks
Bag of tricksBag of tricks
Bag of tricks
 
Object Calisthenics Adapted for PHP
Object Calisthenics Adapted for PHPObject Calisthenics Adapted for PHP
Object Calisthenics Adapted for PHP
 
Symfony components in the wild, PHPNW12
Symfony components in the wild, PHPNW12Symfony components in the wild, PHPNW12
Symfony components in the wild, PHPNW12
 
Rust ⇋ JavaScript
Rust ⇋ JavaScriptRust ⇋ JavaScript
Rust ⇋ JavaScript
 
PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQL
 
Symfony War Stories
Symfony War StoriesSymfony War Stories
Symfony War Stories
 
Shell.php
Shell.phpShell.php
Shell.php
 
An Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackAn Elephant of a Different Colour: Hack
An Elephant of a Different Colour: Hack
 
Gta v savegame
Gta v savegameGta v savegame
Gta v savegame
 
Barcelona.pm Curs1211 sess01
Barcelona.pm Curs1211 sess01Barcelona.pm Curs1211 sess01
Barcelona.pm Curs1211 sess01
 

Viewers also liked

Stateモナドの解説 前編
Stateモナドの解説 前編Stateモナドの解説 前編
Stateモナドの解説 前編Masahiro Honma
 
モナモナ言うモナド入門
モナモナ言うモナド入門モナモナ言うモナド入門
モナモナ言うモナド入門Masahiro Honma
 
すごいMonad入門
すごいMonad入門すごいMonad入門
すごいMonad入門真一 北原
 
関数型プログラミングとモナド
関数型プログラミングとモナド関数型プログラミングとモナド
関数型プログラミングとモナドMasayuki Isobe
 
Sano tokyowebmining 201625_v04
Sano tokyowebmining 201625_v04Sano tokyowebmining 201625_v04
Sano tokyowebmining 201625_v04Masakazu Sano
 
Building GUI App with Electron and Lisp
Building GUI App with Electron and LispBuilding GUI App with Electron and Lisp
Building GUI App with Electron and Lispfukamachi
 
学生時代に知っておきたかったWeb技術の学び方の学び方 | リブセンス
学生時代に知っておきたかったWeb技術の学び方の学び方 | リブセンス学生時代に知っておきたかったWeb技術の学び方の学び方 | リブセンス
学生時代に知っておきたかったWeb技術の学び方の学び方 | リブセンスLivesense Inc.
 

Viewers also liked (8)

Stateモナドの解説 前編
Stateモナドの解説 前編Stateモナドの解説 前編
Stateモナドの解説 前編
 
モナモナ言うモナド入門
モナモナ言うモナド入門モナモナ言うモナド入門
モナモナ言うモナド入門
 
すごいMonad入門
すごいMonad入門すごいMonad入門
すごいMonad入門
 
null使ったら負け福岡版
null使ったら負け福岡版null使ったら負け福岡版
null使ったら負け福岡版
 
関数型プログラミングとモナド
関数型プログラミングとモナド関数型プログラミングとモナド
関数型プログラミングとモナド
 
Sano tokyowebmining 201625_v04
Sano tokyowebmining 201625_v04Sano tokyowebmining 201625_v04
Sano tokyowebmining 201625_v04
 
Building GUI App with Electron and Lisp
Building GUI App with Electron and LispBuilding GUI App with Electron and Lisp
Building GUI App with Electron and Lisp
 
学生時代に知っておきたかったWeb技術の学び方の学び方 | リブセンス
学生時代に知っておきたかったWeb技術の学び方の学び方 | リブセンス学生時代に知っておきたかったWeb技術の学び方の学び方 | リブセンス
学生時代に知っておきたかったWeb技術の学び方の学び方 | リブセンス
 

Similar to 循環参照のはなし

Functional Pe(a)rls version 2
Functional Pe(a)rls version 2Functional Pe(a)rls version 2
Functional Pe(a)rls version 2osfameron
 
Introdução ao Perl 6
Introdução ao Perl 6Introdução ao Perl 6
Introdução ao Perl 6garux
 
The Art of Transduction
The Art of TransductionThe Art of Transduction
The Art of TransductionDavid Stockton
 
Document Classification In PHP
Document Classification In PHPDocument Classification In PHP
Document Classification In PHPIan Barber
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Kang-min Liu
 
Taking Perl to Eleven with Higher-Order Functions
Taking Perl to Eleven with Higher-Order FunctionsTaking Perl to Eleven with Higher-Order Functions
Taking Perl to Eleven with Higher-Order FunctionsDavid Golden
 
Wx::Perl::Smart
Wx::Perl::SmartWx::Perl::Smart
Wx::Perl::Smartlichtkind
 
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6Workhorse Computing
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giantsIan Barber
 
20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked aboutTatsuhiko Miyagawa
 
Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7Masahiro Nagano
 
Document Classification In PHP - Slight Return
Document Classification In PHP - Slight ReturnDocument Classification In PHP - Slight Return
Document Classification In PHP - Slight ReturnIan Barber
 
PHP Functions & Arrays
PHP Functions & ArraysPHP Functions & Arrays
PHP Functions & ArraysHenry Osborne
 
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 TokyoIntroduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 TokyoMasahiro Nagano
 
Modern Application Foundations: Underscore and Twitter Bootstrap
Modern Application Foundations: Underscore and Twitter BootstrapModern Application Foundations: Underscore and Twitter Bootstrap
Modern Application Foundations: Underscore and Twitter BootstrapHoward Lewis Ship
 
Ruby closures, how are they possible?
Ruby closures, how are they possible?Ruby closures, how are they possible?
Ruby closures, how are they possible?Carlos Alonso Pérez
 
Perl Bag of Tricks - Baltimore Perl mongers
Perl Bag of Tricks  -  Baltimore Perl mongersPerl Bag of Tricks  -  Baltimore Perl mongers
Perl Bag of Tricks - Baltimore Perl mongersbrian d foy
 

Similar to 循環参照のはなし (20)

Functional Pe(a)rls version 2
Functional Pe(a)rls version 2Functional Pe(a)rls version 2
Functional Pe(a)rls version 2
 
Introdução ao Perl 6
Introdução ao Perl 6Introdução ao Perl 6
Introdução ao Perl 6
 
The Art of Transduction
The Art of TransductionThe Art of Transduction
The Art of Transduction
 
Document Classification In PHP
Document Classification In PHPDocument Classification In PHP
Document Classification In PHP
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
 
Taking Perl to Eleven with Higher-Order Functions
Taking Perl to Eleven with Higher-Order FunctionsTaking Perl to Eleven with Higher-Order Functions
Taking Perl to Eleven with Higher-Order Functions
 
PHP Tips & Tricks
PHP Tips & TricksPHP Tips & Tricks
PHP Tips & Tricks
 
Wx::Perl::Smart
Wx::Perl::SmartWx::Perl::Smart
Wx::Perl::Smart
 
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
Neatly Hashing a Tree: FP tree-fold in Perl5 & Perl6
 
Mips1
Mips1Mips1
Mips1
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giants
 
20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked about
 
Dades i operadors
Dades i operadorsDades i operadors
Dades i operadors
 
Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7Operation Oriented Web Applications / Yokohama pm7
Operation Oriented Web Applications / Yokohama pm7
 
Document Classification In PHP - Slight Return
Document Classification In PHP - Slight ReturnDocument Classification In PHP - Slight Return
Document Classification In PHP - Slight Return
 
PHP Functions & Arrays
PHP Functions & ArraysPHP Functions & Arrays
PHP Functions & Arrays
 
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 TokyoIntroduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
 
Modern Application Foundations: Underscore and Twitter Bootstrap
Modern Application Foundations: Underscore and Twitter BootstrapModern Application Foundations: Underscore and Twitter Bootstrap
Modern Application Foundations: Underscore and Twitter Bootstrap
 
Ruby closures, how are they possible?
Ruby closures, how are they possible?Ruby closures, how are they possible?
Ruby closures, how are they possible?
 
Perl Bag of Tricks - Baltimore Perl mongers
Perl Bag of Tricks  -  Baltimore Perl mongersPerl Bag of Tricks  -  Baltimore Perl mongers
Perl Bag of Tricks - Baltimore Perl mongers
 

More from Masahiro Honma

レンズ (ぶつかり稽古の没プレゼン)
レンズ (ぶつかり稽古の没プレゼン)レンズ (ぶつかり稽古の没プレゼン)
レンズ (ぶつかり稽古の没プレゼン)Masahiro Honma
 
すべてが@__kanになる
すべてが@__kanになるすべてが@__kanになる
すべてが@__kanになるMasahiro Honma
 
Types and perl language
Types and perl languageTypes and perl language
Types and perl languageMasahiro Honma
 
カレーとHokkaidopm
カレーとHokkaidopmカレーとHokkaidopm
カレーとHokkaidopmMasahiro Honma
 
モナモナ言うモナド入門.tar.gz
モナモナ言うモナド入門.tar.gzモナモナ言うモナド入門.tar.gz
モナモナ言うモナド入門.tar.gzMasahiro Honma
 
Hachioji.pm in Machida の LT
Hachioji.pm in Machida の LTHachioji.pm in Machida の LT
Hachioji.pm in Machida の LTMasahiro Honma
 
ウヰスキーとPSGI
ウヰスキーとPSGIウヰスキーとPSGI
ウヰスキーとPSGIMasahiro Honma
 
モデルから知るGit
モデルから知るGitモデルから知るGit
モデルから知るGitMasahiro Honma
 
YAPCレポートの舞台裏
YAPCレポートの舞台裏YAPCレポートの舞台裏
YAPCレポートの舞台裏Masahiro Honma
 
Stateモナドの解説 後編
Stateモナドの解説 後編Stateモナドの解説 後編
Stateモナドの解説 後編Masahiro Honma
 
Stateモナドの解説 中編
Stateモナドの解説 中編Stateモナドの解説 中編
Stateモナドの解説 中編Masahiro Honma
 

More from Masahiro Honma (20)

レンズ (ぶつかり稽古の没プレゼン)
レンズ (ぶつかり稽古の没プレゼン)レンズ (ぶつかり稽古の没プレゼン)
レンズ (ぶつかり稽古の没プレゼン)
 
すべてが@__kanになる
すべてが@__kanになるすべてが@__kanになる
すべてが@__kanになる
 
Types and perl language
Types and perl languageTypes and perl language
Types and perl language
 
Currying in perl
Currying in perlCurrying in perl
Currying in perl
 
カレーとHokkaidopm
カレーとHokkaidopmカレーとHokkaidopm
カレーとHokkaidopm
 
モナモナ言うモナド入門.tar.gz
モナモナ言うモナド入門.tar.gzモナモナ言うモナド入門.tar.gz
モナモナ言うモナド入門.tar.gz
 
Perl saved a lady.
Perl saved a lady.Perl saved a lady.
Perl saved a lady.
 
Levenshtein Automata
Levenshtein AutomataLevenshtein Automata
Levenshtein Automata
 
20120526 hachioji.pm
20120526 hachioji.pm20120526 hachioji.pm
20120526 hachioji.pm
 
Arrows in perl
Arrows in perlArrows in perl
Arrows in perl
 
Hachioji.pm in Machida の LT
Hachioji.pm in Machida の LTHachioji.pm in Machida の LT
Hachioji.pm in Machida の LT
 
Monads in perl
Monads in perlMonads in perl
Monads in perl
 
ウヰスキーとPSGI
ウヰスキーとPSGIウヰスキーとPSGI
ウヰスキーとPSGI
 
モデルから知るGit
モデルから知るGitモデルから知るGit
モデルから知るGit
 
YAPCレポートの舞台裏
YAPCレポートの舞台裏YAPCレポートの舞台裏
YAPCレポートの舞台裏
 
Git入門
Git入門Git入門
Git入門
 
AnyEvent and Plack
AnyEvent and PlackAnyEvent and Plack
AnyEvent and Plack
 
Math::Category
Math::CategoryMath::Category
Math::Category
 
Stateモナドの解説 後編
Stateモナドの解説 後編Stateモナドの解説 後編
Stateモナドの解説 後編
 
Stateモナドの解説 中編
Stateモナドの解説 中編Stateモナドの解説 中編
Stateモナドの解説 中編
 

Recently uploaded

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

循環参照のはなし

  • 3.
  • 4. my ($ref1, $ref2, $ref3); $ref1 = $ref2; $ref2 = $ref3; $ref3 = $ref1; $ref1 $ref2 $ref3
  • 5. GC Perl GC
  • 10. reference counting 1 1 1 1 2 1 2 1
  • 11. reference counting 1 0 1 1 2 1 2 1
  • 12. reference counting 1 0 1 0 1 1 2 1
  • 13. reference counting 1 0 1 0 1 1 1 1
  • 14. reference counting 1 0 1 0 1 Leak 1 1 1
  • 15. (1) Template::Plugin::Filter (TT-2.2) Template::Plugin return $self->{ _STATIC_FILTER } ||= sub { $self->filter(shift); };
  • 16. (2) AnyEvent my $t; $t = AE::timer 1, 0, sub { ...; undef $t; }; $t sub { ... }
  • 17. (2) AnyEvent my $t; $t = AE::timer 1, 0, sub { ...; undef $t; }; $t sub { ... }
  • 18. (2) AnyEvent my $t; $t = AE::timer 1, 0, sub { ...; undef $t; }; $t
  • 19. (2) AnyEvent my $t; $t = AE::timer 1, 0, sub { ...; undef $t; }; $t
  • 20. (2) AnyEvent my $t; $t = AE::timer 1, 0, sub { ...; undef $t; };
  • 21. (3) my ($f, $x); (sub { $f = sub { $x } })->(); OUTSIDE sub {...} $f == sub { ... }
  • 22. (3) use Devel::Peek; Dump($f); SV = IV(0x100827fd8) at 0x100827fe0 REFCNT = 2 RV = 0x100827878 SV = PVCV(0x10082b5f8) at 0x100827878 REFCNT = 1 GVGV::GV = 0x100856bc0 "main" :: "__ANON__" OUTSIDE = 0x1008032a0 (ANON) SV = PVCV(0x100852a90) at 0x1008032a0 REFCNT = 1 GVGV::GV = 0x100856bc0 "main" :: "__ANON__" PADNAME = 0x1008277e8(0x100287000) PAD = 0x100827800(0x10025c0e0) 1. 0x100827fe0<2> FAKE "$f" flags=0x0 index=1
  • 23. 5 ( ≒ )
  • 24. 1) ps % perl for (1 .. 10000) { my $ref; $ref = $ref; warn `ps -o rss= -p $$` if $_ % 1000 == 0; } 1272 1304 1328 1352 1376 ...
  • 26. 2) Test::LeakTrace use Test::LeakTrace; no_leaks_ok { my $ref; $ref = $ref }; not ok 1 - leaks 1 <= 0 # Failed test 'leaks 1 <= 0' # at - line 4. # '1' # <= # '0' # leaked REF(0x10083b610) from - line 4. # SV = IV(0x10083b608) at 0x10083b610 # REFCNT = 1 # FLAGS = (PADMY,ROK) # RV = 0x10083b610 # SV = IV(0x10083b608) at 0x10083b610 # REFCNT = 1 # FLAGS = (PADMY,ROK) # RV = 0x10083b610 # SV = IV(0x10083b608) at 0x10083b610 # REFCNT = 1 # FLAGS = (PADMY,ROK) # RV = 0x10083b610 # SV = IV(0x10083b608) at 0x10083b610 ...
  • 27. 3) Devel::Cycle use Devel::Cycle; my ($ref1, $ref2, $ref3); $ref1 = $ref2; $ref2 = sub { $ref3 }; $ref3 = [$ref1]; find_cycle($ref1); Cycle (1): $$A => &B $B variable $ref3 => $C $$C => @D $D->[0] => $A
  • 28. 4) Devel::Leak::Object use Devel::Leak::Object qw{GLOBAL_bless}; $Devel::Leak::Object::TRACKSOURCELINES = 1; my $ref; $ref = bless $ref => "XXX"; Tracked objects by class: XXX 1 Sources of leaks: XXX 1 from - line: 3
  • 29. 5) DESTROY sub Ref1::DESTROY { warn "destroyed REF1" } sub Ref2::DESTROY { warn "destroyed REF2" } my $x; my $f = bless sub { $x; bless sub { $x } => "Ref2"; } => "Ref1"; $f->(); destroyed REF2 at - line 2. destroyed REF1 at - line 1.
  • 31. 5
  • 32. $self sub { ... }
  • 33. my $self = {name => "Hokkaido.pm", handler => undef}; $self->{handler} = sub { print "Hello, ", $self->{name}, ".n"; }; $self->{handler}->(); sub { ... } $self “Hokkaido.pm”
  • 34. 1) my $self = {name => "Hokkaido.pm", handler => undef}; $self->{handler} = sub { print "Hello, ", $self->{name}, ".n"; undef $self; }; $self->{handler}->(); sub { ... } $self “Hokkaido.pm”
  • 35. 1) my $self = {name => "Hokkaido.pm", handler => undef}; $self->{handler} = sub { print "Hello, ", $self->{name}, ".n"; undef $self; }; $self->{handler}->(); sub { ... } $self “Hokkaido.pm”
  • 36. 1) my $self = {name => "Hokkaido.pm", handler => undef}; $self->{handler} = sub { print "Hello, ", $self->{name}, ".n"; undef $self; }; $self->{handler}->(); sub { ... } “Hokkaido.pm”
  • 37. 1) my $self = {name => "Hokkaido.pm", handler => undef}; $self->{handler} = sub { print "Hello, ", $self->{name}, ".n"; undef $self; }; $self->{handler}->(); sub { ... } “Hokkaido.pm”
  • 38. 1) my $self = {name => "Hokkaido.pm", handler => undef}; $self->{handler} = sub { print "Hello, ", $self->{name}, ".n"; undef $self; }; $self->{handler}->();
  • 39. 1) ( ) ($self->{handler} )
  • 40. 2) Scalar::Util::weaken my $self = {name => "Hokkaido.pm", handler => undef}; Scalar::Util::weaken(my $weaken_self = $self); $self->{handler} = sub { print "Hello, ", $weaken_self->{name}, ".n"; }; $self->{handler}->(); sub { ... } $self “Hokkaido.pm”
  • 41. 2) Scalar::Util::weaken my $self = {name => "Hokkaido.pm", handler => undef}; Scalar::Util::weaken($self); # $self->{handler} = sub { print "Hello, ", $self->{name}, ".n"; }; $self->{handler}->();
  • 42. 3) my $self = {name => "Hokkaido.pm", handler => undef}; my $name = $self->{name}; $self->{handler} = sub { print "Hello, ", $name, ".n"; }; $self->{handler}->(); sub { ... } $self “Hokkaido.pm”
  • 43. 4) my $self = {name => "Hokkaido.pm", handler => undef}; $self->{handler} = sub { my $self = shift; print "Hello, ", $self->{name}, ".n"; }; $self->{handler}->($self); sub { ... } $self “Hokkaido.pm”
  • 44. 4) AnyEvent::Handler $hdl->push_read (line => sub { my ($hdl, $line) = @_; ... });
  • 45. 5) Data::Decycle use Data::Decycle; my $guard = Data::Decycle->new( my $self = {name => "Hokkaido.pm", handler => undef} ); $self->{handler} = sub { "Hello, ", $self->{name}, ".n"; }; $self->{handler}->();
  • 47.
  • 48. :Perl 5.8.8 use Devel::Leak::Object qw{GLOBAL_bless}; bless my $x = {}, "Dummy"; (sub { sub { $x } })->(); Tracked objects by class: Dummy 1
  • 49. :Perl 5.8.8 my $x = bless {}, "Dummy"; (sub { $x; sub { $x } })->(); my $x = bless {}, "Dummy"; (sub { my $x = $x; sub { warn $x } })->();
  • 50.
  • 51. :Obj-C ARC retain release Perl CBRFuture *future = [[CBRFuture alloc] init]; __weak CBRFuture *weakenFuture = future; leftHandle(self, ^(id e) { current = nil; leftSend(weakenFuture, e); });
  • 52. :Obj-C Guard NSString *local = @"OK"; static void changeLocalValue(BOOL willBreak) { id original = local; CBRGuard *guard = [[CBRGuard alloc] initGuard:^{ local = original; }]; local = @"LOCALVALUE1"; }
  • 53. :Obj-C Guard autorelease

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. &amp;#x3010;5&amp;#x5206;&amp;#x3011;\n
  17. &amp;#x3010;5&amp;#x5206;&amp;#x3011;\n
  18. &amp;#x3010;5&amp;#x5206;&amp;#x3011;\n
  19. &amp;#x3010;5&amp;#x5206;&amp;#x3011;\n
  20. \n
  21. \n
  22. \n
  23. &amp;#x3088;&amp;#x3044;: &amp;#x30EA;&amp;#x30FC;&amp;#x30AF;&amp;#x3057;&amp;#x3066;&amp;#x308B;&amp;#x304B;&amp;#x306E;&amp;#x5224;&amp;#x5B9A;&amp;#x3068;&amp;#x3057;&amp;#x3066;&amp;#x306F;&amp;#x6027;&amp;#x683C;&amp;#x3001;&amp;#x308F;&amp;#x308B;&amp;#x3044;: &amp;#x539F;&amp;#x59CB;&amp;#x7684;&amp;#x3001;&amp;#x74B0;&amp;#x5883;&amp;#x4F9D;&amp;#x5B58;\n
  24. &amp;#x3088;&amp;#x3044;: &amp;#x30EA;&amp;#x30FC;&amp;#x30AF;&amp;#x5168;&amp;#x822C;&amp;#x3092;&amp;#x898B;&amp;#x3064;&amp;#x3051;&amp;#x3089;&amp;#x308C;&amp;#x308B;&amp;#x3001;&amp;#x308F;&amp;#x308B;&amp;#x3044;: &amp;#x7D50;&amp;#x679C;&amp;#x306E;&amp;#x8868;&amp;#x793A;&amp;#x304C;&amp;#x3054;&amp;#x3064;&amp;#x3044;\n
  25. &amp;#x3088;&amp;#x3044;: &amp;#x7D50;&amp;#x679C;&amp;#x304C;&amp;#x307F;&amp;#x3084;&amp;#x3059;&amp;#x3044;&amp;#x3001;&amp;#x3060;&amp;#x3081;: &amp;#x5FAA;&amp;#x74B0;&amp;#x53C2;&amp;#x7167;&amp;#x3092;&amp;#x63A2;&amp;#x3059;&amp;#x3060;&amp;#x3051;&amp;#x3002;XS&amp;#x306E;&amp;#x30EA;&amp;#x30FC;&amp;#x30AF;&amp;#x306F;&amp;#x691C;&amp;#x51FA;&amp;#x3067;&amp;#x304D;&amp;#x306A;&amp;#x3044;&amp;#x3002;OUTER&amp;#x7D61;&amp;#x307F;&amp;#x3082;&amp;#x7121;&amp;#x7406;&amp;#x307D;&amp;#x3002;\n\n
  26. &amp;#x3088;&amp;#x3044;: &amp;#x7C21;&amp;#x5358;&amp;#x306B;&amp;#x30EA;&amp;#x30FC;&amp;#x30AF;&amp;#x691C;&amp;#x51FA;&amp;#x3001; &amp;#x308F;&amp;#x308B;&amp;#x3044;: &amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x9650;&amp;#x5B9A;\n
  27. &amp;#x3010;10&amp;#x5206;&amp;#x3011;&amp;#x3088;&amp;#x3044;: &amp;#x89E3;&amp;#x653E;&amp;#x30BF;&amp;#x30A4;&amp;#x30DF;&amp;#x30F3;&amp;#x30B0;&amp;#x304C;&amp;#x6B63;&amp;#x78BA;&amp;#x306B;&amp;#x308F;&amp;#x304B;&amp;#x308B;(&amp;#x4E2D;&amp;#x306E;&amp;#x30AF;&amp;#x30ED;&amp;#x30FC;&amp;#x30B8;&amp;#x30E3;&amp;#x304B;&amp;#x3089;&amp;#x89E3;&amp;#x653E;&amp;#x3055;&amp;#x308C;&amp;#x308B;) &amp;#x308F;&amp;#x308B;&amp;#x3044;: &amp;#x3072;&amp;#x3069;&amp;#x3044;&amp;#x30CF;&amp;#x30C3;&amp;#x30AF;\n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. &amp;#x3010;15&amp;#x5206;&amp;#x3011;undef &amp;#x30A8;&amp;#x30E9;&amp;#x30FC;&amp;#x306E;&amp;#x539F;&amp;#x56E0;&amp;#x3068;&amp;#x306A;&amp;#x308B;&amp;#x3002;&amp;#x3053;&amp;#x306E;&amp;#x4F8B;&amp;#x3060;&amp;#x3068;&amp;#x30EA;&amp;#x30FC;&amp;#x30AF;&amp;#x3059;&amp;#x308B;&amp;#x3002;\n
  41. &amp;#x3053;&amp;#x306E;&amp;#x4F8B;&amp;#x3060;&amp;#x3068;&amp;#x3001;weaken&amp;#x3088;&amp;#x308A;&amp;#x3053;&amp;#x3061;&amp;#x3089;&amp;#x304C;&amp;#x81EA;&amp;#x7136;\n
  42. API&amp;#x3092;&amp;#x5909;&amp;#x66F4;&amp;#x3057;&amp;#x3001;&amp;#x30AF;&amp;#x30ED;&amp;#x30FC;&amp;#x30B8;&amp;#x30E3;&amp;#x3092;&amp;#x6E21;&amp;#x3055;&amp;#x305A;&amp;#x306B;&amp;#x3059;&amp;#x3080;&amp;#x3088;&amp;#x3046;&amp;#x306B;&amp;#x3059;&amp;#x308B;\n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. &amp;#x7532;&amp;#x6590;&amp;#x4E92;&amp;#x63DB;&amp;#x306E;&amp;#x305F;&amp;#x3081;&amp;#x306B;autorelease &amp;#x3067;&amp;#x8FD4;&amp;#x3057;&amp;#x3066;&amp;#x304F;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x304C;&amp;#x3042;&amp;#x308B;&amp;#x304C;&amp;#x3001;&amp;#x305D;&amp;#x308C;&amp;#x3060;&amp;#x3068;&amp;#x3046;&amp;#x307E;&amp;#x304F;&amp;#x3044;&amp;#x304B;&amp;#x306A;&amp;#x3044;&amp;#x3002;&amp;#x4ED5;&amp;#x69D8;&amp;#x3092;&amp;#x3088;&amp;#x304F;&amp;#x8ABF;&amp;#x3079;&amp;#x308B;&amp;#x5FC5;&amp;#x8981;&amp;#x3042;&amp;#x308A;&amp;#x3002;\n
  52. \n