Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use localtime_r instead of localtime #381

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

promovicz
Copy link
Member

localtime is not reentrant.

localtime is not reentrant.
@@ -109,7 +109,7 @@ define method native-clock-to-tm (time :: <machine-word>) => (tm :: <machine-wor
:= primitive-unwrap-machine-word(time);
let tm = primitive-wrap-machine-word
(primitive-cast-pointer-as-raw
(%call-c-function ("localtime")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use with-storage ... you can get the size from a call into C, I guess (or another magic constant), but a define constant $tm-size = primitive-whatever(%call-c-function("dylan_sizeof_tm") ... ); shouldn't be that bad.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(And I know that with-storage uses GC_malloc ... that's something that will change later.)

@waywardmonkeys
Copy link
Member

In addition to the comments on the code, I'm hoping that we can be better with release notes going forward ... so a release note addition, including what Dylan level stuff this impacts would be nice.

@waywardmonkeys
Copy link
Member

Hmm, given the structure if the surrounding code, I see why it is this way and not with-structure...

@opendylan-jenkins
Copy link

Test FAILed.
Refer to this link for build results: https://jenkins.opendylan.org/job/opendylan-build-linux-lucid-x86/240/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants