Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
12229aee
Commit
12229aee
authored
May 24, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
May 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Change the way how localtime/gmtime buffer is stored in __thread_data.
parent
e15ac98c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
main.c
dlls/msvcrt/main.c
+1
-0
msvcrt.h
dlls/msvcrt/msvcrt.h
+1
-1
time.c
dlls/msvcrt/time.c
+10
-4
No files found.
dlls/msvcrt/main.c
View file @
12229aee
...
...
@@ -73,6 +73,7 @@ static inline void msvcrt_free_tls_mem(void)
HeapFree
(
GetProcessHeap
(),
0
,
tls
->
wasctime_buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
tls
->
strerror_buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
tls
->
wcserror_buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
tls
->
time_buffer
);
free_locinfo
(
tls
->
locinfo
);
free_mbcinfo
(
tls
->
mbcinfo
);
}
...
...
dlls/msvcrt/msvcrt.h
View file @
12229aee
...
...
@@ -172,7 +172,7 @@ struct __thread_data {
void
*
unk2
[
4
];
char
*
asctime_buffer
;
/* buffer for asctime */
MSVCRT_wchar_t
*
wasctime_buffer
;
/* buffer for wasctime */
struct
MSVCRT_tm
time_buffer
;
/* buffer for localtime/gmtime */
struct
MSVCRT_tm
*
time_buffer
;
/* buffer for localtime/gmtime */
char
*
efcvt_buffer
;
/* buffer for ecvt/fcvt */
int
unk3
[
2
];
void
*
unk4
[
4
];
...
...
dlls/msvcrt/time.c
View file @
12229aee
...
...
@@ -212,10 +212,13 @@ struct MSVCRT_tm* CDECL MSVCRT__localtime64(const MSVCRT___time64_t* secs)
}
data
=
msvcrt_get_thread_data
();
unix_tm_to_msvcrt
(
&
data
->
time_buffer
,
tm
);
if
(
!
data
->
time_buffer
)
data
->
time_buffer
=
MSVCRT_malloc
(
sizeof
(
struct
MSVCRT_tm
));
unix_tm_to_msvcrt
(
data
->
time_buffer
,
tm
);
_munlock
(
_TIME_LOCK
);
return
&
data
->
time_buffer
;
return
data
->
time_buffer
;
}
/*********************************************************************
...
...
@@ -344,9 +347,12 @@ struct MSVCRT_tm* CDECL MSVCRT__gmtime64(const MSVCRT___time64_t *secs)
{
thread_data_t
*
const
data
=
msvcrt_get_thread_data
();
if
(
MSVCRT__gmtime64_s
(
&
data
->
time_buffer
,
secs
))
if
(
!
data
->
time_buffer
)
data
->
time_buffer
=
MSVCRT_malloc
(
sizeof
(
struct
MSVCRT_tm
));
if
(
MSVCRT__gmtime64_s
(
data
->
time_buffer
,
secs
))
return
NULL
;
return
&
data
->
time_buffer
;
return
data
->
time_buffer
;
}
/*********************************************************************
...
...
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