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: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id A18C01F454 for ; Tue, 5 Nov 2019 07:46:20 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id B1563120A3E; Tue, 5 Nov 2019 16:46:09 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 69813120A21 for ; Tue, 5 Nov 2019 16:46:07 +0900 (JST) Received: by filter0073p3iad2.sendgrid.net with SMTP id filter0073p3iad2-32162-5DC128C2-5F 2019-11-05 07:46:10.849362361 +0000 UTC m=+45498.632074507 Received: from herokuapp.com (unknown [54.204.69.61]) by ismtpd0052p1iad1.sendgrid.net (SG) with ESMTP id EbeJn8EnRECCvwJPMeq72g for ; Tue, 05 Nov 2019 07:46:10.732 +0000 (UTC) Date: Tue, 05 Nov 2019 07:46:10 +0000 (UTC) From: shyouhei@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 71281 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 16290 X-Redmine-Issue-Author: watson1978 X-Redmine-Sender: shyouhei X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?jcfQDMoo=2FMGCmP3uu1SeyLQUxUPXq5PjHpHz3xSFn17FZtU5gmna=2FzwlKGmvvA?= =?us-ascii?Q?Mg=2FRsPYfT1dFbiZBeNe=2F6NN2aeqTMoMnfdNMaJO?= =?us-ascii?Q?y0oWRUQ3OXfQaNMrw8hlKPfVGnxKkYJ9FKvX6U0?= =?us-ascii?Q?gimvDkCzwkDETK+GnM1ubeKzLkqzzxaTNthtCCK?= =?us-ascii?Q?msqRQizPyHINkG+hPERx5BbM6PnrDWJkiuw=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 95689 Subject: [ruby-core:95689] [Ruby master Feature#16290] Add Ruby C API to acquire aligned memory X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #16290 has been updated by shyouhei (Shyouhei Urabe). naruse (Yui NARUSE) wrote: > shyouhei (Shyouhei Urabe) wrote: > > I'm not in favor of this. There are many ways to allocate a memory region, like mmap(2). Do we have to provide ruby counterparts for every and all of them? > > rb_aligned_malloc uses 5 underlying implementations. > It's hard to make C-extension developer to re-develop this. In case of this request, ImageMagick already _does_ have aligned allocator. If we provide one we would use any of 5 backends but that is not required at all. They already have it. What is wanted is a way to notify ruby about their memory usage. ---------------------------------------- Feature #16290: Add Ruby C API to acquire aligned memory https://bugs.ruby-lang.org/issues/16290#change-82477 * Author: watson1978 (Shizuo Fujita) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- Related to https://github.com/ruby/ruby/pull/2614 I have required to acquire aligned memory in Ruby C-extension library (https://github.com/rmagick/rmagick/pull/832). I want an API that notifies acquired size to Ruby GC. Of course, I know that we can implement a similar function in extension library using rb_gc_adjust_memory_usage(). However, if Ruby have the API, we can easily use it in some extension libraries. -- https://bugs.ruby-lang.org/