[quickjs-devel] Re: DupValue / FreeValue for JS_UNDEFINED

  • From: Saúl Ibarra Corretgé <s@xxxxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Wed, 14 Aug 2019 08:30:09 +0200

On 13/08/2019 23:43, Charlie Gordon wrote:

JS_UNDEFINED as well as all non refcounted values (null, booleans, integers, 
exception...),  can be passed to JS_DupValue and JS_FreeValue harmlessly.

This is fantastic. I remember in CPython Py_None is refcounted too, so
that was a pain :-/

If you know a value is not refcounted, you can skip the calls too.


Great! In my use case I was just calling DupValue without checking. Glad
to know it's safe :-)


Cheers,

Chqrlie.

On 13 Aug 2019, at 23:32, Saúl Ibarra Corretgé <s@xxxxxxxxxx> wrote:

Hey there,

Is extra care (as in, do the calls to dup / free need to be balanced)
needed for JS_UNDEFINED or can one DupValue / FreeValue it without much
regard?


Cheers,

-- 
Saúl





-- 
Saúl

Other related posts: