ATS_DYNLOADFLAG

16 views
Skip to first unread message

Mike Jones

unread,
Dec 29, 2015, 1:44:29 PM12/29/15
to ats-lang-users
Does ATS_DYNLOADFLAG 0 in a dats file mean automatically init the file if compiled, or just prevent compile errors if not dyloaded, meaning do not do this if there are values to init?

Hongwei Xi

unread,
Dec 29, 2015, 1:50:20 PM12/29/15
to ats-lan...@googlegroups.com
Normally, ATS compiler generates a function for each file
that must be called before values and functions defined in
the file can be used.

If ATS_DYNLOADFLAG is set to 0, then such a function is not
generated and the programmer needs to take care of issue of initialization
on their own. Just like in C.


On Tue, Dec 29, 2015 at 1:44 PM, Mike Jones <proc...@gmail.com> wrote:
Does ATS_DYNLOADFLAG 0 in a dats file mean automatically init the file if compiled, or just prevent compile errors if not dyloaded, meaning do not do this if there are values to init?

--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/6f5980f9-29d6-4403-a478-0e8ec74d91b6%40googlegroups.com.

Barry Schwartz

unread,
Dec 29, 2015, 2:15:46 PM12/29/15
to ats-lan...@googlegroups.com
Hongwei Xi <gmh...@gmail.com> skribis:
> Normally, ATS compiler generates a function for each file
> that must be called before values and functions defined in
> the file can be used.
>
> If ATS_DYNLOADFLAG is set to 0, then such a function is not
> generated and the programmer needs to take care of issue of initialization
> on their own. Just like in C.

Yeah, I’m using ATS to make C libraries and so in those cases set
ATS_DYNLOADFLAG to 0 and invent workarounds to avoid having any ‘val’
at top level. (libatomic_ops could be useful for that BTW.)
Reply all
Reply to author
Forward
0 new messages