user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 1/2] syscall: get rid of epoll_defined() sub
  2022-12-23 12:51  6% [PATCH 0/2] syscall debloating Eric Wong
@ 2022-12-23 12:51  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2022-12-23 12:51 UTC (permalink / raw)
  To: meta

We can just check defined() on the `our' var itself and
save the process several kilobytes of memory.
---
 lib/PublicInbox/DS.pm      | 2 +-
 lib/PublicInbox/Syscall.pm | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm
index 26840662..a6c43b22 100644
--- a/lib/PublicInbox/DS.pm
+++ b/lib/PublicInbox/DS.pm
@@ -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;
diff --git a/lib/PublicInbox/Syscall.pm b/lib/PublicInbox/Syscall.pm
index ee4c6107..bda9bbb0 100644
--- a/lib/PublicInbox/Syscall.pm
+++ b/lib/PublicInbox/Syscall.pm
@@ -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);
 }

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/2] syscall debloating
@ 2022-12-23 12:51  6% Eric Wong
  2022-12-23 12:51  7% ` [PATCH 1/2] syscall: get rid of epoll_defined() sub Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2022-12-23 12:51 UTC (permalink / raw)
  To: meta

syscall.ph has the potential to be dangerously wrong, so I'm
avoiding it.

Preparing to finally add inotify syscall numbers support so I
can get rid of Linux::Inotify2 and the common::sense package it
pulls in.

I'm also tempted to drop some abandoned architectures (e.g.  IA-64)
since there's no cfarm machines to test with.

Eric Wong (2):
  syscall: get rid of epoll_defined() sub
  syscall: drop syscall.ph support

 lib/PublicInbox/DS.pm      |  2 +-
 lib/PublicInbox/Syscall.pm | 36 ++++++------------------------------
 2 files changed, 7 insertions(+), 31 deletions(-)

^ permalink raw reply	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2022-12-23 12:51  6% [PATCH 0/2] syscall debloating Eric Wong
2022-12-23 12:51  7% ` [PATCH 1/2] syscall: get rid of epoll_defined() sub Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).