* require hazard pointers.
*
* (C) Copyright 2011 Xamarin Inc.
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
/*
{
int size = mono_pagesize ();
int num_entries = (size - (sizeof (Chunk) - arr->entry_size * MONO_ZERO_LEN_ARRAY)) / arr->entry_size;
- Chunk *chunk = (Chunk *) mono_valloc (NULL, size, MONO_MMAP_READ | MONO_MMAP_WRITE);
+ Chunk *chunk = (Chunk *) mono_valloc (NULL, size, MONO_MMAP_READ | MONO_MMAP_WRITE, arr->account_type);
g_assert (chunk);
chunk->num_entries = num_entries;
return chunk;
}
static void
-free_chunk (Chunk *chunk)
+free_chunk (Chunk *chunk, MonoMemAccountType type)
{
- mono_vfree (chunk, mono_pagesize ());
+ mono_vfree (chunk, mono_pagesize (), type);
}
gpointer
chunk = alloc_chunk (arr);
mono_memory_write_barrier ();
if (InterlockedCompareExchangePointer ((volatile gpointer *)&arr->chunk_list, chunk, NULL) != NULL)
- free_chunk (chunk);
+ free_chunk (chunk, arr->account_type);
}
chunk = arr->chunk_list;
next = alloc_chunk (arr);
mono_memory_write_barrier ();
if (InterlockedCompareExchangePointer ((volatile gpointer *) &chunk->next, next, NULL) != NULL) {
- free_chunk (next);
+ free_chunk (next, arr->account_type);
next = chunk->next;
g_assert (next);
}
arr->chunk_list = NULL;
while (chunk) {
Chunk *next = chunk->next;
- free_chunk (chunk);
+ free_chunk (chunk, arr->account_type);
chunk = next;
}
}