From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 4ED321F953; Tue, 30 Nov 2021 06:49:40 +0000 (UTC) Date: Tue, 30 Nov 2021 06:49:40 +0000 From: Eric Wong To: KJ Tsanaktsidis Cc: raindrops-public@yhbt.net Subject: Re: [PATCH v2] Allow Raindrops objects to be backed by a file Message-ID: <20211130064940.GA8716@dcvr> References: <20211125065618.3432-1-ktsanaktsidis@zendesk.com> <20211126183400.GA9579@dcvr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: KJ Tsanaktsidis wrote: > On Sat, Nov 27, 2021 at 5:34 AM Eric Wong wrote: > > s/theat/that/ (I can squash this in on my end) > > Uh, sorry about that. I could have sworn I did a pass looking for > typos. Apparently I missed a few. No worries, I slip plenty of typos into stuff I've pushed out :x > > > static VALUE init_copy(VALUE dest, VALUE source) > > > > Switching from file-backed to anonymous seems strange to me, > > here, but I'm not sure of a better solution that's compatible > > with Object#dup ... I also don't know if anybody uses > > Raindrops#dup, either. So if you're satisfied with this > > behavior, that's good enough for me :> > > I did wonder what I should do here. Could _also_ dup the file descriptor, > but then the raindrops will still share memory, which seems like the > opposite of what #dup should do. If someone wants to do something > different I guess the copy-constructor-ish initialize method could be > exposed for this purpose. Agreed. We'll just leave things as-is for now; the API doesn't have many direct users. > Nope, this was it. Memfd is exactly equivalent to just using an > unlinked tempfile on tmpfs so doing it this way will suit our needs > nicely. If anybody else desperately wants to use memfd here I don't > think there's much more to it than > > IO.new syscall(319, "file_name", 0) I seem to recall there was some talk in the past about deprecating the "syscall" method from Ruby. But Fiddle should work, too. > Anyway, thanks again for your help with this, and thanks also for > bearing with my very rusty git email workflow :) No problem, pushed to https://yhbt.net/raindrops.git as commit 18ee38af90b527f6 (Allow Raindrops objects to be backed by a file, 2021-11-25) Hopefully some work I've done elsewhere can get more folks using centralization-resistant workflows and tools. Anyways, I'll tag a release sometime in the next few days.