]> Sergey Matveev's repositories - public-inbox.git/commitdiff
syscall: get rid of epoll_defined() sub
authorEric Wong <e@80x24.org>
Fri, 23 Dec 2022 12:51:07 +0000 (12:51 +0000)
committerEric Wong <e@80x24.org>
Fri, 23 Dec 2022 22:20:36 +0000 (22:20 +0000)
We can just check defined() on the `our' var itself and
save the process several kilobytes of memory.

lib/PublicInbox/DS.pm
lib/PublicInbox/Syscall.pm

index 268406628788931b56d71f31e5a8203c2ce963db..a6c43b22d960ae9c01765e126677f3521c44e115 100644 (file)
@@ -126,7 +126,7 @@ sub add_uniq_timer { # ($name, $secs, $coderef, @args) = @_;
 
 # caller sets return value to $Epoll
 sub _InitPoller () {
-       if (PublicInbox::Syscall::epoll_defined())  {
+       if (defined $PublicInbox::Syscall::SYS_epoll_create)  {
                my $fd = epoll_create();
                die "epoll_create: $!" if $fd < 0;
                open($ep_io, '+<&=', $fd) or return;
index ee4c61072214bd9143b0e1b3a7b5511cdbd13e30..bda9bbb049f3ed1a62030b8f563accef16572838 100644 (file)
@@ -285,8 +285,6 @@ if ($^O eq "linux") {
 # epoll functions
 ############################################################################
 
-sub epoll_defined { $SYS_epoll_create ? 1 : 0; }
-
 sub epoll_create {
        syscall($SYS_epoll_create, $no_deprecated ? 0 : 100);
 }