Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6e38d5be
Commit
6e38d5be
authored
Dec 21, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Dec 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcr100: Added _aligned_msize implementation.
parent
dfca87db
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
3 deletions
+56
-3
msvcr100.c
dlls/msvcr100/msvcr100.c
+20
-0
msvcr100.spec
dlls/msvcr100/msvcr100.spec
+1
-1
msvcr100.c
dlls/msvcr100/tests/msvcr100.c
+33
-0
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+1
-1
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+1
-1
No files found.
dlls/msvcr100/msvcr100.c
View file @
6e38d5be
...
...
@@ -483,6 +483,26 @@ int CDECL _get_timezone(LONG *timezone)
return
0
;
}
/* copied from dlls/msvcrt/heap.c */
#define SAVED_PTR(x) ((void *)((DWORD_PTR)((char *)x - sizeof(void *)) & \
~(sizeof(void *) - 1)))
/*********************************************************************
* _aligned_msize (MSVCR100.@)
*/
size_t
CDECL
_aligned_msize
(
void
*
p
,
size_t
alignment
,
size_t
offset
)
{
void
**
alloc_ptr
;
if
(
!
CHECK_PMT
(
p
))
return
-
1
;
if
(
alignment
<
sizeof
(
void
*
))
alignment
=
sizeof
(
void
*
);
alloc_ptr
=
SAVED_PTR
(
p
);
return
_msize
(
*
alloc_ptr
)
-
alignment
-
sizeof
(
void
*
);
}
/*********************************************************************
* DllMain (MSVCR100.@)
*/
...
...
dlls/msvcr100/msvcr100.spec
View file @
6e38d5be
...
...
@@ -678,7 +678,7 @@
@ extern _acmdln msvcrt._acmdln
@ cdecl _aligned_free(ptr) msvcrt._aligned_free
@ cdecl _aligned_malloc(long long) msvcrt._aligned_malloc
@
stub _aligned_msize
@
cdecl _aligned_msize(ptr long long)
@ cdecl _aligned_offset_malloc(long long long) msvcrt._aligned_offset_malloc
@ cdecl _aligned_offset_realloc(ptr long long long) msvcrt._aligned_offset_realloc
@ stub _aligned_offset_recalloc
...
...
dlls/msvcr100/tests/msvcr100.c
View file @
6e38d5be
...
...
@@ -72,6 +72,9 @@ static int (__cdecl *p_wmemmove_s)(wchar_t *dest, size_t numberOfElements, const
static
FILE
*
(
__cdecl
*
p_fopen
)(
const
char
*
,
const
char
*
);
static
int
(
__cdecl
*
p_fclose
)(
FILE
*
);
static
size_t
(
__cdecl
*
p_fread_s
)(
void
*
,
size_t
,
size_t
,
size_t
,
FILE
*
);
static
void
*
(
__cdecl
*
p__aligned_offset_malloc
)(
size_t
,
size_t
,
size_t
);
static
void
(
__cdecl
*
p__aligned_free
)(
void
*
);
static
size_t
(
__cdecl
*
p__aligned_msize
)(
void
*
,
size_t
,
size_t
);
/* make sure we use the correct errno */
#undef errno
...
...
@@ -98,6 +101,9 @@ static BOOL init(void)
SET
(
p_fopen
,
"fopen"
);
SET
(
p_fclose
,
"fclose"
);
SET
(
p_fread_s
,
"fread_s"
);
SET
(
p__aligned_offset_malloc
,
"_aligned_offset_malloc"
);
SET
(
p__aligned_free
,
"_aligned_free"
);
SET
(
p__aligned_msize
,
"_aligned_msize"
);
return
TRUE
;
}
...
...
@@ -326,6 +332,32 @@ static void test_fread_s(void)
unlink
(
test_file
);
}
static
void
test__aligned_msize
(
void
)
{
void
*
mem
;
int
ret
;
mem
=
p__aligned_offset_malloc
(
23
,
16
,
7
);
ret
=
p__aligned_msize
(
mem
,
16
,
7
);
ok
(
ret
==
23
,
"_aligned_msize returned %d
\n
"
,
ret
);
ret
=
p__aligned_msize
(
mem
,
15
,
7
);
ok
(
ret
==
24
,
"_aligned_msize returned %d
\n
"
,
ret
);
ret
=
p__aligned_msize
(
mem
,
11
,
7
);
ok
(
ret
==
28
,
"_aligned_msize returned %d
\n
"
,
ret
);
ret
=
p__aligned_msize
(
mem
,
1
,
7
);
ok
(
ret
==
39
-
sizeof
(
void
*
),
"_aligned_msize returned %d
\n
"
,
ret
);
ret
=
p__aligned_msize
(
mem
,
8
,
0
);
todo_wine
ok
(
ret
==
32
,
"_aligned_msize returned %d
\n
"
,
ret
);
p__aligned_free
(
mem
);
mem
=
p__aligned_offset_malloc
(
3
,
16
,
0
);
ret
=
p__aligned_msize
(
mem
,
16
,
0
);
ok
(
ret
==
3
,
"_aligned_msize returned %d
\n
"
,
ret
);
ret
=
p__aligned_msize
(
mem
,
11
,
0
);
ok
(
ret
==
8
,
"_aligned_msize returned %d
\n
"
,
ret
);
p__aligned_free
(
mem
);
}
START_TEST
(
msvcr100
)
{
if
(
!
init
())
...
...
@@ -334,4 +366,5 @@ START_TEST(msvcr100)
test_wmemcpy_s
();
test_wmemmove_s
();
test_fread_s
();
test__aligned_msize
();
}
dlls/msvcr80/msvcr80.spec
View file @
6e38d5be
...
...
@@ -334,7 +334,7 @@
@ extern _aexit_rtn msvcrt._aexit_rtn
@ cdecl _aligned_free(ptr) msvcrt._aligned_free
@ cdecl _aligned_malloc(long long) msvcrt._aligned_malloc
@
stub
_aligned_msize
@
cdecl _aligned_msize(ptr long long) msvcr100.
_aligned_msize
@ cdecl _aligned_offset_malloc(long long long) msvcrt._aligned_offset_malloc
@ cdecl _aligned_offset_realloc(ptr long long long) msvcrt._aligned_offset_realloc
@ stub _aligned_offset_recalloc
...
...
dlls/msvcr90/msvcr90.spec
View file @
6e38d5be
...
...
@@ -326,7 +326,7 @@
@ extern _aexit_rtn msvcrt._aexit_rtn
@ cdecl _aligned_free(ptr) msvcrt._aligned_free
@ cdecl _aligned_malloc(long long) msvcrt._aligned_malloc
@
stub
_aligned_msize
@
cdecl _aligned_msize(ptr long long) msvcr100.
_aligned_msize
@ cdecl _aligned_offset_malloc(long long long) msvcrt._aligned_offset_malloc
@ cdecl _aligned_offset_realloc(ptr long long long) msvcrt._aligned_offset_realloc
@ stub _aligned_offset_recalloc
...
...
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