Skip to content

Commit 862b923

Browse files
author
Aidan Lee
committed
std::mutex for large object heap
1 parent cb565f2 commit 862b923

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/hx/gc/Immix.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3216,19 +3216,19 @@ class GlobalAllocator
32163216
{
32173217
unsigned int *blob = ((unsigned int *)inLarge) - 2;
32183218
unsigned int size = *blob;
3219-
mLargeListLock.Lock();
3219+
mLargeListLock.lock();
32203220
mLargeAllocated -= size;
32213221
// Could somehow keep it in the list, but mark as recycled?
32223222
mLargeList.qerase_val(blob);
32233223
// We could maybe free anyhow?
32243224
if (!largeObjectRecycle.hasExtraCapacity(1))
32253225
{
3226-
mLargeListLock.Unlock();
3226+
mLargeListLock.unlock();
32273227
HxFree(blob);
32283228
return;
32293229
}
32303230
largeObjectRecycle.push(blob);
3231-
mLargeListLock.Unlock();
3231+
mLargeListLock.unlock();
32323232
}
32333233
}
32343234

@@ -3269,7 +3269,7 @@ class GlobalAllocator
32693269
{
32703270
if (do_lock && !isLocked)
32713271
{
3272-
mLargeListLock.Lock();
3272+
mLargeListLock.lock();
32733273
isLocked = true;
32743274
if ( i>=largeObjectRecycle.size() || largeObjectRecycle[i][0] != inSize )
32753275
continue;
@@ -3295,7 +3295,7 @@ class GlobalAllocator
32953295

32963296
if (isLocked)
32973297
{
3298-
mLargeListLock.Unlock();
3298+
mLargeListLock.unlock();
32993299
isLocked = false;
33003300
}
33013301

@@ -3320,13 +3320,13 @@ class GlobalAllocator
33203320
#endif
33213321

33223322
if (do_lock && !isLocked)
3323-
mLargeListLock.Lock();
3323+
mLargeListLock.lock();
33243324

33253325
mLargeList.push(result);
33263326
mLargeAllocated += inSize;
33273327

33283328
if (do_lock)
3329-
mLargeListLock.Unlock();
3329+
mLargeListLock.unlock();
33303330

33313331
#ifdef HXCPP_TELEMETRY
33323332
__hxt_gc_alloc(result + 2, inSize);
@@ -3363,12 +3363,12 @@ class GlobalAllocator
33633363
#endif
33643364

33653365
if (do_lock)
3366-
mLargeListLock.Lock();
3366+
mLargeListLock.lock();
33673367

33683368
mLargeAllocated += inDelta;
33693369

33703370
if (do_lock)
3371-
mLargeListLock.Unlock();
3371+
mLargeListLock.unlock();
33723372
}
33733373

33743374
// Gets a block with the 'zeroLock' acquired, which means the zeroing thread
@@ -5623,7 +5623,7 @@ class GlobalAllocator
56235623
volatile int mZeroListQueue;
56245624

56255625
LargeList mLargeList;
5626-
HxMutex mLargeListLock;
5626+
std::mutex mLargeListLock;
56275627
hx::QuickVec<LocalAllocator *> mLocalAllocs;
56285628
LocalAllocator *mLocalPool[LOCAL_POOL_SIZE];
56295629
hx::QuickVec<unsigned int *> largeObjectRecycle;

0 commit comments

Comments
 (0)