[ruby-core:65307] [ruby-trunk - Feature #10238] todo: remove dependency on malloc_usable_size

From: normalperson@...
Date: 2014-09-28 04:20:44 UTC
List: ruby-core #65307
Issue #10238 has been updated by Eric Wong.


 nobu@ruby-lang.org wrote:
 > If it's a `Fixnum`, the size should be 0 for NULL `ptr`.
 
 I was under the impression DATA_PTR is not NULL in nearly all cases,
 but I did not check closely for all those classes.
 
 But this patch may not be possible anyways since some platforms may have
 non-word-aligned functions :<
 
 > `enc_memsize` seems unnecessary anyway, indeed.
 
 I'm a little curious about that, actually; but haven't gotten around
 to investigating.

----------------------------------------
Feature #10238: todo: remove dependency on malloc_usable_size
https://bugs.ruby-lang.org/issues/10238#change-49126

* Author: Eric Wong
* Status: Open
* Priority: Normal
* Assignee: 
* Category: core
* Target version: Next Major
----------------------------------------
malloc_usable_size shows up at or near the top of many profiles for me.

We should be able to use ruby_sized_xfree in more places; especially
if rb_data_type_t->dsize is defined.

One possible improvement is to allow the rb_data_type_t->dsize pointer
to be a FIXNUM, removing the need for some memsize functions.

Furthermore, over-accounting malloc-ed bytes (presumably the reason
malloc_usable_size was introduced). should be less harmful nowadays with
incremental marking.




-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next