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=-2.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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 7F10A1F454 for ; Tue, 5 Nov 2019 07:26:22 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 53ABF120A3C; Tue, 5 Nov 2019 16:26:11 +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 68241120A36 for ; Tue, 5 Nov 2019 16:26:09 +0900 (JST) Received: by filter0167p3mdw1.sendgrid.net with SMTP id filter0167p3mdw1-1059-5DC12414-31 2019-11-05 07:26:12.988539019 +0000 UTC m=+25433.282842200 Received: from herokuapp.com (unknown [54.204.69.61]) by ismtpd0048p1iad2.sendgrid.net (SG) with ESMTP id OZcL9MyJSiiN0lR-QwZXHQ for ; Tue, 05 Nov 2019 07:26:12.931 +0000 (UTC) Date: Tue, 05 Nov 2019 07:26:13 +0000 (UTC) From: naruse@airemix.jp Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 71280 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 16290 X-Redmine-Issue-Author: watson1978 X-Redmine-Sender: naruse 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?UqoG4vcRhHM9V1I4f4J7DhjzUfTg+8muXbMD6UD+LVSOm3vf938s6=2FALuAH4rr?= =?us-ascii?Q?ZH=2FwykHOHHsd4klNl4OQ1QzfmRnZKdctQu03C7+?= =?us-ascii?Q?GLLQe6Fyu=2FnDtgcGyE8C+hqoFyp0jOvuxBBnqm7?= =?us-ascii?Q?2qmsci3X3Me0jVi+qiMbaEQZWrGGUx+FMo2of6Y?= =?us-ascii?Q?ETGGdHvzVWOakWMoxsX6tPwas427CZLCZYA=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 95688 Subject: [ruby-core:95688] [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 naruse (Yui NARUSE). 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. It sounds reasonable to make public this implementation. https://github.com/ruby/ruby/blob/853d91a04a4d133fc90b35c90570dc1c656a7922/gc.c#L9736-L9761 We don't have mmap(2) wrapper. ---------------------------------------- Feature #16290: Add Ruby C API to acquire aligned memory https://bugs.ruby-lang.org/issues/16290#change-82476 * 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/