ole32: Simplify static IMalloc instance initialization.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-04-20 10:59:22 +03:00 committed by Alexandre Julliard
parent 7c4106aa89
commit 0a35f0053a
1 changed files with 4 additions and 4 deletions

View File

@ -47,17 +47,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(olemalloc);
/* set the vtable later */ /* set the vtable later */
static const IMallocVtbl VT_IMalloc32; static const IMallocVtbl VT_IMalloc32;
typedef struct { struct allocator
{
IMalloc IMalloc_iface; IMalloc IMalloc_iface;
IMallocSpy * pSpy; /* the spy when active */ IMallocSpy * pSpy; /* the spy when active */
DWORD SpyedAllocationsLeft; /* number of spyed allocations left */ DWORD SpyedAllocationsLeft; /* number of spyed allocations left */
BOOL SpyReleasePending; /* CoRevokeMallocSpy called with spyed allocations left*/ BOOL SpyReleasePending; /* CoRevokeMallocSpy called with spyed allocations left*/
LPVOID * SpyedBlocks; /* root of the table */ LPVOID * SpyedBlocks; /* root of the table */
DWORD SpyedBlockTableLength;/* size of the table*/ DWORD SpyedBlockTableLength;/* size of the table*/
} _Malloc32; };
/* this is the static object instance */ static struct allocator Malloc32 = { .IMalloc_iface.lpVtbl = &VT_IMalloc32 };
static _Malloc32 Malloc32 = {{&VT_IMalloc32}, NULL, 0, 0, NULL, 0};
/* with a spy active all calls from pre to post methods are threadsafe */ /* with a spy active all calls from pre to post methods are threadsafe */
static CRITICAL_SECTION IMalloc32_SpyCS; static CRITICAL_SECTION IMalloc32_SpyCS;