Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clean-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
clean-platform
Commits
bbe0c239
Commit
bbe0c239
authored
Jan 11, 2018
by
Mart Lubbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add error detection and free pointer
parent
980806ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/libraries/OS-Posix/System/Time.icl
src/libraries/OS-Posix/System/Time.icl
+6
-6
No files found.
src/libraries/OS-Posix/System/Time.icl
View file @
bbe0c239
implementation
module
System
.
Time
import
StdString
,
StdArray
,
StdClass
,
StdOverloaded
,
StdInt
import
StdString
,
StdArray
,
StdClass
,
StdOverloaded
,
StdInt
,
StdMisc
import
System
.
_Pointer
,
System
.
_Posix
import
Text
...
...
@@ -171,8 +171,8 @@ nsTime :: !*World -> (!Timespec, !*World)
nsTime
w
#
(
p
,
w
)
=
mallocSt
16
w
#
(
r
,
w
)
=
clock_gettime
0
p
w
=
derefTimespec
p
w
//Include world to force evaluation order...
derefTimespec
::
!
Pointer
!*
w
->
(!
Timespec
,
!*
w
)
derefTimespec
p
w
=
({
Timespec
|
tv_sec
=
readInt
p
0
,
tv_nsec
=
readInt
p
8
},
w
)
//For completeness sake
|
r
==
-1
=
abort
"clock_gettime error: everyone should have permission to open CLOCK_REALTIME?"
#
(
tv_sec
,
p
)
=
readIntP
p
0
#
(
tv_nsec
,
p
)
=
readIntP
p
8
=
({
Timespec
|
tv_sec
=
tv_sec
,
tv_nsec
=
tv_nsec
},
freeSt
p
w
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment