[quickjs-devel] Re: JSValue management and GC questions

  • From: Ondřej Jirman <deibeemoocheuguhumoh@xxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Tue, 21 Jan 2020 12:10:19 +0100

On Tue, Jan 21, 2020 at 12:07:08PM +0530, JM wrote:

Thanks, However, I am not freeing any values after JS_Call() and hence I
expected leaked report/assert at the time of freeing the runtime which is
not the case, Hence I am wondering is JS_Call() is freeing the arguments.

Not all value types are reference counted. Only ref-counted type values will
be in the report.

regards,
        o.

On Tue, Jan 21, 2020 at 11:59 AM siney <sineysan@xxxxxxx> wrote:

1)     Yes, you muse JS_FreeValue call arguments after JS_Call;

2)     Yes, you can use JS_DupValue to mark an object (inc referrence)
and JS_FreeValue to (dec reference).



*发件人**: *<quickjs-devel-bounce@xxxxxxxxxxxxx> 代表 JM <jeevhi@xxxxxxxxx>
*答复**: *<quickjs-devel@xxxxxxxxxxxxx>
*日期**: *2020年1月21日 星期二 下午1:15
*收件人**: *<quickjs-devel@xxxxxxxxxxxxx>
*主题**: *[quickjs-devel] JSValue management and GC questions



Can someone clarify these



1) Does the number of arguments passed to JS_Call() needs to be freed
after the execution or will it be freed by the JS_Call()

2) Does the object created by C APIs are subject to GC? if yes, is there a
way to mark object from garbage collected



Thank you for providing insight.


Other related posts: