[ruby-core:63963] [ruby-trunk - Feature #10082] [PATCH] add ZALLOC* macros to reduce ALLOC + MEMZERO calls

From: tad.a.digger@...
Date: 2014-07-23 10:58:45 UTC
List: ruby-core #63963
Issue #10082 has been updated by Tadashi Saito.


> I considered ZALLOC_N == CALLOC, but the arguments are reversed
> for calloc(3), so I didn't want to risk that confusion, either.

I agree with your concern.  ZALLOC may be better.

(My only concern is that zlib uses "zalloc" as its API, but we will
not have to worry about it:
https://github.com/ruby/ruby/blob/543b402/ext/zlib/zlib.c#L609 )

----------------------------------------
Feature #10082: [PATCH] add ZALLOC* macros to reduce ALLOC + MEMZERO calls
https://bugs.ruby-lang.org/issues/10082#change-47983

* Author: Eric Wong
* Status: Open
* Priority: Normal
* Assignee: Koichi Sasada
* Category: core
* Target version: current: 2.2.0
----------------------------------------
This reduces code and binary sizes.
ZALLOC macros are accessible via public API for exts

OK to add this API?  It should simplify some code and reduce typos.


---Files--------------------------------
zalloc.patch (7.4 KB)


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

In This Thread

Prev Next