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
bfaf9013
Commit
bfaf9013
authored
Jan 15, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Jan 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compobj: Implement reference counting for the standard allocator.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9af935a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
15 deletions
+21
-15
compobj.c
dlls/compobj.dll16/compobj.c
+20
-14
compobj.dll16.spec
dlls/compobj.dll16/compobj.dll16.spec
+1
-1
No files found.
dlls/compobj.dll16/compobj.c
View file @
bfaf9013
...
...
@@ -111,8 +111,8 @@ static SEGPTR compobj_malloc;
typedef
struct
{
IMalloc16
IMalloc16_iface
;
DWORD
ref
;
IMalloc16
IMalloc16_iface
;
LONG
refcount
;
}
IMalloc16Impl
;
static
inline
IMalloc16Impl
*
impl_from_IMalloc16
(
IMalloc16
*
iface
)
...
...
@@ -139,21 +139,28 @@ HRESULT CDECL IMalloc16_fnQueryInterface(IMalloc16* iface,REFIID refiid,LPVOID *
/******************************************************************************
* IMalloc16_AddRef [COMPOBJ.501]
*/
ULONG
CDECL
IMalloc16_fnAddRef
(
IMalloc16
*
iface
)
{
IMalloc16Impl
*
This
=
impl_from_IMalloc16
(
iface
);
TRACE
(
"(%p)->AddRef()
\n
"
,
This
);
return
1
;
/* cannot be freed */
ULONG
CDECL
IMalloc16_fnAddRef
(
IMalloc16
*
iface
)
{
IMalloc16Impl
*
malloc
=
impl_from_IMalloc16
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
malloc
->
refcount
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
malloc
,
refcount
);
return
refcount
;
}
/******************************************************************************
* IMalloc16_Release [COMPOBJ.502]
*/
ULONG
CDECL
IMalloc16_fnRelease
(
IMalloc16
*
iface
)
{
IMalloc16Impl
*
This
=
impl_from_IMalloc16
(
iface
);
TRACE
(
"(%p)->Release()
\n
"
,
This
);
return
1
;
/* cannot be freed */
ULONG
CDECL
IMalloc16_fnRelease
(
SEGPTR
iface
)
{
IMalloc16Impl
*
malloc
=
impl_from_IMalloc16
(
MapSL
(
iface
));
ULONG
refcount
=
InterlockedDecrement
(
&
malloc
->
refcount
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
malloc
,
refcount
);
if
(
!
refcount
)
{
UnMapLS
(
iface
);
HeapFree
(
GetProcessHeap
(),
0
,
malloc
);
}
return
refcount
;
}
/******************************************************************************
...
...
@@ -257,11 +264,10 @@ static SEGPTR IMalloc16_Constructor(void)
msegvt16
=
MapLS
(
&
vt16
);
}
This
->
IMalloc16_iface
.
lpVtbl
=
msegvt16
;
This
->
ref
=
1
;
This
->
ref
count
=
1
;
return
MapLS
(
This
);
}
/******************************************************************************
* CoBuildVersion [COMPOBJ.1]
*/
...
...
dlls/compobj.dll16/compobj.dll16.spec
View file @
bfaf9013
...
...
@@ -209,7 +209,7 @@
# WINE internal relays (for Win16 interfaces)
500 cdecl IMalloc16_QueryInterface(ptr ptr ptr) IMalloc16_fnQueryInterface
501 cdecl IMalloc16_AddRef(ptr) IMalloc16_fnAddRef
502 cdecl IMalloc16_Release(ptr) IMalloc16_fnRelease
502 cdecl IMalloc16_Release(
seg
ptr) IMalloc16_fnRelease
503 cdecl IMalloc16_Alloc(ptr long) IMalloc16_fnAlloc
504 cdecl IMalloc16_Realloc(ptr segptr long) IMalloc16_fnRealloc
505 cdecl IMalloc16_Free(ptr segptr) IMalloc16_fnFree
...
...
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