[ruby-core:87434] Re: [Ruby trunk Feature#14819] Efficient cstring to RVALUE typecasting for c extension gems

From: Eric Wong <normalperson@...>
Date: 2018-06-06 21:07:59 UTC
List: ruby-core #87434
lars@greiz-reinsdorf.de wrote:
> > I think a better path would be to bundle timegm for systems without it.

> And that's the problem. We have 3 implementations (each at
> least 500 LOC) of timegm/mktime then: one in ruby core, one in
> libc and another one in pg. And we can only hope that they all
> return the same result, when called with the same input
> values. To my experience they don't.

Interesting (and sad) that they don't :<

Fwiw, Ruby doesn't have an exact timegm replacement.
We (the core team) generally prefer to keep the C API small
to allow future improvements to be made more easily, so I'm
not sure how readily exposing something like rb_timegm(struct tm *)
would be accepted.

A bigger problem is probably rb_funcall*, which doesn't benefit
from inline caching at all...

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next