the struct may or may not be passed or returned directly.
* Unfortunately, there is not currently a scenario or test case for this issue.
-* [\#10879 Unix: Unnecessary struct copy while passsing struct of size <=16](https://github.com/dotnet/runtime/issues/10879)
+* [\#10879 Unix: Unnecessary struct copy while passing struct of size <=16](https://github.com/dotnet/runtime/issues/10879)
* [\#9839 [RyuJIT] Eliminate unecessary copies when passing structs](https://github.com/dotnet/runtime/issues/9839)
* These require changing both the callsite and the callee to avoid copying the parameter onto the stack.
# CI Health and Investigation
-`dotnet/runtime` runs testing accross many different architectures and operating systems. The breadth of testing that happens lends itself to a complex system which is susceptible to different points of failure.
+`dotnet/runtime` runs testing across many different architectures and operating systems. The breadth of testing that happens lends itself to a complex system which is susceptible to different points of failure.
Note that this document focuses on coreclr testing in `dotnet/runtime`.
**Pipeline Pass Rate**
-This is tracking the pipeline pass rate generally over two weeks. This view is not very useful for [runtime-coreclr](https://dev.azure.com/dnceng/public/_build?definitionId=649) as the PR pipeline is expected to break during PR validation. Therefore, it is generally recommended to view [runtime-coreclr outerloop](https://dev.azure.com/dnceng/public/_build?definitionId=655) to get a better idea of what the overall success rate is for [runtime-coreclr](https://dev.azure.com/dnceng/public/_build?definitionId=228). Note that this is not exactly a fair comparison as we run signicantly more tests in [runtime-outerloop](https://dev.azure.com/dnceng/public/_build?definitionId=655) accross more platforms. It is however, a good proxy to see the overall CI health.
+This is tracking the pipeline pass rate generally over two weeks. This view is not very useful for [runtime-coreclr](https://dev.azure.com/dnceng/public/_build?definitionId=649) as the PR pipeline is expected to break during PR validation. Therefore, it is generally recommended to view [runtime-coreclr outerloop](https://dev.azure.com/dnceng/public/_build?definitionId=655) to get a better idea of what the overall success rate is for [runtime-coreclr](https://dev.azure.com/dnceng/public/_build?definitionId=228). Note that this is not exactly a fair comparison as we run signicantly more tests in [runtime-outerloop](https://dev.azure.com/dnceng/public/_build?definitionId=655) across more platforms. It is however, a good proxy to see the overall CI health.
Opening the [runtime-outerloop Pipeline Pass Rate](https://dev.azure.com/dnceng/public/_pipeline/analytics/stageawareoutcome?definitionId=655&contextType=build) there is a presentation of a line graph of the end to end success rate for the pipeline over time.
Build CoreCLR with PAL tests on the Unix machine:
-```sh ./build.sh clr.paltests
+```sh
+./build.sh clr.paltests
```
Run tests:
Test results will go into: `/tmp/PalTestOutput/default/pal_tests.xml`
To disable tests in the CI edit
-`src/coreclr/src/pal/tests/palsuite/issues.targets`
\ No newline at end of file
+`src/coreclr/src/pal/tests/palsuite/issues.targets`
jobTemplate: /eng/pipelines/coreclr/templates/format-job.yml
platforms:
- Linux_x64
- # Isssue: https://github.com/dotnet/runtime/issues/40034
+ # Issue: https://github.com/dotnet/runtime/issues/40034
#- Windows_NT_x64
jobTemplate: /eng/pipelines/coreclr/templates/format-job.yml
platforms:
- Linux_x64
- # Isssue: https://github.com/dotnet/runtime/issues/40034
+ # Issue: https://github.com/dotnet/runtime/issues/40034
#- Windows_NT_x64
jobParameters:
condition: >-
#ifndef CROSSGEN_COMPILE
protected:
#endif
- // Asssembly Flags
+ // Assembly Flags
enum
{
FLAG_NONE = 0x00,
if (wszFileExtension != 0)
{
LPWSTR wszNextFileExtension = wszFileExtension;
- // Find last occurence
+ // Find last occurrence
do
{
wszFileExtension = wszNextFileExtension;
}
-// Determines if a given adddress is a CLR stub.
+// Determines if a given address is a CLR stub.
BOOL DacDbiInterfaceImpl::IsTransitionStub(CORDB_ADDRESS address)
{
DD_ENTER_MAY_THROW;
void GetModuleForDomainFile(VMPTR_DomainFile vmDomainFile, OUT VMPTR_Module * pModule);
- // Yields true if the adddress is a CLR stub.
+ // Yields true if the address is a CLR stub.
BOOL IsTransitionStub(CORDB_ADDRESS address);
// Get the "type" of address.
UINT32 m_signature;
#else
#ifdef HOST_64BIT
- //README ALIGNEMENT: in retail mode UINT m_numCodeBytes does not align to 16byte for the code
+ //README ALIGNMENT: in retail mode UINT m_numCodeBytes does not align to 16byte for the code
// after the Stub struct. This is to pad properly
UINT m_pad_code_bytes;
#endif // HOST_64BIT
// Command parameters for create case.
// Note that we must always physically call CreateProcess on the debuggee so that we get the proper out-parameters
- // from create-processs (eg, target's handle, startup info, etc). So we always attach the auxillary debugger
+ // from create-process (eg, target's handle, startup info, etc). So we always attach the auxillary debugger
// even in the create case. Use "-pr -pb" in Windbg to attach to a create-suspended process.
//
// Common Windbg options:
// Unique objects that represent the use of some
// basic ELEMENT_TYPE's as type parameters. These
- // are shared acrosss the entire process. We could
+ // are shared across the entire process. We could
// go and try to find the classes corresponding to these
// element types but it seems simpler just to keep
// them as special cases.
// ppStackWalk - out parameter; return the new stackwalker
//
// Return Value:
-// Return S_OK on succcess.
+// Return S_OK on success.
// Return E_FAIL on error.
//
// Notes:
// Initialize Left-Side debugger object
//
// Return Value:
-// S_OK on successs. May also throw.
+// S_OK on success. May also throw.
//
// Assumptions:
// This is called in the startup path.
//
EnCSequencePointHelper::EnCSequencePointHelper(DebuggerJitInfo *pJitInfo)
: m_pJitInfo(pJitInfo),
- m_pOffsetToHandlerInfo(NULL)
+ m_pOffsetToHandlerInfo(NULL)
{
CONTRACTL
{
/* ------------------------------------------------------------------------ *
* DebuggerEval class
*
- * Note that arguments get passsed in a block allocated when
+ * Note that arguments get passed in a block allocated when
* the func-eval is set up. The setup phase passes the total count of arguments.
*
* In some situations type arguments must also be passed, e.g.
CHECK_STACK_ALIGNMENT
call C_FUNC(FuncEvalHijackWorker)
add esp, (4 + STK_ALIGN_PADDING)
- jmp eax // return is the patch addresss to jmp to
+ jmp eax // return is the patch address to jmp to
#undef STK_ALIGN_PADDING
NESTED_END FuncEvalHijack, _TEXT
_FuncEvalHijack@0 proc public
push eax ; the ptr to the DebuggerEval
call _FuncEvalHijackWorker@4
- jmp eax ; return is the patch addresss to jmp to
+ jmp eax ; return is the patch address to jmp to
_FuncEvalHijack@0 endp
{
// Search through all the sequence points since line might have there
- // IL spread accross multiple ranges (for loops for example)
+ // IL spread across multiple ranges (for loops for example)
if (m_pData->m_pSequencePoints[point].Document() == DocumentEntry &&
line >= m_pData->m_pSequencePoints[point].StartLine() &&
line <= m_pData->m_pSequencePoints[point].EndLine())
// Upon receiving a reply message, signal the event on the message to wake up the thread waiting for
// the reply message and close the handle to the event.
- void SignalReplyEvent(Message * pMesssage);
+ void SignalReplyEvent(Message * pMessage);
// Given a message ID, find the matching message in the send queue. If there is no match, return NULL.
// If there is a match, remove the message from the send queue and return it.
{
switch (gen)
{
- case soh_gen0:
+ case soh_gen0:
return gc_oh_num::soh;
case soh_gen1:
- return gc_oh_num::soh;
+ return gc_oh_num::soh;
case soh_gen2:
return gc_oh_num::soh;
case loh_generation:
void uoh_alloc_done_with_index (int index)
{
dprintf (3, ("uoh alloc: release lock on %Ix based on %d", (uint8_t *)alloc_objects[index], index));
- assert ((index >= 0) && (index < max_pending_allocs));
+ assert ((index >= 0) && (index < max_pending_allocs));
alloc_objects[index] = (uint8_t*)0;
}
// Things we need to manually initialize:
// gen0 min_size - based on cache
// gen0/1 max_size - based on segment size
-static static_data static_data_table[latency_level_last - latency_level_first + 1][total_generation_count] =
+static static_data static_data_table[latency_level_last - latency_level_first + 1][total_generation_count] =
{
// latency_level_memory_footprint
{
free_list_prev (o) = PREV_EMPTY;
}
}
-// This is used when we need to clear the prev bit for a free object we made because we know
+// This is used when we need to clear the prev bit for a free object we made because we know
// it's not actually a free obj (it's just a temporary thing during allocation).
void clear_prev_bit (uint8_t* o, size_t size)
{
int current_block_large;
int current_block_pinned;
- enum
- {
+ enum
+ {
ALLATONCE = 1,
EACH_GENERATION,
EACH_BLOCK,
{
switch (gen)
{
- case soh_gen0:
- case soh_gen1:
+ case soh_gen0:
+ case soh_gen1:
case soh_gen2: return initial_normal_heap[h_number].memory_base;
case loh_generation: return initial_large_heap[h_number].memory_base;
case poh_generation: return initial_pinned_heap[h_number].memory_base;
{
switch (gen)
{
- case soh_gen0:
- case soh_gen1:
+ case soh_gen0:
+ case soh_gen1:
case soh_gen2: return block_size_normal;
case loh_generation: return block_size_large;
case poh_generation: return block_size_pinned;
assert (memory_details.initial_memory == 0);
// soh + loh + poh segments * num_heaps
- memory_details.initial_memory = new (nothrow) imemory_data[num_heaps * (total_generation_count - ephemeral_generation_count)];
+ memory_details.initial_memory = new (nothrow) imemory_data[num_heaps * (total_generation_count - ephemeral_generation_count)];
if (memory_details.initial_memory == 0)
{
dprintf (2, ("failed to reserve %Id bytes for imemory_data", num_heaps * (total_generation_count - ephemeral_generation_count) * sizeof (imemory_data)));
}
else
{
- // for each NUMA node, give out the memory to its heaps
+ // for each NUMA node, give out the memory to its heaps
for (uint16_t numa_node = 0; numa_node < numa_node_count; numa_node++)
{
numa_reserved_block * block = &memory_details.numa_reserved_block_table[numa_node];
{
check_commit_cs.Enter();
committed_by_oh[oh] -= size;
-
+
dprintf (1, ("commit failed, updating %Id to %Id",
current_total_committed, (current_total_committed - size)));
current_total_committed -= size;
// We should think about whether it's really necessary to have to copy back the pre plug
// info since it was already copied during compacting plugs. But if a plug doesn't move
// by >= 3 ptr size (the size of gap_reloc_pair), it means we'd have to recover pre plug info.
- size_t recover_plug_info()
+ size_t recover_plug_info()
{
- // We need to calculate the size for sweep case in order to correctly record the
+ // We need to calculate the size for sweep case in order to correctly record the
// free_obj_space - sweep would've made these artifical gaps into free objects and
// we would need to deduct the size because now we are writing into those free objects.
size_t recovered_sweep_size = 0;
#endif // _DEBUG
generation_alloc_context (generation_of (i));
assert (acontext->alloc_ptr == 0);
- assert (acontext->alloc_limit == 0);
+ assert (acontext->alloc_limit == 0);
#if 0
dprintf (3, ("UOH alloc context: gen: %Ix, ptr: %Ix, limit %Ix",
heap_segment* gc_heap::make_heap_segment (uint8_t* new_pages, size_t size, gc_oh_num oh, int h_number)
{
- assert(oh != gc_oh_num::none);
+ assert(oh != gc_oh_num::none);
size_t initial_commit = SEGMENT_INITIAL_COMMIT;
if (!virtual_commit (new_pages, initial_commit, oh, h_number))
gen->allocation_segment = seg;
gen->plan_allocation_start = 0;
gen->free_list_space = 0;
- gen->pinned_allocated = 0;
- gen->free_list_allocated = 0;
+ gen->pinned_allocated = 0;
+ gen->free_list_allocated = 0;
gen->end_seg_allocated = 0;
- gen->condemned_allocated = 0;
- gen->sweep_allocated = 0;
+ gen->condemned_allocated = 0;
+ gen->sweep_allocated = 0;
gen->free_obj_space = 0;
gen->allocation_size = 0;
gen->pinned_allocation_sweep_size = 0;
if (gen->gen_num == max_generation)
{
- dprintf (2, ("AO h%d: gen2F+: %Ix(%Id)->%Id, FO: %Id",
+ dprintf (2, ("AO h%d: gen2F+: %Ix(%Id)->%Id, FO: %Id",
heap_number, free_start, free_size,
generation_free_list_space (gen), generation_free_obj_space (gen)));
}
if (gen->gen_num == max_generation)
{
- dprintf (2, ("AO [h%d] gen2FL+: %Ix(%Id)->%Id",
+ dprintf (2, ("AO [h%d] gen2FL+: %Ix(%Id)->%Id",
heap_number, free_start, free_size, generation_free_list_space (gen)));
}
if (gen->gen_num == max_generation)
{
- dprintf (2, ("AO [h%d] gen2FO+: %Ix(%Id)->%Id",
+ dprintf (2, ("AO [h%d] gen2FO+: %Ix(%Id)->%Id",
heap_number, free_start, free_size, generation_free_obj_space (gen)));
}
}
uint8_t* old_loc = generation_last_free_list_allocated (gen);
set_free_obj_in_compact_bit (old_loc);
- dprintf (3333, ("[h%d] ac: %Ix->%Ix((%Id < %Id), Pset %Ix s->%Id", heap_number,
+ dprintf (3333, ("[h%d] ac: %Ix->%Ix((%Id < %Id), Pset %Ix s->%Id", heap_number,
generation_allocation_context_start_region (gen), generation_allocation_pointer (gen),
allocated_size, min_free_item_no_prev, filler_free_obj_size_location, filler_free_obj_size));
}
make_free_obj (gen, hole, size);
}
}
- else
+ else
{
dprintf (3, ("threading hole in front of free list"));
thread_free_item_front (gen, hole, size);
if (gen_number == max_generation)
{
dprintf (3, ("[g%2d, b%2d]UL: %Ix->%Ix->%Ix (h: %Ix, t: %Ix)",
- gen_number, bn, free_list_prev (item), item, free_list_slot (item),
+ gen_number, bn, free_list_prev (item), item, free_list_slot (item),
al->alloc_list_head(), al->alloc_list_tail()));
- dprintf (3, ("[g%2d, b%2d]UL: exit, h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix",
- gen_number, bn,
+ dprintf (3, ("[g%2d, b%2d]UL: exit, h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix",
+ gen_number, bn,
(al->alloc_list_head() ? free_list_slot (al->alloc_list_head()) : 0),
(al->alloc_list_head() ? free_list_prev (al->alloc_list_head()) : 0),
(al->alloc_list_tail() ? free_list_slot (al->alloc_list_tail()) : 0),
void allocator::unlink_item_no_undo (unsigned int bn, uint8_t* item, size_t size)
{
alloc_list* al = &alloc_list_of (bn);
-
+
uint8_t* next_item = free_list_slot (item);
uint8_t* prev_item = free_list_prev (item);
if (gen_number == max_generation)
{
dprintf (3, ("[g%2d, b%2d]ULN: %Ix->%Ix->%Ix (h: %Ix, t: %Ix)",
- gen_number, bn, free_list_prev (item), item, free_list_slot (item),
+ gen_number, bn, free_list_prev (item), item, free_list_slot (item),
al->alloc_list_head(), al->alloc_list_tail()));
- dprintf (3, ("[g%2d, b%2d]ULN: exit: h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix",
- gen_number, bn,
+ dprintf (3, ("[g%2d, b%2d]ULN: exit: h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix",
+ gen_number, bn,
(al->alloc_list_head() ? free_list_slot (al->alloc_list_head()) : 0),
(al->alloc_list_head() ? free_list_prev (al->alloc_list_head()) : 0),
(al->alloc_list_tail() ? free_list_slot (al->alloc_list_tail()) : 0),
void allocator::unlink_item_no_undo_added (unsigned int bn, uint8_t* item, uint8_t* previous_item)
{
alloc_list* al = &alloc_list_of (bn);
-
+
uint8_t* next_item = free_list_slot (item);
uint8_t* prev_item = free_list_prev (item);
if (gen_number == max_generation)
{
dprintf (3333, ("[g%2d, b%2d]ULNA: %Ix->%Ix->%Ix (h: %Ix, t: %Ix)",
- gen_number, bn, free_list_prev (item), item, free_list_slot (item),
+ gen_number, bn, free_list_prev (item), item, free_list_slot (item),
al->added_alloc_list_head(), al->added_alloc_list_tail()));
- dprintf (3333, ("[g%2d, b%2d]ULNA: exit: h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix",
- gen_number, bn,
+ dprintf (3333, ("[g%2d, b%2d]ULNA: exit: h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix",
+ gen_number, bn,
(al->added_alloc_list_head() ? free_list_slot (al->added_alloc_list_head()) : 0),
(al->added_alloc_list_head() ? free_list_prev (al->added_alloc_list_head()) : 0),
(al->added_alloc_list_tail() ? free_list_slot (al->added_alloc_list_tail()) : 0),
if (gen_number == max_generation)
{
dprintf (3333, ("[g%2d, b%2d]TFFA: exit: %Ix->%Ix->%Ix (h: %Ix, t: %Ix)",
- gen_number, a_l_number,
- free_list_prev (item), item, free_list_slot (item),
+ gen_number, a_l_number,
+ free_list_prev (item), item, free_list_slot (item),
al->added_alloc_list_head(), al->added_alloc_list_tail()));
- dprintf (3333, ("[g%2d, b%2d]TFFA: h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix",
- gen_number, a_l_number,
+ dprintf (3333, ("[g%2d, b%2d]TFFA: h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix",
+ gen_number, a_l_number,
(al->added_alloc_list_head() ? free_list_slot (al->added_alloc_list_head()) : 0),
(al->added_alloc_list_head() ? free_list_prev (al->added_alloc_list_head()) : 0),
(al->added_alloc_list_tail() ? free_list_slot (al->added_alloc_list_tail()) : 0),
#ifdef DOUBLY_LINKED_FL
if (gen_number == max_generation)
{
- dprintf (3333, ("[g%2d, b%2d]TFE: %Ix->%Ix->%Ix (h: %Ix, t: %Ix)",
- gen_number, a_l_number,
- free_list_prev (item), item, free_list_slot (item),
+ dprintf (3333, ("[g%2d, b%2d]TFE: %Ix->%Ix->%Ix (h: %Ix, t: %Ix)",
+ gen_number, a_l_number,
+ free_list_prev (item), item, free_list_slot (item),
al->alloc_list_head(), al->alloc_list_tail()));
- dprintf (3333, ("[g%2d, b%2d]TFE: exit: h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix",
- gen_number, a_l_number,
+ dprintf (3333, ("[g%2d, b%2d]TFE: exit: h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix",
+ gen_number, a_l_number,
(al->alloc_list_head() ? free_list_slot (al->alloc_list_head()) : 0),
(al->alloc_list_head() ? free_list_prev (al->alloc_list_head()) : 0),
(al->alloc_list_tail() ? free_list_slot (al->alloc_list_tail()) : 0),
free_list_prev (item) = 0;
dprintf (3333, ("[g%2d, b%2d]TFF: exit: %Ix->%Ix->%Ix (h: %Ix, t: %Ix)",
- gen_number, a_l_number,
- free_list_prev (item), item, free_list_slot (item),
+ gen_number, a_l_number,
+ free_list_prev (item), item, free_list_slot (item),
al->alloc_list_head(), al->alloc_list_tail()));
- dprintf (3333, ("[g%2d, b%2d]TFF: h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix",
- gen_number, a_l_number,
+ dprintf (3333, ("[g%2d, b%2d]TFF: h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix",
+ gen_number, a_l_number,
(al->alloc_list_head() ? free_list_slot (al->alloc_list_head()) : 0),
(al->alloc_list_head() ? free_list_prev (al->alloc_list_head()) : 0),
(al->alloc_list_tail() ? free_list_slot (al->alloc_list_tail()) : 0),
if (repair_list)
{
//repair the the list
- //new items may have been added during the plan phase
- //items may have been unlinked.
+ //new items may have been added during the plan phase
+ //items may have been unlinked.
uint8_t* free_item = alloc_list_head_of (i);
while (free_item && count)
{
for (unsigned int i = 0; i < num_buckets; i++)
{
- //remove the undo info from list.
+ //remove the undo info from list.
uint8_t* free_item = alloc_list_head_of (i);
#ifdef DOUBLY_LINKED_FL
if (bgc_repair_p)
{
- dprintf (3, ("C[b%2d] ENTRY: h: %Ix t: %Ix", i,
+ dprintf (3, ("C[b%2d] ENTRY: h: %Ix t: %Ix", i,
alloc_list_head_of (i), alloc_list_tail_of (i)));
}
}
uint8_t* head_added = added_alloc_list_head_of (i);
-
+
if (head_added)
{
alloc_list_head_of (i) = head_added;
{
return;
}
-
+
if (gen_num < max_generation)
{
gen_num = max_generation;
#ifdef BACKGROUND_GC
void gc_heap::bgc_uoh_alloc_clr (uint8_t* alloc_start,
- size_t size,
+ size_t size,
alloc_context* acontext,
uint32_t flags,
int align_const,
BOOL gc_heap::a_fit_free_list_uoh_p (size_t size,
alloc_context* acontext,
- uint32_t flags,
+ uint32_t flags,
int align_const,
int gen_number)
{
can_use_existing_p = uoh_try_fit (gen_number, size, acontext, flags,
align_const, &commit_failed_p, &oom_r);
uoh_alloc_state = (can_use_existing_p ?
- a_state_can_allocate :
+ a_state_can_allocate :
(commit_failed_p ?
a_state_trigger_full_compact_gc :
a_state_acquire_seg));
BOOL commit_failed_p = FALSE;
BOOL can_use_existing_p = FALSE;
- can_use_existing_p = uoh_try_fit (gen_number, size, acontext, flags,
+ can_use_existing_p = uoh_try_fit (gen_number, size, acontext, flags,
align_const, &commit_failed_p, &oom_r);
// Even after we got a new seg it doesn't necessarily mean we can allocate,
// another LOH allocating thread could have beat us to acquire the msl so
current_full_compact_gc_count = get_full_compact_gc_count();
can_get_new_seg_p = uoh_get_new_seg (gen_number, size, &did_full_compacting_gc, &oom_r);
- uoh_alloc_state = (can_get_new_seg_p ?
- a_state_try_fit_new_seg :
- (did_full_compacting_gc ?
+ uoh_alloc_state = (can_get_new_seg_p ?
+ a_state_try_fit_new_seg :
+ (did_full_compacting_gc ?
a_state_check_retry_seg :
a_state_check_and_wait_for_bgc));
break;
// Since we release the msl before we try to allocate a seg, other
// threads could have allocated a bunch of segments before us so
// we might need to retry.
- uoh_alloc_state = (can_get_new_seg_p ?
- a_state_try_fit_after_cg :
+ uoh_alloc_state = (can_get_new_seg_p ?
+ a_state_try_fit_after_cg :
a_state_check_retry_seg);
break;
}
current_full_compact_gc_count = get_full_compact_gc_count();
- can_get_new_seg_p = uoh_get_new_seg (gen_number, size, &did_full_compacting_gc, &oom_r);
- uoh_alloc_state = (can_get_new_seg_p ?
- a_state_try_fit_new_seg :
- (did_full_compacting_gc ?
+ can_get_new_seg_p = uoh_get_new_seg (gen_number, size, &did_full_compacting_gc, &oom_r);
+ uoh_alloc_state = (can_get_new_seg_p ?
+ a_state_try_fit_new_seg :
+ (did_full_compacting_gc ?
a_state_check_retry_seg :
a_state_trigger_full_compact_gc));
assert ((uoh_alloc_state != a_state_cant_allocate) || (oom_r != oom_no_failure));
bgc_in_progress_p = check_and_wait_for_bgc (awr_loh_oos_bgc, &did_full_compacting_gc, true);
uoh_alloc_state = (!bgc_in_progress_p ?
- a_state_trigger_full_compact_gc :
- (did_full_compacting_gc ?
+ a_state_trigger_full_compact_gc :
+ (did_full_compacting_gc ?
a_state_try_fit_after_cg :
a_state_try_fit_after_bgc));
break;
should_retry_get_seg = TRUE;
}
}
-
- uoh_alloc_state = (should_retry_gc ?
- a_state_trigger_full_compact_gc :
+
+ uoh_alloc_state = (should_retry_gc ?
+ a_state_trigger_full_compact_gc :
(should_retry_get_seg ?
a_state_try_fit_after_cg :
a_state_cant_allocate));
if (max_hp != home_hp)
{
- dprintf (3, ("uoh: %d(%Id)->%d(%Id)",
+ dprintf (3, ("uoh: %d(%Id)->%d(%Id)",
home_hp->heap_number, dd_new_allocation (home_hp->dynamic_data_of (generation_num)),
max_hp->heap_number, dd_new_allocation (max_hp->dynamic_data_of (generation_num))));
}
}
else
{
- // We can have segments outside the BGC range that were allocated during mark - and we
+ // We can have segments outside the BGC range that were allocated during mark - and we
// wouldn't have committed the mark array for them and their background_allocated would be
// non-zero. Don't set mark bits for those.
// The ones allocated during BGC sweep would have their background_allocated as 0.
if ((o >= background_saved_lowest_address) && (o < background_saved_highest_address))
{
heap_segment* seg = seg_mapping_table_segment_of (o);
- // if bgc_allocated is 0 it means it was allocated during bgc sweep,
+ // if bgc_allocated is 0 it means it was allocated during bgc sweep,
// and everything on it should be considered live.
uint8_t* background_allocated = heap_segment_background_allocated (seg);
if (background_allocated == 0)
return FALSE;
// During BGC sweep gen1 GCs could add some free spaces in gen2.
// If we use those, we should not set the mark bits on them.
- // They could either be a newly allocated seg which is covered by the
+ // They could either be a newly allocated seg which is covered by the
// above case; or they are on a seg that's seen but beyond what BGC mark
// saw.
else if (o >= background_allocated)
if (record_free_list_allocated_p)
{
generation_set_bgc_mark_bit_p (gen) = should_set_bgc_mark_bit (free_list);
- dprintf (3333, ("SFA: %Ix->%Ix(%d)", free_list, (free_list + free_list_size),
+ dprintf (3333, ("SFA: %Ix->%Ix(%d)", free_list, (free_list + free_list_size),
(generation_set_bgc_mark_bit_p (gen) ? 1 : 0)));
}
adjust_limit (free_list, free_list_size, gen);
{
prev_free_item = free_list;
}
- free_list = free_list_slot (free_list);
+ free_list = free_list_slot (free_list);
}
}
#endif //DOUBLY_LINKED_FL
if (!discard_p && !use_undo_p)
{
gen2_removed_no_undo += free_list_size;
- dprintf (3, ("h%d: remove with no undo %Id = %Id",
+ dprintf (3, ("h%d: remove with no undo %Id = %Id",
heap_number, free_list_size, gen2_removed_no_undo));
}
if (!discard_p)
{
gen2_removed_no_undo += free_list_size;
- dprintf (3, ("h%d: b0 remove with no undo %Id = %Id",
+ dprintf (3, ("h%d: b0 remove with no undo %Id = %Id",
heap_number, free_list_size, gen2_removed_no_undo));
}
#endif //DOUBLY_LINKED_FL
#ifdef DOUBLY_LINKED_FL
if (generation_set_bgc_mark_bit_p (gen))
{
- dprintf (2, ("IOM: %Ix(->%Ix(%Id) (%Ix-%Ix)", old_loc, result, pad,
+ dprintf (2, ("IOM: %Ix(->%Ix(%Id) (%Ix-%Ix)", old_loc, result, pad,
(size_t)(&mark_array [mark_word_of (result)]),
(size_t)(mark_array [mark_word_of (result)])));
-
+
set_plug_bgc_mark_bit (old_loc);
}
else if ((current_total_committed * 10) >= (heap_hard_limit * 9))
{
size_t loh_frag = get_total_gen_fragmentation (loh_generation);
-
+
// If the LOH frag is >= 1/8 it's worth compacting it
if ((loh_frag * 8) >= heap_hard_limit)
{
for (int i = uoh_start_generation; i < total_generation_count; i++)
{
- dd_fragmentation (dynamic_data_of (i)) =
- generation_free_list_space (generation_of (i)) +
+ dd_fragmentation (dynamic_data_of (i)) =
+ generation_free_list_space (generation_of (i)) +
generation_free_obj_space (generation_of (i));
}
#ifdef MULTIPLE_HEAPS
for (int i = 0; i < n_heaps; i++)
{
- if (((g_heaps[i]->current_generation_size (max_generation)) > bgc_min_per_heap) ||
- ((g_heaps[i]->current_generation_size (loh_generation)) > bgc_min_per_heap) ||
+ if (((g_heaps[i]->current_generation_size (max_generation)) > bgc_min_per_heap) ||
+ ((g_heaps[i]->current_generation_size (loh_generation)) > bgc_min_per_heap) ||
((g_heaps[i]->current_generation_size (poh_generation)) > bgc_min_per_heap))
{
bgc_heap_too_small = FALSE;
}
}
#else //MULTIPLE_HEAPS
- if ((current_generation_size (max_generation) > bgc_min_per_heap) ||
- (current_generation_size (loh_generation) > bgc_min_per_heap) ||
+ if ((current_generation_size (max_generation) > bgc_min_per_heap) ||
+ (current_generation_size (loh_generation) > bgc_min_per_heap) ||
(current_generation_size (poh_generation) > bgc_min_per_heap))
{
bgc_heap_too_small = FALSE;
#endif // HOST_64BIT
gc_data_global.final_youngest_desired = desired_per_heap;
}
-#if 1 //subsumed by the linear allocation model
+#if 1 //subsumed by the linear allocation model
if (gen >= uoh_start_generation)
{
// to avoid spikes in mem usage due to short terms fluctuations in survivorship,
return FALSE;
heap_segment* seg = generation_allocation_segment (generation_of (loh_generation));
- do
+ do
{
if (seg == saved_loh_segment_no_gc)
{
// will find all heap objects (large and small)
//
// Callers of this method need to guarantee the interior pointer is within the heap range.
-//
-// If you need it to be stricter, eg if you only want to find an object in ephemeral range,
+//
+// If you need it to be stricter, eg if you only want to find an object in ephemeral range,
// you should make sure interior is within that range before calling this method.
uint8_t* gc_heap::find_object (uint8_t* interior)
{
while (seg)
{
uint8_t* o = hp->background_first_overflow (min_add, seg, concurrent_p, small_object_segments);
-
+
while ((o < hp->background_seg_end (seg, concurrent_p)) && (o <= max_add))
{
dprintf (3, ("considering %Ix", (size_t)o));
for (int i = max_generation; i < total_generation_count; i++)
{
generation* gen = generation_of (i);
- heap_segment* seg = heap_segment_rw (generation_start_segment (gen));
+ heap_segment* seg = heap_segment_rw (generation_start_segment (gen));
while (seg)
{
heap_segment* seg = start_seg;
uint8_t* o = generation_allocation_start (gen);
- dprintf (1235, ("before GC LOH size: %Id, free list: %Id, free obj: %Id\n",
- generation_size (loh_generation),
+ dprintf (1235, ("before GC LOH size: %Id, free list: %Id, free obj: %Id\n",
+ generation_size (loh_generation),
generation_free_list_space (gen),
generation_free_obj_space (gen)));
assert (loh_pinned_plug_que_empty_p());
- dprintf (1235, ("after GC LOH size: %Id, free list: %Id, free obj: %Id\n\n",
- generation_size (loh_generation),
+ dprintf (1235, ("after GC LOH size: %Id, free list: %Id, free obj: %Id\n\n",
+ generation_size (loh_generation),
generation_free_list_space (gen),
generation_free_obj_space (gen)));
}
}
}
- dprintf (1235, ("after GC LOH size: %Id, free list: %Id, free obj: %Id\n\n",
- generation_size (loh_generation),
+ dprintf (1235, ("after GC LOH size: %Id, free list: %Id, free obj: %Id\n\n",
+ generation_size (loh_generation),
generation_free_list_space (gen),
generation_free_obj_space (gen)));
}
#ifdef DOUBLY_LINKED_FL
if (condemned_gen_number == (max_generation - 1))
{
- dprintf (2, ("[h%d] no undo, FL %Id-%Id -> %Id, FO %Id+%Id=%Id",
- heap_number,
- generation_free_list_space (older_gen), gen2_removed_no_undo,
+ dprintf (2, ("[h%d] no undo, FL %Id-%Id -> %Id, FO %Id+%Id=%Id",
+ heap_number,
+ generation_free_list_space (older_gen), gen2_removed_no_undo,
(generation_free_list_space (older_gen) - gen2_removed_no_undo),
- generation_free_obj_space (older_gen), gen2_removed_no_undo,
+ generation_free_obj_space (older_gen), gen2_removed_no_undo,
(generation_free_obj_space (older_gen) + gen2_removed_no_undo)));
generation_free_list_space (older_gen) -= gen2_removed_no_undo;
if (total_recovered_sweep_size > 0)
{
generation_free_obj_space (generation_of (max_generation)) -= total_recovered_sweep_size;
- dprintf (2, ("h%d: deduct %Id for pin, fo->%Id",
+ dprintf (2, ("h%d: deduct %Id for pin, fo->%Id",
heap_number, total_recovered_sweep_size,
generation_free_obj_space (generation_of (max_generation))));
}
uint8_t* next_o = dest_o + Align (size (dest_o));
background_mark (dest_o, background_saved_lowest_address, background_saved_highest_address);
- dest_o = next_o;
+ dest_o = next_o;
}
- dprintf (3333, ("[h%d] GM: %Ix(%Ix-%Ix)->%Ix(%Ix-%Ix)",
- heap_number, dest,
+ dprintf (3333, ("[h%d] GM: %Ix(%Ix-%Ix)->%Ix(%Ix-%Ix)",
+ heap_number, dest,
(size_t)(&mark_array [mark_word_of (dest)]),
(size_t)(mark_array [mark_word_of (dest)]),
dest_end_o,
if (!(seg->flags & heap_segment_flags_ma_committed))
{
// For ro segments they could always be only partially in range so we'd
- // be calling this at the beginning of every BGC. We are not making this
+ // be calling this at the beginning of every BGC. We are not making this
// more efficient right now - ro segments are currently only used by redhawk.
if (heap_segment_read_only_p (seg))
{
}
else
{
- // For normal segments they are by design completely in range so just
+ // For normal segments they are by design completely in range so just
// commit the whole mark array for each seg.
if (commit_mark_array_by_seg (seg, mark_array))
{
gen0_bricks_cleared = FALSE;
- dprintf (2, ("end of bgc mark: loh: %d, poh: %d, soh: %d",
- generation_size (loh_generation),
- generation_size (poh_generation),
+ dprintf (2, ("end of bgc mark: loh: %d, poh: %d, soh: %d",
+ generation_size (loh_generation),
+ generation_size (poh_generation),
generation_sizes (generation_of (max_generation))));
for (int gen_idx = max_generation; gen_idx < total_generation_count; gen_idx++)
heap_segment_background_allocated (seg) = heap_segment_allocated (seg);
}
- dprintf (3333, ("h%d seg %Ix background allocated is %Ix",
+ dprintf (3333, ("h%d seg %Ix background allocated is %Ix",
heap_number,
(size_t)(seg),
heap_segment_background_allocated (seg)));
if ((heap_segment_mem (seg) >= background_saved_lowest_address) ||
(heap_segment_reserved (seg) <= background_saved_highest_address))
{
- dprintf (3, ("h%d: sseg: %Ix(-%Ix)", heap_number,
+ dprintf (3, ("h%d: sseg: %Ix(-%Ix)", heap_number,
heap_segment_mem (seg), heap_segment_reserved (seg)));
skip_seg_p = TRUE;
}
dprintf (3, ("h%d: reset only starting %Ix", heap_number, base_address));
}
- dprintf (3, ("h%d: starting: %Ix, seg %Ix-%Ix", heap_number, base_address,
+ dprintf (3, ("h%d: starting: %Ix, seg %Ix-%Ix", heap_number, base_address,
heap_segment_mem (seg), heap_segment_reserved (seg)));
{
total_dirtied_pages += bcount;
- dprintf (3, ("Found %d pages [%Ix, %Ix[",
+ dprintf (3, ("Found %d pages [%Ix, %Ix[",
bcount, (size_t)base_address, (size_t)high_address));
}
for (unsigned i = 0; i < bcount; i++)
{
uint8_t* page = (uint8_t*)background_written_addresses[i];
- dprintf (3, ("looking at page %d at %Ix(h: %Ix)", i,
+ dprintf (3, ("looking at page %d at %Ix(h: %Ix)", i,
(size_t)page, (size_t)high_address));
if (page < high_address)
{
}
if (i < loh_generation)
- {
+ {
if (!reset_only_p)
{
dprintf (GTC_LOG, ("h%d: SOH: dp:%Id; mo: %Id", heap_number, total_dirtied_pages, total_marked_objects));
// Note that younger gen's collection count is always updated with older gen's collections.
// So to calcuate the actual # of gen1 occurred we really should take the # of gen2s into
- // acccount (and deduct from gen1's collection count). But right now I am using it for stats.
+ // account (and deduct from gen1's collection count). But right now I am using it for stats.
size_t current_gen1_index = get_current_gc_index (max_generation - 1);
dprintf (BGC_TUNING_LOG, ("BTL: g2t[st][g1 %Id]: %0.3f minutes",
generation* max_gen = generation_of (max_generation);
for (int i = 1; i < max_generation; i++)
{
- generation_free_obj_space (max_gen) +=
+ generation_free_obj_space (max_gen) +=
generation_free_obj_space (generation_of (i));
dprintf (2, ("[h%d] maxgen freeobj + %Id=%Id",
heap_number, generation_free_obj_space (generation_of (i)),
generation_free_obj_space (max_gen)));
}
-
+
// TODO: This is actually insufficient - if BACKGROUND_GC is not defined we'd need to commit more
// in order to accommodate eph gen starts. Also in the no_gc we should make sure used
// is updated correctly.
{
size_t allocated = 0;
size_t committed = uoh_committed_size (gen_number, &allocated);
- dprintf (1, ("GC#%Id h%d, GMI: UOH budget, UOH commit %Id (obj %Id, frag %Id), total commit: %Id (recorded: %Id)",
- (size_t)settings.gc_index, heap_number,
+ dprintf (1, ("GC#%Id h%d, GMI: UOH budget, UOH commit %Id (obj %Id, frag %Id), total commit: %Id (recorded: %Id)",
+ (size_t)settings.gc_index, heap_number,
committed, allocated,
dd_fragmentation (dynamic_data_of (gen_number)),
get_total_committed_size(), (current_total_committed - current_total_committed_bookkeeping)));
{
if (g_low_memory_status)
{
- size_t committed_mem = committed_size();
+ size_t committed_mem = committed_size();
dynamic_data* dd = dynamic_data_of (0);
size_t current = dd_desired_allocation (dd);
size_t candidate = max (Align ((committed_mem / 10), get_alignment_constant(FALSE)), dd_min_size (dd));
{
dprintf (3, ("Preparing empty large segment %Ix for deletion", (size_t)seg));
- // We cannot thread segs in here onto freeable_uoh_segment because
- // grow_brick_card_tables could be committing mark array which needs to read
+ // We cannot thread segs in here onto freeable_uoh_segment because
+ // grow_brick_card_tables could be committing mark array which needs to read
// the seg list. So we delay it till next time we suspend EE.
seg->flags |= heap_segment_flags_uoh_delete;
// Since we will be decommitting the seg, we need to prevent heap verification
generation* gen,
uint8_t* last_plug_end,
heap_segment* start_seg,
- BOOL* delete_p,
+ BOOL* delete_p,
size_t free_obj_size_last_gap)
{
*delete_p = FALSE;
uint8_t* background_allocated = heap_segment_background_allocated (seg);
BOOL uoh_p = heap_segment_uoh_p (seg);
- dprintf (3, ("EoS [%Ix, %Ix[(%Ix[), last: %Ix(%Id)",
+ dprintf (3, ("EoS [%Ix, %Ix[(%Ix[), last: %Ix(%Id)",
(size_t)heap_segment_mem (seg), background_allocated, allocated, last_plug_end, free_obj_size_last_gap));
if (!uoh_p && (allocated != background_allocated))
fix_brick_to_highest (last_plug_end, background_allocated);
// When we allowed fgc's during going through gaps, we could have erased the brick
- // that corresponds to bgc_allocated 'cause we had to update the brick there,
+ // that corresponds to bgc_allocated 'cause we had to update the brick there,
// recover it here.
fix_brick_to_highest (background_allocated, background_allocated);
}
}
else
{
- dprintf (3, ("[h%d] seg %Ix alloc %Ix->%Ix",
- heap_number, (size_t)seg,
+ dprintf (3, ("[h%d] seg %Ix alloc %Ix->%Ix",
+ heap_number, (size_t)seg,
heap_segment_allocated (seg),
(size_t)last_plug_end));
heap_segment_allocated (seg) = last_plug_end;
if (free_obj_size_last_gap)
{
generation_free_obj_space (gen) -= free_obj_size_last_gap;
- dprintf (2, ("[h%d] PS: gen2FO-: %Id->%Id",
+ dprintf (2, ("[h%d] PS: gen2FO-: %Id->%Id",
heap_number, free_obj_size_last_gap, generation_free_obj_space (gen)));
}
#ifdef DOUBLY_LINKED_FL
if (i == max_generation)
{
- dprintf (2, ("h%d: gen2 still has FL: %Id, FO: %Id",
- heap_number,
+ dprintf (2, ("h%d: gen2 still has FL: %Id, FO: %Id",
+ heap_number,
generation_free_list_space (gen_to_reset),
generation_free_obj_space (gen_to_reset)));
}
if (i == max_generation)
{
// start with saved ephemeral segment
- // we are no longer holding gc_lock, so a new ephemeral segment could be added, we want the saved one.
+ // we are no longer holding gc_lock, so a new ephemeral segment could be added, we want the saved one.
start_seg = saved_sweep_ephemeral_seg;
prev_seg = heap_segment_next(start_seg);
}
current_sweep_seg = seg;
#endif //DOUBLY_LINKED_FL
- // This records the total size of free objects (including the ones on and not on FL)
- // in the gap and it gets set to 0 when we encounter a plug. If the last gap we saw
+ // This records the total size of free objects (including the ones on and not on FL)
+ // in the gap and it gets set to 0 when we encounter a plug. If the last gap we saw
// on a seg is unmarked, we will process this in process_background_segment_end.
size_t free_obj_size_last_gap = 0;
if (free_obj_size_last_gap)
{
generation_free_obj_space (gen) -= free_obj_size_last_gap;
- dprintf (3333, ("[h%d] LG: gen2FO-: %Id->%Id",
+ dprintf (3333, ("[h%d] LG: gen2FO-: %Id->%Id",
heap_number, free_obj_size_last_gap, generation_free_obj_space (gen)));
free_obj_size_last_gap = 0;
generation_allocator (gen)->unlink_item_no_undo (o, size_o);
generation_free_list_space (gen) -= size_o;
generation_free_obj_space (gen) += size_o;
-
- dprintf (3333, ("[h%d] gen2F-: %Ix->%Ix(%Id) FL: %Id",
+
+ dprintf (3333, ("[h%d] gen2F-: %Ix->%Ix(%Id) FL: %Id",
heap_number, o, (o + size_o), size_o,
generation_free_list_space (gen)));
- dprintf (3333, ("h%d: gen2FO+: %Ix(%Id)->%Id (g: %Id)",
+ dprintf (3333, ("h%d: gen2FO+: %Ix(%Id)->%Id (g: %Id)",
heap_number, o, size_o,
generation_free_obj_space (gen),
free_obj_size_last_gap));
}
else
{
- // this was not on the free list so it was already part of
+ // this was not on the free list so it was already part of
// free_obj_space, so no need to substract from it. However,
// we do need to keep track in this gap's FO space.
dprintf (3333, ("h%d: gen2FO: %Ix(%Id)->%Id (g: %Id)",
generation_free_list_space (generation_of (max_generation)),
generation_free_obj_space (generation_of (max_generation))));
- dprintf (GTC_LOG, ("h%d: end of bgc sweep: loh FL: %Id, FO: %Id",
+ dprintf (GTC_LOG, ("h%d: end of bgc sweep: loh FL: %Id, FO: %Id",
heap_number,
generation_free_list_space (generation_of (loh_generation)),
generation_free_obj_space (generation_of (loh_generation))));
- dprintf (GTC_LOG, ("h%d: end of bgc sweep: poh FL: %Id, FO: %Id",
+ dprintf (GTC_LOG, ("h%d: end of bgc sweep: poh FL: %Id, FO: %Id",
heap_number,
generation_free_list_space (generation_of (poh_generation)),
generation_free_obj_space (generation_of (poh_generation))));
current_bgc_state = bgc_not_in_process;
// We can have an FGC triggered before we set the global state to free
- // so we need to not have left over current_sweep_seg that point to
+ // so we need to not have left over current_sweep_seg that point to
// a segment that might've been deleted at the beginning of an FGC.
current_sweep_seg = 0;
#endif //DOUBLY_LINKED_FL
generation_free_list_allocated (gen) = 0;
dprintf (3, ("sweeping uoh objects"));
- dprintf (3, ("seg: %Ix, [%Ix, %Ix[, starting from %Ix",
+ dprintf (3, ("seg: %Ix, [%Ix, %Ix[, starting from %Ix",
(size_t)seg,
(size_t)heap_segment_mem (seg),
(size_t)heap_segment_allocated (seg),
size_t total_cards_cleared = 0;
#ifdef FEATURE_CARD_MARKING_STEALING
- VOLATILE(uint32_t)* chunk_index = (VOLATILE(uint32_t)*) &(gen_num == loh_generation ?
- card_mark_chunk_index_loh :
+ VOLATILE(uint32_t)* chunk_index = (VOLATILE(uint32_t)*) &(gen_num == loh_generation ?
+ card_mark_chunk_index_loh :
card_mark_chunk_index_poh);
card_marking_enumerator card_mark_enumerator(seg, low, chunk_index);
void gc_heap::bgc_verify_mark_array_cleared (heap_segment* seg)
{
#ifdef VERIFY_HEAP
- if (gc_heap::background_running_p() &&
+ if (gc_heap::background_running_p() &&
(GCConfig::GetHeapVerifyLevel() & GCConfig::HEAPVERIFY_GC))
{
uint8_t* range_beg = 0;
void gc_heap::verify_mark_array_cleared()
{
#ifdef VERIFY_HEAP
- if (gc_heap::background_running_p() &&
+ if (gc_heap::background_running_p() &&
(GCConfig::GetHeapVerifyLevel() & GCConfig::HEAPVERIFY_GC))
{
for (int i = max_generation; i < total_generation_count; i++)
gc_heap::verify_heap (BOOL begin_gc_p)
{
int heap_verify_level = static_cast<int>(GCConfig::GetHeapVerifyLevel());
-
+
#ifdef MULTIPLE_HEAPS
t_join* current_join = &gc_t_join;
#ifdef BACKGROUND_GC
void balance_heaps (alloc_context* acontext);
PER_HEAP
ptrdiff_t get_balance_heaps_uoh_effective_budget (int generation_num);
- static
+ static
gc_heap* balance_heaps_uoh (alloc_context* acontext, size_t size, int generation_num);
// Unlike balance_heaps_uoh, this may return nullptr if we failed to change heaps.
static
// context - we don't actually use the ptr/limit from it so I am
// making this explicit by not passing in the alloc_context.
// Note: This are instance methods, but the heap instance is only used for
- // lowest_address and highest_address, which are currently the same accross all heaps.
+ // lowest_address and highest_address, which are currently the same across all heaps.
PER_HEAP
CObjectHeader* allocate_uoh_object (size_t size, uint32_t flags, int gen_num, int64_t& alloc_bytes);
PER_HEAP
BOOL a_fit_free_list_uoh_p (size_t size,
alloc_context* acontext,
- uint32_t flags,
+ uint32_t flags,
int align_const,
int gen_number);
BOOL* short_seg_end_p);
PER_HEAP
BOOL uoh_try_fit (int gen_number,
- size_t size,
+ size_t size,
alloc_context* acontext,
uint32_t flags,
int align_const,
uint8_t* high_page (heap_segment* seg, BOOL concurrent_p);
PER_HEAP
- void revisit_written_page (uint8_t* page, uint8_t* end,
+ void revisit_written_page (uint8_t* page, uint8_t* end,
BOOL concurrent_p, uint8_t*& last_page,
uint8_t*& last_object, BOOL large_objects_p,
size_t& num_marked_objects);
// because it's very short and by the time we are calling it
// the settings may have changed and we'd have to do more work
// to figure out the right GC to record info of.
- //
+ //
// The complications are the GCs triggered without their own
// SuspendEE, in which case we will record that GC's duration
// as its pause duration and the rest toward the GC that
#ifdef DOUBLY_LINKED_FL
// For bucket 0 added list, we don't want to have to go through
// it to count how many bytes it has so we keep a record here.
- // If we need to sweep in gen1, we discard this added list and
+ // If we need to sweep in gen1, we discard this added list and
// need to deduct the size from free_list_space.
// Note that we should really move this and the free_list_space
// accounting into the alloc_list class.
#endif //FEATURE_CARD_MARKING_STEALING
PER_HEAP_ISOLATED
- int generation_skip_ratio_threshold;
+ int generation_skip_ratio_threshold;
PER_HEAP
BOOL gen0_bricks_cleared;
}
#endif //FREE_USAGE_STATS
-inline
+inline
float generation_allocator_efficiency (generation* inst)
{
if ((generation_free_list_allocated (inst) + generation_free_obj_space (inst)) != 0)
inline
size_t generation_unusable_fragmentation (generation* inst)
{
- return (size_t)(generation_free_obj_space (inst) +
+ return (size_t)(generation_free_obj_space (inst) +
(1.0f-generation_allocator_efficiency(inst))*generation_free_list_space (inst));
}
};
// VLT_STK2 -- Any 64 bit value which is on the stack,
- // in 2 successsive DWords.
+ // in 2 successive DWords.
// eg 2 DWords at [ESP+0x10]
struct vlStk2
// We add a simple macro here which defines DAC_ALIGNAS to the C++11 alignas operator
// This helps force the alignment of the next member
// For most cross compilation cases the layout of types simply works
-// There are a few cases (where this macro is helpful) which are not consistent accross platforms:
+// There are a few cases (where this macro is helpful) which are not consistent across platforms:
// - Base class whose size is padded to its align size. On Linux the gcc/clang
// layouts will reuse this padding in the derived class for the first member
// - Class with an vtable pointer and an alignment greater than the pointer size.
static VOID MethodJitting(MethodDesc *pMethodDesc, SString *namespaceOrClassName, SString *methodName, SString *methodSignature);
static VOID MethodJitted(MethodDesc *pMethodDesc, SString *namespaceOrClassName, SString *methodName, SString *methodSignature, PCODE pNativeCodeStartAddress, PrepareCodeConfig *pConfig);
static VOID StubInitialized(ULONGLONG ullHelperStartAddress, LPCWSTR pHelperName);
- static VOID StubsInitialized(PVOID *pHelperStartAddresss, PVOID *pHelperNames, LONG ulNoOfHelpers);
+ static VOID StubsInitialized(PVOID *pHelperStartAddress, PVOID *pHelperNames, LONG ulNoOfHelpers);
static VOID MethodRestored(MethodDesc * pMethodDesc);
static VOID MethodTableRestored(MethodTable * pMethodTable);
static VOID DynamicMethodDestroyed(MethodDesc *pMethodDesc);
static VOID MethodJitting(MethodDesc *pMethodDesc, SString *namespaceOrClassName, SString *methodName, SString *methodSignature);
static VOID MethodJitted(MethodDesc *pMethodDesc, SString *namespaceOrClassName, SString *methodName, SString *methodSignature, PCODE pNativeCodeStartAddress, PrepareCodeConfig *pConfig);
static VOID StubInitialized(ULONGLONG ullHelperStartAddress, LPCWSTR pHelperName) {};
- static VOID StubsInitialized(PVOID *pHelperStartAddresss, PVOID *pHelperNames, LONG ulNoOfHelpers) {};
+ static VOID StubsInitialized(PVOID *pHelperStartAddress, PVOID *pHelperNames, LONG ulNoOfHelpers) {};
static VOID MethodRestored(MethodDesc * pMethodDesc) {};
static VOID MethodTableRestored(MethodTable * pMethodTable) {};
static VOID DynamicMethodDestroyed(MethodDesc *pMethodDesc) {};
// | | | | | | | | | | | | | | | | | | | returnKind
// | | | | | | | | | | | | | | | | | | | |
// | | | | | | | | | | | | | | | | | | | | Arg count
-// | | | | | | | | | | | | | | | | | | | | | Counted occurences
+// | | | | | | | | | | | | | | | | | | | | | Counted occurrences
// | | | | | | | | | | | | | | | | | | | | | Frame size |
// | | | | | | | | | | | | | | | | | | | | | | |
// | | | | | | | | | | | | | | | | | | | | | | untrackedCnt | Header encoding
* EDI = 0x1, ESI = 0x2, EBX = 0x4, EBP = 0x8
*
*/
-const unsigned callPatternTable[80] = { // # of occurences
+const unsigned callPatternTable[80] = { // # of occurrences
0x0a000200, // 30109
0x0c000200, // 22970
0x0c000201, // 19005
// *? matches zero or more occurrences of the previous item conservatively
// + matches 1 or more occurrences of the previous item eagerly
// +? matches 1 or more occurrences of the previous item conservatively
-// ? matches 0 or 1 occurences of the previous item
+// ? matches 0 or 1 occurrences of the previous item
// ( starts a grouping
// ) ends a grouping
//
// Start searching for a match of the given string, starting at
// the given iterator point.
// If a match exists, move the iterator to point to the nearest
- // occurence of s in the string and return TRUE.
+ // occurrence of s in the string and return TRUE.
// If no match exists, return FALSE and leave the iterator unchanged.
BOOL Find(CIterator &i, const SString &s) const;
BOOL Find(CIterator &i, const WCHAR *s) const;
regNumber vlsrReg;
} vlStkReg;
- // VLT_STK2 -- Any 64 bit value which is on the stack, in 2 successsive DWords
+ // VLT_STK2 -- Any 64 bit value which is on the stack, in 2 successive DWords
// eg 2 DWords at [ESP+0x10]
struct
///////////////////////////////////////////////////////////////////////////////
//
-// MEASURE_NOWAY: code to measure and rank dynamic occurences of noway_assert.
+// MEASURE_NOWAY: code to measure and rank dynamic occurrences of noway_assert.
// (Just the appearances of noway_assert, whether the assert is true or false.)
// This might help characterize the cost of noway_assert in non-DEBUG builds,
// or determine which noway_assert should be simple DEBUG-only asserts.
//------------------------------------------------------------------------
// compStressCompileHelper: helper to determine if a stress mode should be enabled
//
-// Argumemnts:
+// Arguments:
// stressArea - stress mode to possibly enable
// weight - percent of time this mode should be turned on
// (range 0 to 100); weight 0 effectively disables
int lpHoistedExprCount; // The register count for the non-FP expressions from inside this loop that have been
// hoisted
int lpLoopVarCount; // The register count for the non-FP LclVars that are read/written inside this loop
- int lpVarInOutCount; // The register count for the non-FP LclVars that are alive inside or accross this loop
+ int lpVarInOutCount; // The register count for the non-FP LclVars that are alive inside or across this loop
int lpHoistedFPExprCount; // The register count for the FP expressions from inside this loop that have been
// hoisted
int lpLoopVarFPCount; // The register count for the FP LclVars that are read/written inside this loop
- int lpVarInOutFPCount; // The register count for the FP LclVars that are alive inside or accross this loop
+ int lpVarInOutFPCount; // The register count for the FP LclVars that are alive inside or across this loop
typedef JitHashTable<CORINFO_FIELD_HANDLE, JitPtrKeyFuncs<struct CORINFO_FIELD_STRUCT_>, bool> FieldHandleSet;
FieldHandleSet* lpFieldsModified; // This has entries (mappings to "true") for all static field and object
* TODO-XArch-CQ: (Low-pri): Jit64 generates in-line code of 8 instructions for (i) above.
* There are hardly any occurrences of this conversion operation in platform
* assemblies or in CQ perf benchmarks (1 occurrence in corelib, microsoft.jscript,
- * 1 occurence in Roslyn and no occurrences in system, system.core, system.numerics
+ * 1 occurrence in Roslyn and no occurrences in system, system.core, system.numerics
* system.windows.forms, scimark, fractals, bio mums). If we ever find evidence that
* doing this optimization is a win, should consider generating in-lined code.
*/
// an active interval, without spilling.
//
// Arguments:
-// regRec - the RegRecord to be unasssigned
+// regRec - the RegRecord to be unassigned
//
// Return Value:
// None.
// physical register record
//
// Arguments:
-// regRec - the physical RegRecord to be unasssigned
+// regRec - the physical RegRecord to be unassigned
// spillRefPosition - The RefPosition at which the assignedInterval is to be spilled
// or nullptr if we aren't spilling
//
// assignedInterval at the given spillRefPosition, if any.
//
// Arguments:
-// regRec - The RegRecord to be unasssigned
+// regRec - The RegRecord to be unassigned
// newRegType - The RegisterType of interval that would be assigned
//
// Return Value:
// assignedInterval at the given spillRefPosition, if any.
//
// Arguments:
-// regRec - the RegRecord to be unasssigned
+// regRec - the RegRecord to be unassigned
// spillRefPosition - The RefPosition at which the assignedInterval is to be spilled
//
// Return Value:
if (varTypeIsStruct(cseLclVarTyp))
{
// Retrieve the struct handle that we recorded while bulding the list of CSE candidates.
- // If all occurances were in GT_IND nodes it could still be NO_CLASS_HANDLE
+ // If all occurrences were in GT_IND nodes it could still be NO_CLASS_HANDLE
//
CORINFO_CLASS_HANDLE structHnd = successfulCandidate->CseDsc()->csdStructHnd;
if (structHnd == NO_CLASS_HANDLE)
// Vector<T>, when 32-bytes, requires at least AVX2
assert(!isVectorT256 || compIsaSupportedDebugOnly(InstructionSet_AVX2));
#elif defined(TARGET_ARM64)
- // We should have alredy exited early if AdvSimd isn't supported
+ // We should have already exited early if AdvSimd isn't supported
assert(compIsaSupportedDebugOnly(InstructionSet_AdvSimd));
#else
#error Unsupported platform
// Look for the stream which must be found for this to work. Note that
// this error is explicitly not posted as an error object since unfound streams
- // are a common occurence and do not warrant a resource file load.
+ // are a common occurrence and do not warrant a resource file load.
IfFailRet(FindStream(rcName, &pStream));
// Get the memory for the stream.
/* extract path string, if any. _Path now points to the first character
* of the path, if any, or the filename or extension, if no path was
- * specified. Scan ahead for the last occurence, if any, of a '/' or
+ * specified. Scan ahead for the last occurrence, if any, of a '/' or
* '\' path separator character. If none is found, there is no path.
* We will also note the last '.' character found, if any, to aid in
* handling the extension.
pSrc--;
// Throw that we don't have enough room (pSrc could be < chars if we had started to process
- // a 4 byte sequence alredy)
+ // a 4 byte sequence already)
Contract::Assert(pSrc >= bytes || pTarget == chars,
"[UTF8Encoding.GetChars]Expected pSrc to be within input buffer or throw due to no output]");
ThrowCharsOverflow(pTarget == chars);
_ASSERTE(fShared);
//
- // Check if an object by this name alredy exists
+ // Check if an object by this name already exists
//
palError = LocateObject(
/* extract path string, if any. _Path now points to the first character
* of the path, if any, or the filename or extension, if no path was
- * specified. Scan ahead for the last occurence, if any, of a '/' or
+ * specified. Scan ahead for the last occurrence, if any, of a '/' or
* '\' path separator character. If none is found, there is no path.
* We will also note the last '.' character found, if any, to aid in
* handling the extension.
**
** Source: test1.c
**
-** Purpose:
-** Tests to see that wcsrchr correctly returns a pointer to the last occurence
+** Purpose:
+** Tests to see that wcsrchr correctly returns a pointer to the last occurrence
** of a character in a a string.
**
**
WCHAR c = (WCHAR)' ';
WCHAR c2 = (WCHAR)'$';
WCHAR *ptr;
-
+
if (PAL_Initialize(argc, argv))
{
return FAIL;
ptr = wcsrchr(str, c);
if (ptr != str + 7)
{
- Fail("ERROR: expected wcsrchr to return pointer to %p, got %p\n",
+ Fail("ERROR: expected wcsrchr to return pointer to %p, got %p\n",
str + 7, ptr);
}
ptr = wcsrchr(str, c2);
if (ptr != NULL)
{
- Fail("ERROR: expected wcsrchr to return pointer to %p, got %p\n",
+ Fail("ERROR: expected wcsrchr to return pointer to %p, got %p\n",
NULL, ptr);
}
** This test is for Object Management Test case for event where Object type is shareable.
** Algorithm
** o Main Process Creates OBJECT_TYPE Object
-** o Create PROCESS_COUNT processes aware of the Shared Object
+** o Create PROCESS_COUNT processes aware of the Shared Object
**
** Author: ShamitP
**
unsigned int processId;
unsigned int operationsFailed;
unsigned int operationsPassed;
- unsigned int operationsTotal;
+ unsigned int operationsTotal;
DWORD operationTime;
unsigned int relationId;
};
int GetParameters( int argc, char **argv)
{
- if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?"))
+ if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?"))
|| !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H"))
{
printf("PAL -Composite Object Management Event Test\n");
printf("Usage:\n");
- printf("Event\n\t[USE_PROCESS_COUNT [greater than 1] \n");
- printf("\t[THREAD_COUNT [greater than 1] \n");
+ printf("Event\n\t[USE_PROCESS_COUNT [greater than 1] \n");
+ printf("\t[THREAD_COUNT [greater than 1] \n");
printf("\t[REPEAT_COUNT [greater than 1]\n");
printf("\t[RELATION_ID [greater than or Equal to 1]\n");
-
+
return -1;
}
- // Trace("Args 1 is [%s], Arg 2 is [%s], Arg 3 is [%s]\n", argv[1], argv[2], argv[3]);
-
USE_PROCESS_COUNT = atoi(argv[1]);
- if( USE_PROCESS_COUNT < 0)
+ if( USE_PROCESS_COUNT < 0)
{
printf("\nInvalid USE_PROCESS_COUNT number, Pass greater than 1\n");
return -1;
}
REPEAT_COUNT = atoi(argv[3]);
- if( REPEAT_COUNT < 1)
+ if( REPEAT_COUNT < 1)
{
printf("\nInvalid REPEAT_COUNT number, Pass greater than 1\n");
return -1;
}
RELATION_ID = atoi(argv[4]);
- if( RELATION_ID < 1)
+ if( RELATION_ID < 1)
{
printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n");
return -1;
/* Variables to capture the file name and the file pointer at process level*/
char processFileName[MAX_LONGPATH];
- FILE *pProcessFile = NULL;
+ FILE *pProcessFile = NULL;
struct ProcessStats processStats;
DWORD dwStartTime;
{
Fail("Error in obtaining the parameters\n");
}
-// Trace("Process created, value of process count is [%d]\n", USE_PROCESS_COUNT);
- /* Register the start time */
+ /* Register the start time */
dwStartTime = GetTickCount();
processStats.relationId = RELATION_ID;
processStats.processId = USE_PROCESS_COUNT;
_snprintf(processFileName, MAX_LONGPATH, "%d_process_event_%d_.txt", USE_PROCESS_COUNT, RELATION_ID);
pProcessFile = fopen(processFileName, "w+");
if(pProcessFile == NULL)
- {
+ {
Fail("Error in opening process File file for write for process [%d]\n", USE_PROCESS_COUNT);
}
_snprintf(fileName, MAX_LONGPATH, "%d_thread_event_%d_.txt", USE_PROCESS_COUNT, RELATION_ID);
pFile = fopen(fileName, "w+");
-
+
if(pFile == NULL)
- {
+ {
Fail("Error in opening thread File for write for process [%d]\n", USE_PROCESS_COUNT);
}
// For each thread we will log operations failed (int), passed (int), total (int)
// and number of ticks (DWORD) for the operations
resultBuffer = new ResultBuffer( THREAD_COUNT, statisticsSize);
- StartTestsEvHandle = CreateEvent(
+ StartTestsEvHandle = CreateEvent(
NULL, /* lpEventAttributes*/
TRUE, /* bManualReset */
FALSE, /* bInitialState */
NULL /* name of Event */
- );
+ );
if( StartTestsEvHandle == NULL )
{
Fail("Error:%d: Unexpected failure "
"to create %s Event for process count %d\n", GetLastError(), sTmpEventName, USE_PROCESS_COUNT );
-
+
}
/* Create StartTest Event */
NULL, /* lpEventAttributes, inheritable to child processes*/
TRUE, /* bAutomaticReset */
TRUE, /* bInitialState */
- NULL
+ NULL
);
-
+
if( hEventHandle == NULL)
{
Fail("Unable to create Event handle for process id [%d], returned error [%d]\n", i, GetLastError());
(LPTHREAD_START_ROUTINE)Run_Thread_event_nonshared,/* thread function */
(LPVOID)dwParam, /* argument to thread function */
0, /* use default creation flags */
- &threadId[i] /* returns the thread identifier*/
+ &threadId[i] /* returns the thread identifier*/
);
-
-
+
+
if(hThread[i] == NULL)
{
Fail("Create Thread failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError());
}
-
+
}
if (!SetEvent(StartTestsEvHandle))
{
- Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError());
+ Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError());
}
/* Test running */
- returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE);
+ returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE);
if( WAIT_OBJECT_0 != returnCode )
{
testStatus = FAIL;
}
- processStats.operationTime = GetTimeDiff(dwStartTime);
+ processStats.operationTime = GetTimeDiff(dwStartTime);
/* Write to a file*/
if(pFile!= NULL)
- {
+ {
for( i = 0; i < THREAD_COUNT; i++ )
- {
+ {
buffer = (struct statistics *)resultBuffer->getResultBuffer(i);
returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId );
- //Trace("Iteration %d over\n", i);
-
}
}
if(fclose(pFile))
/* Logging for the test case over, clean up the handles */
-// Trace("Test Thread %d done\n", USE_PROCESS_COUNT);
/* Clean Up */
for( i = 0; i < THREAD_COUNT; i++ )
{
{
Trace("Error:%d: CloseHandle failed for Process [%d] hEventHandle\n", GetLastError(), USE_PROCESS_COUNT);
testStatus = FAIL;
- }
+ }
PAL_TerminateEx(testStatus);
return testStatus;
void PALAPI Run_Thread_event_nonshared (LPVOID lpParam)
{
unsigned int i = 0;
- DWORD dwWaitResult;
+ DWORD dwWaitResult;
struct statistics stats;
DWORD dwStartTime;
stats.operationTime = 0;
int Id=(int)lpParam;
-
- dwWaitResult = WaitForSingleObject(
+
+ dwWaitResult = WaitForSingleObject(
StartTestsEvHandle, // handle to start test handle
- TIMEOUT);
+ TIMEOUT);
if(dwWaitResult != WAIT_OBJECT_0)
{
for( i = 0; i < REPEAT_COUNT; i++ )
{
- dwWaitResult = WaitForSingleObject(
+ dwWaitResult = WaitForSingleObject(
hEventHandle, // handle to Event
- TIMEOUT);
+ TIMEOUT);
if(dwWaitResult != WAIT_OBJECT_0)
{
-// Trace("Error while waiting for onject @ thread %d, # iter %d, RC is %d, Error is %d\n", Id, i, dwWaitResult, GetLastError());
- stats.operationsFailed += 1;
+ stats.operationsFailed += 1;
stats.operationsTotal += 1;
testStatus = FAIL;
continue;
}
- if (! SetEvent(hEventHandle))
- {
+ if (! SetEvent(hEventHandle))
+ {
// Deal with error.
-// Trace("Error while setting Event @ thread %d # iter %d\n", Id, i);
stats.operationsFailed += 1;
stats.operationsTotal += 1;
// Do we need to have while true loop to attempt to set event?
testStatus = FAIL;
continue;
- }
-
+ }
+
stats.operationsTotal += 1;
stats.operationsPassed += 1;
-// Trace("Successs while setting Event @ iteration %d -> thread %d -> Process %d\n", i, Id, USE_PROCESS_COUNT);
-
}
-
- stats.operationTime = GetTimeDiff(dwStartTime);
+
+ stats.operationTime = GetTimeDiff(dwStartTime);
if(resultBuffer->LogResult(Id, (char *)&stats))
{
Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT);
}
- //Trace("Thread %d over for process %d\n", Id, USE_PROCESS_COUNT);
}
** This test is for Object Management Test case for event where Object type is shareable.
** Algorithm
** o Main Process Creates OBJECT_TYPE Object
-** o Create PROCESS_COUNT processes aware of the Shared Object
+** o Create PROCESS_COUNT processes aware of the Shared Object
**
** Author: ShamitP
** Author: ShamitP
unsigned int processId;
unsigned int operationsFailed;
unsigned int operationsPassed;
- unsigned int operationsTotal;
+ unsigned int operationsTotal;
DWORD operationTime;
unsigned int relationId;
};
int GetParameters( int argc, char **argv)
{
- if( (!((argc == 5) || (argc == 6) ) )|| ((argc == 1) && !strcmp(argv[1],"/?"))
+ if( (!((argc == 5) || (argc == 6) ) )|| ((argc == 1) && !strcmp(argv[1],"/?"))
|| !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H"))
{
printf("PAL -Composite Object Management event Test\n");
printf("Usage:\n");
- printf("main\n\t[USE_PROCESS_COUNT (greater than 1)] \n");
- printf("\t[THREAD_COUNT (greater than 1)] \n");
+ printf("main\n\t[USE_PROCESS_COUNT (greater than 1)] \n");
+ printf("\t[THREAD_COUNT (greater than 1)] \n");
printf("\t[REPEAT_COUNT (greater than 1)]\n");
- printf("\t[RELATION_ID [greater than or equal to 1]\n");
+ printf("\t[RELATION_ID [greater than or equal to 1]\n");
printf("\t[Object Name Suffix]\n");
return -1;
}
- // Trace("Args 1 is [%s], Arg 2 is [%s], Arg 3 is [%s]\n", argv[1], argv[2], argv[3]);
-
USE_PROCESS_COUNT = atoi(argv[1]);
- if( USE_PROCESS_COUNT < 0)
+ if( USE_PROCESS_COUNT < 0)
{
printf("\nInvalid USE_PROCESS_COUNT number, Pass greater than 1\n");
return -1;
}
REPEAT_COUNT = atoi(argv[3]);
- if( REPEAT_COUNT < 1)
+ if( REPEAT_COUNT < 1)
{
printf("\nInvalid REPEAT_COUNT number, Pass greater than 1\n");
return -1;
}
RELATION_ID = atoi(argv[4]);
- if( RELATION_ID < 1)
+ if( RELATION_ID < 1)
{
printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n");
return -1;
DWORD dwParam = 0;
int returnCode = 0;
-
+
/* Variables to capture the file name and the file pointer at thread level*/
char fileName[MAX_PATH];
FILE *pFile = NULL;
/* Variables to capture the file name and the file pointer at process level*/
char processFileName[MAX_PATH];
- FILE *pProcessFile = NULL;
+ FILE *pProcessFile = NULL;
struct ProcessStats processStats;
DWORD dwStartTime;
{
Fail("Error in obtaining the parameters\n");
}
-// Trace("Process created, value of process count is [%d]\n", USE_PROCESS_COUNT);
if(argc == 5)
{
strncat(ObjName, objectSuffix, MAX_PATH - (sizeof(ObjName) + 1) );
}
- /* Register the start time */
+ /* Register the start time */
dwStartTime = GetTickCount();
processStats.relationId = RELATION_ID;
processStats.processId = USE_PROCESS_COUNT;
_snprintf(processFileName, MAX_PATH, "%d_process_event_%d_.txt", USE_PROCESS_COUNT, RELATION_ID);
pProcessFile = fopen(processFileName, "w+");
if(pProcessFile == NULL)
- {
+ {
Fail("Error:%d: in opening Process File for write for process [%d]\n", GetLastError(), USE_PROCESS_COUNT);
}
_snprintf(fileName, MAX_PATH, "%d_thread_event_%d_.txt", USE_PROCESS_COUNT, RELATION_ID);
pFile = fopen(fileName, "w+");
-
+
if(pFile == NULL)
- {
+ {
Fail("Error:%d: in opening thread file for write for process [%d]\n", GetLastError(), USE_PROCESS_COUNT);
}
// For each thread we will log operations failed (int), passed (int), total (int)
{
Fail("Error:%d: Unexpected failure "
"to create %s Event for process count %d\n", GetLastError(), sTmpEventName, USE_PROCESS_COUNT );
-
+
}
/* Create StartTest Event */
hEventHandle = OpenEventW(
EVENT_ALL_ACCESS, /* lpEventAttributes, inheritable to child processes*/
FALSE, /* bAutomaticReset */
- wcObjName
+ wcObjName
);
-
+
if( hEventHandle == NULL)
{
Fail("Unable to create Event handle for process id [%d], returned error [%d]\n", i, GetLastError());
(LPTHREAD_START_ROUTINE)Run_Thread_event_shared,/* thread function */
(LPVOID)dwParam, /* argument to thread function */
0, /* use default creation flags */
- &threadId[i] /* returns the thread identifier*/
+ &threadId[i] /* returns the thread identifier*/
);
-
+
if(hThread[i] == NULL)
{
Fail("Create Thread failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError());
}
-
+
}
if (!SetEvent(StartTestsEvHandle))
{
- Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError());
+ Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError());
}
/* Test running */
- returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE);
+ returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE);
if( WAIT_OBJECT_0 != returnCode )
{
Trace("Wait for Object(s) for %d process returned %d, and GetLastError value is %d\n", USE_PROCESS_COUNT, returnCode, GetLastError());
testStatus = FAIL;
}
-
- processStats.operationTime = GetTimeDiff(dwStartTime);
+
+ processStats.operationTime = GetTimeDiff(dwStartTime);
/* Write to a file*/
if(pFile!= NULL)
- {
+ {
for( i = 0; i < THREAD_COUNT; i++ )
- {
+ {
buffer = (struct statistics *)resultBuffer->getResultBuffer(i);
returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId );
-// Trace("Iteration %d over\n", i);
-
}
}
}
/* Logging for the test case over, clean up the handles */
-// Trace("Test Thread %d done\n", USE_PROCESS_COUNT);
-
for( i = 0; i < THREAD_COUNT; i++ )
{
if(!CloseHandle(hThread[i]) )
{
Trace("Error:%d: CloseHandle failed for Process [%d] hEventHandle\n", GetLastError(), USE_PROCESS_COUNT);
testStatus = FAIL;
- }
+ }
free(wcObjName);
PAL_Terminate();
void PALAPI Run_Thread_event_shared (LPVOID lpParam)
{
unsigned int i = 0;
- DWORD dwWaitResult;
+ DWORD dwWaitResult;
struct statistics stats;
DWORD dwStartTime;
stats.operationTime = 0;
int Id=(int)lpParam;
-
- dwWaitResult = WaitForSingleObject(
+
+ dwWaitResult = WaitForSingleObject(
StartTestsEvHandle, // handle to start test handle
- TIMEOUT);
+ TIMEOUT);
if(dwWaitResult != WAIT_OBJECT_0)
{
for( i = 0; i < REPEAT_COUNT; i++ )
{
- dwWaitResult = WaitForSingleObject(
+ dwWaitResult = WaitForSingleObject(
hEventHandle, // handle to Event
- TIMEOUT);
+ TIMEOUT);
if(dwWaitResult != WAIT_OBJECT_0)
{
- //Trace("Error:%d: while waiting for onject @ thread %d, # iter %d\n", GetLastError(), Id, i);
- stats.operationsFailed += 1;
+ stats.operationsFailed += 1;
stats.operationsTotal += 1;
testStatus = FAIL;
continue;
}
- if (! SetEvent(hEventHandle))
- {
+ if (! SetEvent(hEventHandle))
+ {
// Deal with error.
-// Trace("Error while setting Event @ thread %d # iter %d\n", Id, i);
stats.operationsFailed += 1;
stats.operationsTotal += 1;
// do we need to have while true loop to attempt to set event...?
testStatus = FAIL;
continue;
- }
+ }
stats.operationsTotal += 1;
- stats.operationsPassed += 1;
- // Trace("Successs while setting Event @ iteration %d -> thread %d -> Process %d for handle %d\n", i, Id, USE_PROCESS_COUNT, hEventHandle);
-
+ stats.operationsPassed += 1;
}
-
- stats.operationTime = GetTimeDiff(dwStartTime);
- //Trace("OPeration time is %d", stats.operationTime );
+
+ stats.operationTime = GetTimeDiff(dwStartTime);
if(resultBuffer->LogResult(Id, (char *)&stats))
{
Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT);
}
- //Trace("Thread %d over for process %d\n", Id, USE_PROCESS_COUNT);
}
// The .NET Foundation licenses this file to you under the MIT license.
/*============================================================
-**
+**
** Source Code: main.c and mutex.c
** main.c creates process and waits for all processes to get over
** mutex.c creates a mutex and then calls threads which will contend for the mutex
-**
+**
** This test is for Object Management Test case for Mutex where Object type is not shareable.
** Algorithm
** o Create PROCESS_COUNT processes.
-** o Main Thread of each process creates OBJECT_TYPE Object
-**
+** o Main Thread of each process creates OBJECT_TYPE Object
+**
** Author: ShamitP
**============================================================
*/
unsigned int processId;
unsigned int operationsFailed;
unsigned int operationsPassed;
- unsigned int operationsTotal;
+ unsigned int operationsTotal;
DWORD operationTime;
unsigned int relationId;
};
int GetParameters( int argc, char **argv)
{
- if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?"))
+ if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?"))
|| !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H"))
{
printf("PAL -Composite Object Management Mutex Test\n");
printf("Usage:\n");
- printf("mutex\n\t[USE_PROCESS_COUNT ( greater than 1] \n");
- printf("\t[THREAD_COUNT ( greater than 1] \n");
+ printf("mutex\n\t[USE_PROCESS_COUNT ( greater than 1] \n");
+ printf("\t[THREAD_COUNT ( greater than 1] \n");
printf("\t[REPEAT_COUNT ( greater than 1]\n");
- printf("\t[RELATION_ID [greater than 1]\n");
+ printf("\t[RELATION_ID [greater than 1]\n");
return -1;
}
- // Trace("Args 1 is [%s], Arg 2 is [%s], Arg 3 is [%s]\n", argv[1], argv[2], argv[3]);
-
USE_PROCESS_COUNT = atoi(argv[1]);
- if( USE_PROCESS_COUNT < 0)
+ if( USE_PROCESS_COUNT < 0)
{
printf("\nInvalid USE_PROCESS_COUNT number, Pass greater than 1\n");
return -1;
}
REPEAT_COUNT = atoi(argv[3]);
- if( REPEAT_COUNT < 1)
+ if( REPEAT_COUNT < 1)
{
printf("\nInvalid REPEAT_COUNT number, Pass greater than 1\n");
return -1;
}
RELATION_ID = atoi(argv[4]);
- if( RELATION_ID < 1)
+ if( RELATION_ID < 1)
{
printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n");
return -1;
DWORD dwParam = 0;
int returnCode = 0;
-
+
/* Variables to capture the file name and the file pointer at thread level*/
char fileName[MAX_PATH];
FILE *pFile = NULL;
/* Variables to capture the file name and the file pointer at process level*/
char processFileName[MAX_PATH];
- FILE *pProcessFile = NULL;
+ FILE *pProcessFile = NULL;
struct ProcessStats processStats;
DWORD dwStartTime;
{
Fail("Error in obtaining the parameters\n");
}
-// Trace("Process created, value of process count is [%d]\n", USE_PROCESS_COUNT);
- /* Register the start time */
+ /* Register the start time */
dwStartTime = GetTickCount();
processStats.relationId = RELATION_ID;
processStats.processId = USE_PROCESS_COUNT;
_snprintf(processFileName, MAX_PATH, "%d_process_mutex_%d_.txt", USE_PROCESS_COUNT,RELATION_ID);
pProcessFile = fopen(processFileName, "w+");
if(pProcessFile == NULL)
- {
+ {
Fail("Error in opening process File file for write for process [%d]\n", USE_PROCESS_COUNT);
}
statisticsSize = sizeof(struct statistics);
_snprintf(fileName, MAX_PATH, "%d_thread_mutex_%d_.txt", USE_PROCESS_COUNT, RELATION_ID);
- pFile = fopen(fileName, "w+");
+ pFile = fopen(fileName, "w+");
if(pFile == NULL)
- {
+ {
Fail("Error in opening file for write for process [%d]\n", USE_PROCESS_COUNT);
}
// For each thread we will log operations failed (int), passed (int), total (int)
StartTestsEvHandle = CreateEvent( NULL, /* lpEventAttributes*/
TRUE, /* bManualReset */
FALSE, /* bInitialState */
- NULL
+ NULL
); /* name of Event */
if( StartTestsEvHandle == NULL )
{
Fail("Error:%d: Unexpected failure "
"to create %s Event for process count %d\n", GetLastError(), sTmpEventName, USE_PROCESS_COUNT );
-
+
}
/* Create StartTest Event */
hMutexHandle = CreateMutex(
NULL,
FALSE, /* bInitialOwner, owns initially */
- NULL
+ NULL
);
-
+
if( hMutexHandle == NULL)
{
Fail("Unable to create Mutex handle for process id [%d], returned error [%d]\n", i, GetLastError());
(LPTHREAD_START_ROUTINE)Run_Thread_mutex_nonshared,/* thread function */
(LPVOID)dwParam, /* argument to thread function */
0, /* use default creation flags */
- &threadId[i] /* returns the thread identifier*/
+ &threadId[i] /* returns the thread identifier*/
);
-
+
if(hThread[i] == NULL)
{
Fail("Create Thread failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError());
- }
-
+ }
+
}
-
+
if (!SetEvent(StartTestsEvHandle))
{
- Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError());
+ Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError());
}
/* Test running */
- returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE);
+ returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE);
if( WAIT_OBJECT_0 != returnCode )
{
Trace("Wait for Object(s) for %d process returned %d, and GetLastError value is %d\n", USE_PROCESS_COUNT, returnCode, GetLastError());
testStatus = FAIL;
}
-
- processStats.operationTime = GetTimeDiff(dwStartTime);
+
+ processStats.operationTime = GetTimeDiff(dwStartTime);
/* Write to a file*/
if(pFile!= NULL)
- {
+ {
for( i = 0; i < THREAD_COUNT; i++ )
- {
+ {
buffer = (struct statistics *)resultBuffer->getResultBuffer(i);
returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId );
-// Trace("Iteration %d over\n", i);
-
}
}
fclose(pFile);
/* Logging for the test case over, clean up the handles */
-// Trace("Test Thread %d done\n", USE_PROCESS_COUNT);
-
-
for( i = 0; i < THREAD_COUNT; i++ )
{
if(!CloseHandle(hThread[i]) )
{
Trace("Error:%d: CloseHandle failed for Process [%d] hMutexHandle\n", GetLastError(), USE_PROCESS_COUNT);
testStatus = FAIL;
- }
+ }
PAL_Terminate();
return testStatus;
void PALAPI Run_Thread_mutex_nonshared (LPVOID lpParam)
{
unsigned int i = 0;
- DWORD dwWaitResult;
+ DWORD dwWaitResult;
struct statistics stats;
DWORD dwStartTime;
stats.operationTime = 0;
int Id=(int)lpParam;
-
- dwWaitResult = WaitForSingleObject(
+
+ dwWaitResult = WaitForSingleObject(
StartTestsEvHandle, // handle to mutex
- TIMEOUT);
+ TIMEOUT);
if(dwWaitResult != WAIT_OBJECT_0)
{
for( i = 0; i < REPEAT_COUNT; i++ )
{
- dwWaitResult = WaitForSingleObject(
+ dwWaitResult = WaitForSingleObject(
hMutexHandle, // handle to mutex
- TIMEOUT);
+ TIMEOUT);
if(dwWaitResult != WAIT_OBJECT_0)
{
-// Trace("Error while waiting for onject @ thread %d, # iter %d\n", Id, i);
stats.operationsFailed += 1;
stats.operationsTotal += 1;
testStatus = FAIL;
continue;
}
- if (! ReleaseMutex(hMutexHandle))
- {
+ if (! ReleaseMutex(hMutexHandle))
+ {
// Deal with error.
-// Trace("Error while releasing mutex @ thread %d # iter %d\n", Id, i);
stats.operationsFailed += 1;
stats.operationsTotal += 1;
// Probably need to have while true loop to attempt to release mutex...
testStatus = FAIL;
continue;
- }
+ }
stats.operationsTotal += 1;
- stats.operationsPassed += 1;
- // Trace("Successs while releasing mutex @ iteration %d -> thread %d -> Process %d\n", i, Id, USE_PROCESS_COUNT);
-
+ stats.operationsPassed += 1;
}
- stats.operationTime = GetTimeDiff(dwStartTime);
- //Trace("OPeration time is %d", stats.operationTime );
+ stats.operationTime = GetTimeDiff(dwStartTime);
if(resultBuffer->LogResult(Id, (char *)&stats))
{
Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT);
// The .NET Foundation licenses this file to you under the MIT license.
/*============================================================
-**
+**
** This test is for Object Management Test case for Mutex where Object type is shareable.
-**
+**
** Source Code: main.c and mutex.c
** main.c creates a mutex, creates processes and waits for all processes to get over
** mutex.c create threads which will contend for the mutex
-**
+**
** This test is for Object Management Test case for Mutex where Object type is not shareable.
** Algorithm
** o Main Process Creates OBJECT_TYPE Object
-** o Create PROCESS_COUNT processes aware of the Shared Object
-**
+** o Create PROCESS_COUNT processes aware of the Shared Object
+**
** Author: ShamitP
**
**
/* Test Input Variables */
unsigned int USE_PROCESS_COUNT = 0;
unsigned int THREAD_COUNT = 0;
-unsigned int REPEAT_COUNT = 0;
+unsigned int REPEAT_COUNT = 0;
unsigned int RELATION_ID = 0;
unsigned int processId;
unsigned int operationsFailed;
unsigned int operationsPassed;
- unsigned int operationsTotal;
+ unsigned int operationsTotal;
DWORD operationTime;
unsigned int relationId;
};
int GetParameters( int argc, char **argv)
{
- if( (!((argc == 5) || (argc == 6) ) )|| ((argc == 1) && !strcmp(argv[1],"/?"))
+ if( (!((argc == 5) || (argc == 6) ) )|| ((argc == 1) && !strcmp(argv[1],"/?"))
|| !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H"))
{
printf("PAL -Composite Object Management event Test\n");
printf("Usage:\n");
- printf("main\n\t[USE_PROCESS_COUNT (greater than 1)] \n");
- printf("\t[THREAD_COUNT (greater than 1)] \n");
+ printf("main\n\t[USE_PROCESS_COUNT (greater than 1)] \n");
+ printf("\t[THREAD_COUNT (greater than 1)] \n");
printf("\t[REPEAT_COUNT (greater than 1)]\n");
- printf("\t[RELATION_ID [greater than 1]\n");
+ printf("\t[RELATION_ID [greater than 1]\n");
printf("\t[Object Name Suffix]\n");
return -1;
}
- // Trace("Args 1 is [%s], Arg 2 is [%s], Arg 3 is [%s]\n", argv[1], argv[2], argv[3]);
-
USE_PROCESS_COUNT = atoi(argv[1]);
- if( USE_PROCESS_COUNT < 0)
+ if( USE_PROCESS_COUNT < 0)
{
printf("\nInvalid USE_PROCESS_COUNT number, Pass greater than 1\n");
return -1;
}
REPEAT_COUNT = atoi(argv[3]);
- if( REPEAT_COUNT < 1)
+ if( REPEAT_COUNT < 1)
{
printf("\nInvalid REPEAT_COUNT number, Pass greater than 1\n");
return -1;
}
RELATION_ID = atoi(argv[4]);
- if( RELATION_ID < 1)
+ if( RELATION_ID < 1)
{
printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n");
return -1;
unsigned int i = 0;
HANDLE hThread[MAXIMUM_WAIT_OBJECTS];
DWORD threadId[MAXIMUM_WAIT_OBJECTS];
-
+
char ObjName[MAX_PATH] = "SHARED_MUTEX";
DWORD dwParam = 0;
int returnCode = 0;
-
+
/* Variables to capture the file name and the file pointer*/
char fileName[MAX_PATH];
FILE *pFile = NULL;
/* Variables to capture the file name and the file pointer at process level*/
char processFileName[MAX_PATH];
- FILE *pProcessFile = NULL;
+ FILE *pProcessFile = NULL;
struct ProcessStats processStats;
DWORD dwStartTime;
{
Fail("Error in obtaining the parameters\n");
}
-// Trace("Process created, value of process count is [%d]\n", USE_PROCESS_COUNT);
if(argc == 5)
{
strncat(ObjName, objectSuffix, MAX_PATH - (sizeof(ObjName) + 1) );
}
- /* Register the start time */
+ /* Register the start time */
dwStartTime = GetTickCount();
processStats.relationId = RELATION_ID;
processStats.processId = USE_PROCESS_COUNT;
_snprintf(processFileName, MAX_PATH, "%d_process_mutex_%d_.txt", USE_PROCESS_COUNT, RELATION_ID);
pProcessFile = fopen(processFileName, "w+");
if(pProcessFile == NULL)
- {
+ {
Fail("Error in opening process File file for write for process [%d]\n", USE_PROCESS_COUNT);
} statisticsSize = sizeof(struct statistics);
_snprintf(fileName, MAX_PATH, "%d_thread_mutex_%d_.txt", USE_PROCESS_COUNT, RELATION_ID);
pFile = fopen(fileName, "w+");
if(pFile == NULL)
- {
+ {
Fail("Error in opening file for write for process [%d]\n", USE_PROCESS_COUNT);
}
// For each thread we will log operations failed (int), passed (int), total (int)
// and number of ticks (DWORD) for the operations
resultBuffer = new ResultBuffer( THREAD_COUNT, statisticsSize);
-
+
/* Create StartTest Event */
StartTestsEvHandle = CreateEvent( NULL, /* lpEventAttributes*/
TRUE, /* bManualReset */
{
Fail("Error:%d: Unexpected failure "
"to create %s Event for process count %d\n", GetLastError(), sTmpEventName, USE_PROCESS_COUNT );
-
+
}
hMutexHandle = CreateMutex(
NULL,
FALSE, /* bInitialOwner, owns initially */
- ObjName
+ ObjName
);
-
+
if( (hMutexHandle == NULL)|| (GetLastError() != ERROR_ALREADY_EXISTS))
{
Fail("Unable to create Mutex handle for process id [%d], returned error [%d], expected ERROR_ALREADY_EXISTS\n", i, GetLastError());
(LPTHREAD_START_ROUTINE)Run_Thread_mutex_shared,/* thread function */
(LPVOID)dwParam, /* argument to thread function */
0, /* use default creation flags */
- &threadId[i] /* returns the thread identifier*/
+ &threadId[i] /* returns the thread identifier*/
);
-
+
if(hThread[i] == NULL)
{
Fail("Create Thread failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError());
- }
-
+ }
+
}
-
+
if (!SetEvent(StartTestsEvHandle))
{
- Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError());
+ Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError());
}
/* Test running */
- returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE);
+ returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE);
if( WAIT_OBJECT_0 != returnCode )
{
Trace("Wait for Object(s) for %d process returned %d, and GetLastError value is %d\n", USE_PROCESS_COUNT, returnCode, GetLastError());
testStatus = FAIL;
}
-
- processStats.operationTime = GetTimeDiff(dwStartTime);
-
+
+ processStats.operationTime = GetTimeDiff(dwStartTime);
+
/* Write to a file*/
if(pFile!= NULL)
- {
+ {
for( i = 0; i < THREAD_COUNT; i++ )
- {
+ {
buffer = (struct statistics *)resultBuffer->getResultBuffer(i);
returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId );
-// Trace("Iteration %d over\n", i);
-
}
}
fclose(pFile);
-
+
fprintf(pProcessFile, "%d,%d,%d\n", USE_PROCESS_COUNT, processStats.operationTime, processStats.relationId );
fclose(pProcessFile);
/* Logging for the test case over, clean up the handles */
-
-// Trace("Process Count %d over\n",USE_PROCESS_COUNT);
-
+
for( i = 0; i < THREAD_COUNT; i++ )
{
if(!CloseHandle(hThread[i]) )
{
Trace("Error:%d: CloseHandle failed for Process [%d] hMutexHandle\n", GetLastError(), USE_PROCESS_COUNT);
testStatus = FAIL;
- }
+ }
PAL_Terminate();
return testStatus;
void PALAPI Run_Thread_mutex_shared (LPVOID lpParam)
{
unsigned int i = 0;
- DWORD dwWaitResult;
+ DWORD dwWaitResult;
struct statistics stats;
DWORD dwStartTime;
stats.operationTime = 0;
int Id=(int)lpParam;
-
- dwWaitResult = WaitForSingleObject(
+
+ dwWaitResult = WaitForSingleObject(
StartTestsEvHandle, // handle to mutex
- TIMEOUT);
+ TIMEOUT);
if(dwWaitResult != WAIT_OBJECT_0)
{
for( i = 0; i < REPEAT_COUNT; i++ )
{
- dwWaitResult = WaitForSingleObject(
+ dwWaitResult = WaitForSingleObject(
hMutexHandle, // handle to mutex
- TIMEOUT);
+ TIMEOUT);
if(dwWaitResult != WAIT_OBJECT_0)
{
-// Trace("Error while waiting for onject @ thread %d, # iter %d, Error Returned [%d]\n", Id, i, GetLastError());
stats.operationsFailed += 1;
stats.operationsTotal += 1;
testStatus = FAIL;
continue;
}
- if (! ReleaseMutex(hMutexHandle))
- {
+ if (! ReleaseMutex(hMutexHandle))
+ {
// Deal with error.
-// Trace("Error while releasing mutex @ thread %d # iter %d\n", Id, i);
stats.operationsFailed += 1;
stats.operationsTotal += 1;
// Probably need to have while true loop to attempt to release mutex...
testStatus = FAIL;
continue;
- }
-
+ }
+
stats.operationsTotal += 1;
- stats.operationsPassed += 1;
-// Trace("Successs while releasing mutex @ iteration %d -> thread %d -> Process count %d\n", i, Id, USE_PROCESS_COUNT);
-
+ stats.operationsPassed += 1;
}
- stats.operationTime = GetTimeDiff(dwStartTime);
+ stats.operationTime = GetTimeDiff(dwStartTime);
if(resultBuffer->LogResult(Id, (char *)&stats))
{
Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT);
return -1;
}
- // Trace("Args 1 is [%s], Arg 2 is [%s], Arg 3 is [%s]\n", argv[1], argv[2], argv[3]);
-
USE_PROCESS_COUNT = atoi(argv[1]);
if( USE_PROCESS_COUNT < 0)
{
{
Fail("Error in obtaining the parameters\n");
}
- // Trace("Process created, value of process count is [%d]\n", USE_PROCESS_COUNT);
/* Register the start time */
dwStartTime = GetTickCount();
{
buffer = (struct statistics *)resultBuffer->getResultBuffer(i);
returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId );
- //Trace("Iteration %d over\n", i);
-
}
}
fclose(pFile);
/* Logging for the test case over, clean up the handles */
-// Trace("Test Thread %d done\n", USE_PROCESS_COUNT);
-
for( i = 0; i < THREAD_COUNT; i++ )
{
if(!CloseHandle(hThread[i]) )
if(dwWaitResult != WAIT_OBJECT_0)
{
-// Trace("Error while waiting for onject @ thread %d, # iter %d, RC is %d, Error is %d\n", Id, i, dwWaitResult, GetLastError());
stats.operationsFailed += 1;
stats.operationsTotal += 1;
testStatus = FAIL;
if (! ReleaseSemaphore(hSemaphoreHandle, 1, NULL))
{
// Deal with error.
- // Trace("Error while releasing Semaphore @ thread %d # iter %d\n", Id, i);
stats.operationsFailed += 1;
stats.operationsTotal += 1;
// Probably need to have while true loop to attempt to release semaphore...
stats.operationsTotal += 1;
stats.operationsPassed += 1;
-// Trace("Successs while releasing Semaphore @ iteration %d -> thread %d -> Process %d\n", i, Id, USE_PROCESS_COUNT);
-
}
stats.operationTime = GetTimeDiff(dwStartTime);
{
Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT);
}
- // Trace("Thread %d over for process %d\n", Id, USE_PROCESS_COUNT);
}
{
Fail("Error in obtaining the parameters\n");
}
-// Trace("Process created, value of process count is [%d]\n", USE_PROCESS_COUNT);
if(argc == 6)
{
{
buffer = (struct statistics *)resultBuffer->getResultBuffer(i);
returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId );
-// Trace("Iteration %d over\n", i);
-
}
}
fclose(pFile);
/* Logging for the test case over, clean up the handles */
-// Trace("Test Thread %d done\n", USE_PROCESS_COUNT);
for( i = 0; i < THREAD_COUNT; i++ )
{
if(!CloseHandle(hThread[i]) )
if(dwWaitResult != WAIT_OBJECT_0)
{
-// Trace("Error while waiting for onject @ thread %d, # iter %d, RC is %d, Error is %d\n", Id, i, dwWaitResult, GetLastError());
stats.operationsFailed += 1;
stats.operationsTotal += 1;
testStatus = FAIL;
if (! ReleaseSemaphore(hSemaphoreHandle, 1, NULL))
{
// Deal with error.
- // Trace("Error while releasing Semaphore @ thread %d # iter %d\n", Id, i);
stats.operationsFailed += 1;
stats.operationsTotal += 1;
// Probably need to have while true loop to attempt to release semaphore..
stats.operationsTotal += 1;
stats.operationsPassed += 1;
-// Trace("Successs while releasing Semaphore @ iteration %d -> thread %d -> Process %d\n", i, Id, USE_PROCESS_COUNT);
-
}
stats.operationTime = GetTimeDiff(dwStartTime);
{
Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT);
}
- // Trace("Thread %d over for process %d\n", Id, USE_PROCESS_COUNT);
}
/*============================================================
**Source Code: main.c and mutex.c
** main.c creates process and waits for all processes to get over
-** mutex.c creates a mutex and then calls threads which will
+** mutex.c creates a mutex and then calls threads which will
** contend for the mutex
**
** This test is for WFMO Test case for Mutex
** Algorithm
** o Create PROCESS_COUNT processes.
-** o Main Thread of each process creates OBJECT_TYPE Object
+** o Main Thread of each process creates OBJECT_TYPE Object
**
** Author: ShamitP
**
unsigned int processId;
unsigned int operationsFailed;
unsigned int operationsPassed;
- unsigned int operationsTotal;
+ unsigned int operationsTotal;
DWORD operationTime;
unsigned int relationId;
int GetParameters( int argc, char **argv)
{
- if( (argc != 6) || ((argc == 1) && !strcmp(argv[1],"/?"))
+ if( (argc != 6) || ((argc == 1) && !strcmp(argv[1],"/?"))
|| !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H"))
{
printf("PAL -Composite WFMO Test\n");
printf("Usage:\n");
- printf("mutex\n\t[USE_PROCESS_COUNT [greater than 0] \n");
- printf("\t[THREAD_COUNT [greater than 0] \n");
+ printf("mutex\n\t[USE_PROCESS_COUNT [greater than 0] \n");
+ printf("\t[THREAD_COUNT [greater than 0] \n");
printf("\t[REPEAT_COUNT [greater than 0]\n");
printf("\t[SLEEP_LENGTH [greater than 0]\n");
- printf("\t[RELATION_ID [greater than 0]\n");
-
-
+ printf("\t[RELATION_ID [greater than 0]\n");
+
return -1;
}
- // Trace("Args 1 is [%s], Arg 2 is [%s], Arg 3 is [%s]\n", argv[1], argv[2], argv[3]);
-
USE_PROCESS_COUNT = atoi(argv[1]);
- if( USE_PROCESS_COUNT < 0)
+ if( USE_PROCESS_COUNT < 0)
{
printf("\nInvalid USE_PROCESS_COUNT number, Pass greater than 1\n");
return -1;
}
REPEAT_COUNT = atoi(argv[3]);
- if( REPEAT_COUNT < 1)
+ if( REPEAT_COUNT < 1)
{
printf("\nInvalid REPEAT_COUNT number, Pass greater than 1\n");
return -1;
}
SLEEP_LENGTH = atoi(argv[4]);
- if( SLEEP_LENGTH < 1)
+ if( SLEEP_LENGTH < 1)
{
printf("\nMain Process:Invalid SLEEP_LENGTH number, Pass greater than 1\n");
return -1;
}
RELATION_ID = atoi(argv[5]);
- if( RELATION_ID < 1)
+ if( RELATION_ID < 1)
{
printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n");
return -1;
PALTEST(composite_wfmo_paltest_composite_wfmo, "composite/wfmo/paltest_composite_wfmo")
{
- unsigned int i = 0;
+ unsigned int i = 0;
HANDLE hThread[MAXIMUM_WAIT_OBJECTS];
DWORD threadId[MAXIMUM_WAIT_OBJECTS];
int returnCode = 0;
-
+
DWORD dwParam = 0;
/* Variables to capture the file name and the file pointer at thread level*/
/* Variables to capture the file name and the file pointer at process level*/
char processFileName[MAX_PATH];
- FILE *pProcessFile = NULL;
+ FILE *pProcessFile = NULL;
struct ProcessStats processStats;
DWORD dwStartTime;
{
Fail("Error in obtaining the parameters\n");
}
-// Trace("Process created, value of process count is [%d] and no. of threads is [%d]\n", USE_PROCESS_COUNT, THREAD_COUNT);
- /* Register the start time */
+ /* Register the start time */
dwStartTime = GetTickCount();
processStats.relationId = RELATION_ID;
processStats.processId = USE_PROCESS_COUNT;
_snprintf(processFileName, MAX_PATH, "%d_process_wfmo_%d_.txt", USE_PROCESS_COUNT, RELATION_ID);
pProcessFile = fopen(processFileName, "w+");
if(pProcessFile == NULL)
- {
+ {
Fail("Error:%d: in opening Process File for write for process [%d]\n", GetLastError(), USE_PROCESS_COUNT);
}
_snprintf(fileName, MAX_PATH, "%d_thread_wfmo_%d_.txt", USE_PROCESS_COUNT, RELATION_ID);
pFile = fopen(fileName, "w+");
if(pFile == NULL)
- {
+ {
Fail("Error in opening file for write for process [%d], error [%d]\n", USE_PROCESS_COUNT, GetLastError());
}
// For each thread we will log operations failed (int), passed (int), total (int)
{
Fail("Error:%d: Unexpected failure "
"to create start tests Event for process count %d\n", GetLastError(), USE_PROCESS_COUNT );
-
+
}
/* Create StartTest Event */
hMutexHandle = CreateMutex(
NULL,
FALSE, /* bInitialOwner, owns initially */
- NULL
+ NULL
);
-
+
if( hMutexHandle == NULL)
{
Fail("Unable to create Mutex handle for process id [%d], returned error [%d]\n", i, GetLastError());
(LPTHREAD_START_ROUTINE)Run_Thread_composite_wfmo,/* thread function */
(LPVOID)dwParam, /* argument to thread function */
0, /* use default creation flags */
- &threadId[i] /* returns the thread identifier*/
+ &threadId[i] /* returns the thread identifier*/
);
if(hThread[i] == NULL)
{
Fail("Create Thread failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError());
}
-
- }
-
+ }
+
if (!SetEvent(StartTestsEvHandle))
{
- Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError());
+ Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError());
}
/* Test running */
}
else
{
- returnCode = WaitForSingleObject(hThread[0], INFINITE);
+ returnCode = WaitForSingleObject(hThread[0], INFINITE);
}
if( WAIT_OBJECT_0 != returnCode )
testStatus = FAIL;
}
- processStats.operationTime = GetTimeDiff(dwStartTime);
+ processStats.operationTime = GetTimeDiff(dwStartTime);
/* Write to a file*/
if(pFile!= NULL)
- {
+ {
for( i = 0; i < THREAD_COUNT; i++ )
- {
+ {
buffer = (struct statistics *)resultBuffer->getResultBuffer(i);
returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId );
- //Trace("Iteration %d over\n", i);
-
}
}
if(fclose(pFile))
}
/* Logging for the test case over, clean up the handles */
- // Trace("Test Process %d done\n", USE_PROCESS_COUNT);
- //Trace("Contents of the buffer are [%s]\n", resultBuffer->getResultBuffer());
for( i = 0; i < THREAD_COUNT; i++ )
{
if(!CloseHandle(hThread[i]) )
unsigned int i = 0;
struct statistics stats;
- DWORD dwWaitResult;
+ DWORD dwWaitResult;
DWORD dwStartTime;
stats.relationId = RELATION_ID;
stats.operationTime = 0;
int Id=(int)lpParam;
-
- dwWaitResult = WaitForSingleObject(
+
+ dwWaitResult = WaitForSingleObject(
StartTestsEvHandle, // handle to mutex
- INFINITE);
+ INFINITE);
if(dwWaitResult != WAIT_OBJECT_0)
{
/* Run the tests repeat count times */
for( i = 0; i < REPEAT_COUNT; i++ )
{
- dwWaitResult = WaitForSingleObject(
+ dwWaitResult = WaitForSingleObject(
hMutexHandle, // handle to mutex
- INFINITE);
-
+ INFINITE);
+
if(dwWaitResult != WAIT_OBJECT_0)
{
Trace("Error:%d: while waiting for onject @ thread %d, # iter %d\n", GetLastError(), Id, i);
Sleep(SLEEP_LENGTH);
- if (!ReleaseMutex(hMutexHandle))
- {
+ if (!ReleaseMutex(hMutexHandle))
+ {
// Deal with error.
Trace("Error:%d: while releasing mutex @ thread %d # iter %d\n", GetLastError(), Id, i);
stats.operationsFailed += 1;
// do we need to have while true loop to attempt to release mutex...?
testStatus = FAIL;
continue;
- }
+ }
stats.operationsTotal += 1;
stats.operationsPassed += 1;
-
-// Trace("Successs while releasing mutex @ iteration %d -> thread %d -> Process %d\n", i, Id, USE_PROCESS_COUNT);
-
}
-
- stats.operationTime = GetTimeDiff(dwStartTime);
- // Trace("Operation Time %lu, Process Count [%d], ThreadCount[%d]\n", stats.operationTime, USE_PROCESS_COUNT, Id);
+
+ stats.operationTime = GetTimeDiff(dwStartTime);
if(resultBuffer->LogResult(Id, (char *)&stats))
{
Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT);
}
- // Trace("Contents of the buffer are after thread [%d]\n", Id);
}
/*
Changes to the following types may require revisiting the above layout.
-
+
In coreclr\src\inc\cordebuginfo.h
enum VarLocType
} vlStkReg;
// VLT_STK2 -- Any 64 bit value which is on the stack,
- // in 2 successsive DWords.
+ // in 2 successive DWords.
// eg 2 DWords at [ESP+0x10]
struct
{
if (first)
{
- _writer.WriteLine("Methods with identical disasssbly skipped in common method diff:");
+ _writer.WriteLine("Methods with identical disassembly skipped in common method diff:");
first = false;
}
_writer.WriteLine(commonMethod.Key);
/* extract path string, if any. Path now points to the first character
* of the path, if any, or the filename or extension, if no path was
- * specified. Scan ahead for the last occurence, if any, of a '/' or
+ * specified. Scan ahead for the last occurrence, if any, of a '/' or
* '\' path separator character. If none is found, there is no path.
* We will also note the last '.' character found, if any, to aid in
* handling the extension.
pStart = (BYTE *)(base + size);
}
- // Randomize the adddress space
+ // Randomize the address space
pStart += GetOsPageSize() * randomPageOffset;
s_CodeAllocStart = pStart;
ctx.R11 = (UINT)pData->R11;
ctx.Pc = (UINT)pData->Pc;
// For some functions which do localloc, sp is saved in r9. In order to perform unwinding for functions r9 must be set in the context.
- // r9 is stored at offset (sizeof(PROFILE_PLATFORM_SPECIFIC_DATA) (this also includes the padding done for 8-byte stack alignement) + size required for (r0,r3)) bytes from pData
+ // r9 is stored at offset (sizeof(PROFILE_PLATFORM_SPECIFIC_DATA) (this also includes the padding done for 8-byte stack alignment) + size required for (r0,r3)) bytes from pData
ctx.R9 = *((UINT*)pData + (sizeof(PROFILE_PLATFORM_SPECIFIC_DATA) + 8)/4);
// walk up a frame to the caller frame (called the managed method which
}
#ifdef FEATURE_64BIT_ALIGNMENT
-// Returns true iff the native view of this type requires 64-bit aligment.
+// Returns true iff the native view of this type requires 64-bit alignment.
bool MethodTable::NativeRequiresAlign8()
{
LIMITED_METHOD_CONTRACT;
ReleaseHolder<IMDInternalImport> scope (GetFile()->GetMDImportWithRef());
IfFailThrow(scope->GetScopeProps(NULL, &pSignature->mvid));
- // Use the NGen image if posssible. IL image does not even have to be present on CoreCLR.
+ // Use the NGen image if possible. IL image does not even have to be present on CoreCLR.
if (GetFile()->HasNativeImage())
{
PEImageHolder pNativeImage(GetFile()->GetNativeImageWithRef());
WRAPPER_NO_CONTRACT;
SUPPORTS_DAC;
- _ASSERTE(!m_fEnd); // check we are not alredy at end
+ _ASSERTE(!m_fEnd); // check we are not already at end
MoveNext();
}
// operator --
{
LIMITED_METHOD_CONTRACT;
- _ASSERTE(!m_fEnd); // check we are not alredy at end
+ _ASSERTE(!m_fEnd); // check we are not already at end
return m_pBucket->m_rgKeys[m_id];
}
//accessors : SetDisc() , sets the discriminator
WRAPPER_NO_CONTRACT;
SUPPORTS_DAC;
- _ASSERTE(!m_fEnd); // check we are not alredy at end
+ _ASSERTE(!m_fEnd); // check we are not already at end
return m_pBucket->GetValue(m_id);
}
}
}
- // The rules for constraint cycles are same as rules for acccess checks
+ // The rules for constraint cycles are same as rules for access checks
if (fNeedAccessChecks)
{
// Check for cyclical class constraints
MethodTable * pDeclMT = m_pDecl->GetImplMethodTable();
INDEBUG(BOOL dbg_fInterfaceFound = FALSE);
- // Call code:ProcessMap for every (duplicate) occurence of interface code:pDeclMT in the interface
+ // Call code:ProcessMap for every (duplicate) occurrence of interface code:pDeclMT in the interface
// map of code:m_pImpl
MethodTable::InterfaceMapIterator it = m_pImpl->GetImplMethodTable()->IterateInterfaceMap();
while (it.Next())
#endif
#ifdef FEATURE_64BIT_ALIGNMENT
- // Returns true iff the native view of this type requires 64-bit aligment.
+ // Returns true iff the native view of this type requires 64-bit alignment.
bool NativeRequiresAlign8();
#endif // FEATURE_64BIT_ALIGNMENT
{ LIMITED_METHOD_CONTRACT; return m_pDeclMT->GetNumMethods(); }
virtual void UpdateImplMethodDesc(MethodDesc* pMD, UINT32 slotNumber)
- { LIMITED_METHOD_CONTRACT; }
+ { LIMITED_METHOD_CONTRACT; }
}; // class MethodDataInterface
{ WRAPPER_NO_CONTRACT; return m_pDecl->GetNumVirtuals(); }
virtual void UpdateImplMethodDesc(MethodDesc* pMD, UINT32 slotNumber)
- { LIMITED_METHOD_CONTRACT; }
+ { LIMITED_METHOD_CONTRACT; }
protected:
UINT32 MapToImplSlotNumber(UINT32 slotNumber);
} // MethodTableBuilder::LoadApproxInterfaceMap
//*******************************************************************************
-// Fills array of TypeIDs with all duplicate occurences of pDeclIntfMT in the interface map.
+// Fills array of TypeIDs with all duplicate occurrences of pDeclIntfMT in the interface map.
//
// Arguments:
// rg/c DispatchMapTypeIDs - Array of TypeIDs and its count of elements.
-// pcIfaceDuplicates - Number of duplicate occurences of the interface in the interface map (ideally <=
+// pcIfaceDuplicates - Number of duplicate occurrences of the interface in the interface map (ideally <=
// count of elements TypeIDs.
//
// Note: If the passed rgDispatchMapTypeIDs array is smaller than the number of duplicates, fills it
&pItfType->GetSubstitution(),
pDeclIntfSubst,
&newVisited))
- { // We found another occurence of this interface
+ { // We found another occurrence of this interface
// Can we fit it into the TypeID array?
if (*pcIfaceDuplicates < cDispatchMapTypeIDs)
{
//
// Note on covariant return types: right now we only support covariant returns for MethodImpls on
- // classes, where the MethodDecl is also on a class. Interface methods are not supported.
+ // classes, where the MethodDecl is also on a class. Interface methods are not supported.
// We will also allow covariant return types if both the MethodImpl and MethodDecl are not on the same type.
//
}
Substitution *pDeclSubst = &bmtMetaData->pMethodDeclSubsts[m];
-
+
MethodTable * pDeclMT = NULL;
MethodSignature declSig(GetModule(), szName, pSig, cbSig, NULL);
{ // 2. Get or create the correct substitution
if (pDeclMT->IsInterface())
- {
+ {
// If the declaration method is a part of an interface, search through
// the interface map to find the matching interface so we can provide
// the correct substitution chain.
// Track whether field layout of this type depend on information outside its containing module and compilation unit
//
// It is a stronger condition than MethodTable::IsInheritanceChainLayoutFixedInCurrentVersionBubble().
- // It has to remain fixed accross versioning changes in the module dependencies. In particular, it does
+ // It has to remain fixed across versioning changes in the module dependencies. In particular, it does
// not take into account NonVersionable attribute. Otherwise, adding NonVersionable attribute to existing
// type would be ReadyToRun incompatible change.
//
//
// Arguments:
// rg/c DispatchMapTypeIDs - Array of TypeIDs and its count of elements.
- // pcIfaceDuplicates - Number of duplicate occurences of the interface in the interface map (ideally <=
+ // pcIfaceDuplicates - Number of duplicate occurrences of the interface in the interface map (ideally <=
// count of elements TypeIDs).
//
void
// Decode indirection cell from callsite if it is not present
if (pIndirection == NULL)
{
- // Asssume that the callsite is call [xxxxxxxx]
+ // Assume that the callsite is call [xxxxxxxx]
PCODE retAddr = pEMFrame->GetReturnAddress();
#ifdef TARGET_X86
pIndirection = *(((TADDR *)retAddr) - 1);
// Decode indirection cell from callsite if it is not present
if (pCell == NULL)
{
- // Asssume that the callsite is call [xxxxxxxx]
+ // Assume that the callsite is call [xxxxxxxx]
PCODE retAddr = pFrame->GetReturnAddress();
#ifdef TARGET_X86
pCell = *(((TADDR **)retAddr) - 1);
if (!(&g_profControlBlock)->pProfInterface->IsCallback3Supported())
return TRUE;
- // V4 profiler binaries must opt in to bypasssing transparency checks in full trust
+ // V4 profiler binaries must opt in to bypassing transparency checks in full trust
// assemblies.
if (((&g_profControlBlock)->dwEventMask & COR_PRF_DISABLE_TRANSPARENCY_CHECKS_UNDER_FULL_TRUST) != 0)
return TRUE;
UINT32 m_signature;
#else
#ifdef HOST_64BIT
- //README ALIGNEMENT: in retail mode UINT m_numCodeBytes does not align to 16byte for the code
+ //README ALIGNMENT: in retail mode UINT m_numCodeBytes does not align to 16byte for the code
// after the Stub struct. This is to pad properly
UINT m_pad_code_bytes;
#endif // HOST_64BIT
{
}
- virtual UINT GetAligment()
+ virtual UINT GetAlignment()
{
return sizeof(DWORD);
}
* Since there is no consistent API on Unix to get the CPU utilization
* from a user process, getrusage and gettimeofday are used to
* compute the current process's CPU utilization instead. The CPU utilization
- * returned is sum of utilization accross all processors, e.g. this function will
+ * returned is sum of utilization across all processors, e.g. this function will
* return 200 when two cores are running at 100%.
*/
PALEXPORT int32_t SystemNative_GetCpuUtilization(ProcessCpuInformation* previousCpuInfo);
_readLineSB.Length = len - 1;
if (!previouslyProcessed)
{
- // The ReadLine input may wrap accross terminal rows and we need to handle that.
+ // The ReadLine input may wrap across terminal rows and we need to handle that.
// note: ConsolePal will cache the cursor position to avoid making many slow cursor position fetch operations.
if (ConsolePal.TryGetCursorPosition(out int left, out int top, reinitializeForRead: true) &&
left == 0 && top > 0)
}
[ConditionalFact(nameof(ManualTestsEnabled))]
- public static void ReadLine_BackSpaceCanMoveAccrossWrappedLines()
+ public static void ReadLine_BackSpaceCanMoveAcrossWrappedLines()
{
Console.WriteLine("Please press 'a' until it wraps to the next terminal line, then press 'Backspace' until the input is erased, and then type a single 'a' and press 'Enter'.");
Console.Write("Input: ");
return new object[]
{
requestedKeyChord,
- new ConsoleKeyInfo(keyChar, consoleKey,
+ new ConsoleKeyInfo(keyChar, consoleKey,
control: modifiers.HasFlag(ConsoleModifiers.Control),
alt: modifiers.HasFlag(ConsoleModifiers.Alt),
shift: modifiers.HasFlag(ConsoleModifiers.Shift))
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
// "Reserved" is documented as "Reserved. Do not use.", so it's not clear whether we actually need to test this in any unit tests.
- // Additionally, the values are not consistent accross Windows (GDI+) and Unix (libgdiplus)
+ // Additionally, the values are not consistent across Windows (GDI+) and Unix (libgdiplus)
Assert.Equal(expectedReserved, data.Reserved);
}
[ConditionalTheory(Helpers.IsDrawingSupported)]
[InlineData(PenAlignment.Center - 1)]
[InlineData(PenAlignment.Right + 1)]
- public void Alignment_SetInvalid_ThrowsInvalidEnumArgumentException(PenAlignment aligment)
+ public void Alignment_SetInvalid_ThrowsInvalidEnumArgumentException(PenAlignment alignment)
{
using (var brush = new SolidBrush(Color.Red))
using (var pen = new Pen(brush))
{
- Assert.ThrowsAny<ArgumentException>(() => pen.Alignment = aligment);
+ Assert.ThrowsAny<ArgumentException>(() => pen.Alignment = alignment);
}
}
string sInFile = Helpers.GetTestBitmapPath("48x48_multiple_entries_4bit.ico");
using (Bitmap bmp = new Bitmap(sInFile))
{
- // These values are inconsistent accross Windows & Unix: 0 on Windows, 16 on Unix
+ // These values are inconsistent across Windows & Unix: 0 on Windows, 16 on Unix
Assert.Equal(16, bmp.Palette.Entries.Length);
Assert.Equal(-16777216, bmp.Palette.Entries[0].ToArgb());
Assert.Equal(-16777216, bmp.Palette.Entries[1].ToArgb());
string sInFile = Helpers.GetTestBitmapPath("48x48_multiple_entries_4bit.ico");
using (Bitmap bmp = new Bitmap(sInFile))
{
- // These values are inconsistent accross Windows & Unix: 0 on Windows, 16 on Unix
+ // These values are inconsistent across Windows & Unix: 0 on Windows, 16 on Unix
Assert.Equal(0, bmp.Palette.Entries.Length);
}
}
string sInFile = Helpers.GetTestBitmapPath("VisualPng.ico");
using (Bitmap bmp = new Bitmap(sInFile))
{
- // These values areinconsistent accross Windows & Unix: 0 on Windows, 16 on Unix
+ // These values areinconsistent across Windows & Unix: 0 on Windows, 16 on Unix
Assert.Equal(16, bmp.Palette.Entries.Length);
Assert.Equal(-16777216, bmp.Palette.Entries[0].ToArgb());
string sInFile = Helpers.GetTestBitmapPath("VisualPng.ico");
using (Bitmap bmp = new Bitmap(sInFile))
{
- // These values areinconsistent accross Windows & Unix: 0 on Windows, 16 on Unix
+ // These values areinconsistent across Windows & Unix: 0 on Windows, 16 on Unix
Assert.Equal(0, bmp.Palette.Entries.Length);
}
}
string sInFile = Helpers.GetTestBitmapPath("48x48_one_entry_1bit.ico");
using (Bitmap bmp = new Bitmap(sInFile))
{
- // These values are inconsistent accross Windows & Unix: 0 on Windows, 16 on Unix
+ // These values are inconsistent across Windows & Unix: 0 on Windows, 16 on Unix
Assert.Equal(2, bmp.Palette.Entries.Length);
Assert.Equal(-16777216, bmp.Palette.Entries[0].ToArgb());
Assert.Equal(-1, bmp.Palette.Entries[1].ToArgb());
string sInFile = Helpers.GetTestBitmapPath("48x48_one_entry_1bit.ico");
using (Bitmap bmp = new Bitmap(sInFile))
{
- // These values are inconsistent accross Windows & Unix: 0 on Windows, 16 on Unix
+ // These values are inconsistent across Windows & Unix: 0 on Windows, 16 on Unix
Assert.Equal(0, bmp.Palette.Entries.Length);
}
}
string sInFile = Helpers.GetTestBitmapPath("64x64_one_entry_8bit.ico");
using (Bitmap bmp = new Bitmap(sInFile))
{
- // This value is inconsistent accross Windows & Unix: 0 on Windows, 256 on Unix
+ // This value is inconsistent across Windows & Unix: 0 on Windows, 256 on Unix
Assert.Equal(256, bmp.Palette.Entries.Length);
}
}
string sInFile = Helpers.GetTestBitmapPath("64x64_one_entry_8bit.ico");
using (Bitmap bmp = new Bitmap(sInFile))
{
- // This value is inconsistent accross Windows & Unix: 0 on Windows, 256 on Unix
+ // This value is inconsistent across Windows & Unix: 0 on Windows, 256 on Unix
Assert.Equal(0, bmp.Palette.Entries.Length);
}
}
string sInFile = Helpers.GetTestBitmapPath("96x96_one_entry_8bit.ico");
using (Bitmap bmp = new Bitmap(sInFile))
{
- // This value is inconsistent accross Unix and Windows.
+ // This value is inconsistent across Unix and Windows.
Assert.Equal(256, bmp.Palette.Entries.Length);
}
}
string sInFile = Helpers.GetTestBitmapPath("96x96_one_entry_8bit.ico");
using (Bitmap bmp = new Bitmap(sInFile))
{
- // This value is inconsistent accross Unix and Windows.
+ // This value is inconsistent across Unix and Windows.
Assert.Equal(0, bmp.Palette.Entries.Length);
}
}
Assert.Equal(72, bmp.HorizontalResolution);
Assert.Equal(72, bmp.VerticalResolution);
- // This value is not consistent accross Windows & Unix
+ // This value is not consistent across Windows & Unix
// Assert.Equal(77896, bmp.Flags);
ColorPalette cp = bmp.Palette;
Assert.Equal(256, cp.Entries.Length);
- // This value is not consistent accross Windows & Unix
+ // This value is not consistent across Windows & Unix
// Assert.Equal(0, cp.Flags);
for (int i = 0; i < 256; i++)
{
{
if (!IsConnected)
{
- // The locator cannot be marshalled accross apartments, so we must create the locator
+ // The locator cannot be marshalled across apartments, so we must create the locator
// and get the IWbemServices from an MTA thread
if (!MTAHelper.IsNoContextMTA())
{
Assert.Throws<ArgumentNullException>("socketAddress", () => endPoint.Create(null));
}
- public static IEnumerable<object[]> Create_InvalidAdddressFamily_TestData()
+ public static IEnumerable<object[]> Create_InvalidAddressFamily_TestData()
{
yield return new object[] { new IPEndPoint(2, 500), new SocketAddress(Sockets.AddressFamily.InterNetworkV6) };
yield return new object[] { new IPEndPoint(IPAddress.Parse("192.169.0.9"), 500), new SocketAddress(Sockets.AddressFamily.InterNetworkV6) };
}
[Theory]
- [MemberData(nameof(Create_InvalidAdddressFamily_TestData))]
+ [MemberData(nameof(Create_InvalidAddressFamily_TestData))]
public static void Create_InvalidAddressFamily_ThrowsArgumentException(IPEndPoint endPoint, SocketAddress socketAddress)
{
AssertExtensions.Throws<ArgumentException>("socketAddress", () => endPoint.Create(socketAddress));
(Type, string, string)[] key = ClassifyFailure(exception);
ErrorType failureType = _failureTypes.GetOrAdd(key, _ => new ErrorType(exception.ToString()));
- failureType.OccurencesQueue.Enqueue((timestamp.Value, metadata));
+ failureType.OccurrencesQueue.Enqueue((timestamp.Value, metadata));
// classify exception according to type, message and callsite of itself and any inner exceptions
static (Type exception, string message, string callSite)[] ClassifyFailure(Exception exn)
private sealed class ErrorType : IErrorType
{
public string ErrorMessage { get; }
- public ConcurrentQueue<(DateTime, string?)> OccurencesQueue = new ConcurrentQueue<(DateTime, string?)>();
+ public ConcurrentQueue<(DateTime, string?)> OccurrencesQueue = new ConcurrentQueue<(DateTime, string?)>();
public ErrorType(string errorText)
{
ErrorMessage = errorText;
}
- public IReadOnlyCollection<(DateTime timestamp, string? metadata)> Occurrences => OccurencesQueue;
+ public IReadOnlyCollection<(DateTime timestamp, string? metadata)> Occurrences => OccurrencesQueue;
}
private class StructuralEqualityComparer<T> : IEqualityComparer<T> where T : IStructuralEquatable
#if TARGET_AMD64 || TARGET_ARM64
// The exact matrix on when ZeroMemory is faster than InitBlockUnaligned is very complex. The factors to consider include
- // type of hardware and memory aligment. This threshold was chosen as a good balance accross different configurations.
+ // type of hardware and memory alignment. This threshold was chosen as a good balance across different configurations.
if (byteLength > 768)
goto PInvoke;
Unsafe.InitBlockUnaligned(ref b, 0, (uint)byteLength);
{
Debug.Assert(props != null);
- // In rare occurences during AppDomainUnload() processing, it is possible for this method to be called
+ // In rare occurrences during AppDomainUnload() processing, it is possible for this method to be called
// simultaneously on the same task from two different contexts. This can result in m_exceptionalChildren
// being nulled out while it is being processed, which could lead to a NullReferenceException. To
// protect ourselves, we'll cache m_exceptionalChildren in a local variable.
// * FloatingDateRule -
// To select the correct day in the month, set the Year member to zero, the Hour and Minute
// members to the transition time, the DayOfWeek member to the appropriate weekday, and the
- // Day member to indicate the occurence of the day of the week within the month (first through fifth).
+ // Day member to indicate the occurrence of the day of the week within the month (first through fifth).
//
// Using this notation, specify the 2:00a.m. on the first Sunday in April as follows:
// Hour = 2,
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
);
- // (NetFX20AsssemblyImage was built with v3.5 C# compiler - has v2.0.50727 ImageRuntimeVersion)
+ // (NetFX20AssemblyImage was built with v3.5 C# compiler - has v2.0.50727 ImageRuntimeVersion)
// // Metadata version: v2.0.50727
// .assembly extern mscorlib
// {
//.assembly SimpleAssembly
// {
// .custom instance void [mscorlib]
- // System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 )
+ // System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 )
// .custom instance void [mscorlib]
// System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx
// 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows.
// // --- The following custom attribute is added automatically, do not uncomment -------
- // // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 07 01 00 00 00 00 )
+ // // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 07 01 00 00 00 00 )
// .hash algorithm 0x00008004
// .ver 0:0:0:0
//}
public partial class SetComObjectDataTests
{
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))]
- public void SetComObjectData_NonNullValue_Sucesss()
+ public void SetComObjectData_NonNullValue_Success()
{
var comObject = new ComImportObject();
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))]
- public void SetComObjectData_NullValue_Sucesss()
+ public void SetComObjectData_NullValue_Success()
{
var comObject = new ComImportObject();
}
}
const double tolerance = 0.07;
- foreach ((_, int occurences) in observedNumbers)
+ foreach ((_, int occurrences) in observedNumbers)
{
- double percentage = occurences / (double)numbers.Length;
+ double percentage = occurrences / (double)numbers.Length;
double actual = Math.Abs(expected - percentage);
Assert.True(actual < tolerance, $"Occurred number of times within threshold. Actual: {actual}");
}
}
[Fact]
- public void Remove_MultipleOccurences()
+ public void Remove_MultipleOccurrences()
{
EncryptionPropertyCollection encPropertyCollection = new EncryptionPropertyCollection();
for (int i = 0; i < 2; i++)
encPropertyCollection.Add(multiple);
}
encPropertyCollection.Remove(multiple);
- // Only the first occurence will be removed.
+ // Only the first occurrence will be removed.
Assert.Equal(3, encPropertyCollection.Count);
}
// if (count >= 0)
PopStack();
Stloc(_runtextposLocal!);
- PushTrack(count); // Tracked(0) is alredy on the track
+ PushTrack(count); // Tracked(0) is already on the track
TrackUnique2(Branchcountback2);
Advance();
/**
* \file
* Custom attributes.
- *
+ *
* Author:
* Paolo Molaro (lupus@ximian.com)
*
/*
- * LOCKING: Acquires the loader lock.
+ * LOCKING: Acquires the loader lock.
*/
static MonoCustomAttrInfo*
lookup_custom_attr (MonoImage *image, gpointer member)
goto handle_enum;
} else {
MonoClass *k = t->data.klass;
-
+
if (mono_is_corlib_image (m_class_get_image (k)) && strcmp (m_class_get_name_space (k), "System") == 0 && strcmp (m_class_get_name (k), "DateTime") == 0){
guint64 *val = (guint64 *)g_malloc (sizeof (guint64));
if (!bcheck_blob (p, 7, boundp, error))
}
g_error ("generic valutype %s not handled in custom attr value decoding", m_class_get_name (t->data.klass));
break;
-
+
case MONO_TYPE_STRING:
if (!bcheck_blob (p, 0, boundp, error))
return NULL;
mono_property_set_value_handle (prop, attr, pparams, error);
goto_if_nok (error, fail);
}
-
+
g_free (name);
name = NULL;
}
return;
mono_class_init_internal (method->klass);
-
+
domain = mono_domain_get ();
if (len < 2 || read16 (p) != 0x0001) /* Prolog */
*/
if (method->is_inflated)
method = ((MonoMethodInflated *) method)->declaring;
-
+
if (method_is_dynamic (method) || image_is_dynamic (m_class_get_image (method->klass)))
return lookup_custom_attr (m_class_get_image (method->klass), method);
mono_custom_attrs_from_assembly_checked (MonoAssembly *assembly, gboolean ignore_missing, MonoError *error)
{
guint32 idx;
-
+
error_init (error);
if (image_is_dynamic (assembly->image))
guint32 idx;
error_init (error);
-
+
if (image_is_dynamic (image))
return lookup_custom_attr (image, image);
idx = 1; /* there is only one module */
guint32 idx;
error_init (error);
-
+
if (image_is_dynamic (m_class_get_image (klass))) {
property = mono_metadata_get_corresponding_property_from_generic_type_definition (property);
return lookup_custom_attr (m_class_get_image (klass), property);
guint32 idx;
error_init (error);
-
+
if (image_is_dynamic (m_class_get_image (klass))) {
event = mono_metadata_get_corresponding_event_from_generic_type_definition (event);
return lookup_custom_attr (m_class_get_image (klass), event);
HANDLE_FUNCTION_ENTER ();
MonoClass *klass;
MonoCustomAttrInfo *cinfo = NULL;
-
+
error_init (error);
klass = mono_handle_class (obj);
cinfo = mono_custom_attrs_from_param_checked (method, position + 1, error);
goto_if_nok (error, leave);
- }
+ }
#ifndef DISABLE_REFLECTION_EMIT
else if (mono_is_sre_method_on_tb_inst (member_class)) {/*XXX This is a workaround for Compiler Context*/
// FIXME: Is this still needed ?
} else if (mono_is_sre_ctor_on_tb_inst (member_class)) { /*XX This is a workaround for Compiler Context*/
// FIXME: Is this still needed ?
g_assert_not_reached ();
- }
+ }
#endif
else {
char *type_name = mono_type_get_full_name (member_class);
* mono_reflection_get_custom_attrs_by_type:
* \param obj a reflection object handle
* \returns an array with all the custom attributes defined of the
- * reflection handle \p obj. If \p attr_klass is non-NULL, only custom attributes
+ * reflection handle \p obj. If \p attr_klass is non-NULL, only custom attributes
* of that type are returned. The objects are fully build. Return NULL if a loading error
* occurs.
*/
* custom_attr_class_name_from_method_token:
* @image: The MonoImage
* @method_token: a token for a custom attr constructor in @image
- * @assembly_token: out argment set to the assembly ref token of the custom attr
+ * @assembly_token: out argument set to the assembly ref token of the custom attr
* @nspace: out argument set to namespace (a string in the string heap of @image) of the custom attr
* @class_name: out argument set to the class name of the custom attr.
*
}
/**
- * iterate over the custom attributes that belong to the given index and call func, passing the
+ * iterate over the custom attributes that belong to the given index and call func, passing the
* assembly ref (if any) and the namespace and name of the custom attribute.
*
* Everything is done using low-level metadata APIs, so it is safe to use
uint32_t *res,
int res_size);
-MONO_API uint32_t mono_metadata_decode_row_col (const MonoTableInfo *t,
- int idx,
+MONO_API uint32_t mono_metadata_decode_row_col (const MonoTableInfo *t,
+ int idx,
unsigned int col);
/*
*/
MONO_API const char *mono_metadata_locate (MonoImage *meta, int table, int idx);
MONO_API const char *mono_metadata_locate_token (MonoImage *meta, uint32_t token);
-
+
MONO_API const char *mono_metadata_string_heap (MonoImage *meta, uint32_t table_index);
MONO_API const char *mono_metadata_blob_heap (MonoImage *meta, uint32_t table_index);
MONO_API const char *mono_metadata_user_string (MonoImage *meta, uint32_t table_index);
MONO_API uint32_t mono_metadata_implmap_from_method (MonoImage *meta, uint32_t method_idx);
-MONO_API void mono_metadata_field_info (MonoImage *meta,
+MONO_API void mono_metadata_field_info (MonoImage *meta,
uint32_t table_index,
uint32_t *offset,
uint32_t *rva,
MonoType *mono_type_create_from_typespec (MonoImage *image,
uint32_t type_spec);
MONO_API void mono_metadata_free_type (MonoType *type);
-MONO_API int mono_type_size (MonoType *type,
+MONO_API int mono_type_size (MonoType *type,
int *alignment);
-MONO_API int mono_type_stack_size (MonoType *type,
+MONO_API int mono_type_stack_size (MonoType *type,
int *alignment);
MONO_API mono_bool mono_type_generic_inst_is_valuetype (MonoType *type);
MONO_API MonoMethodSignature *mono_metadata_signature_dup (MonoMethodSignature *sig);
MONO_API MONO_RT_EXTERNAL_ONLY
-MonoMethodSignature *mono_metadata_parse_signature (MonoImage *image,
+MonoMethodSignature *mono_metadata_parse_signature (MonoImage *image,
uint32_t token);
MONO_API MONO_RT_EXTERNAL_ONLY
const char **rptr);
MONO_API void mono_metadata_free_method_signature (MonoMethodSignature *method);
-MONO_API mono_bool mono_metadata_signature_equal (MonoMethodSignature *sig1,
+MONO_API mono_bool mono_metadata_signature_equal (MonoMethodSignature *sig1,
MonoMethodSignature *sig2);
MONO_API unsigned int mono_signature_hash (MonoMethodSignature *sig);
MonoMethodHeader *mono_metadata_parse_mh (MonoImage *m, const char *ptr);
MONO_API void mono_metadata_free_mh (MonoMethodHeader *mh);
-/* MonoMethodHeader acccessors */
+/* MonoMethodHeader accessors */
MONO_API const unsigned char*
mono_method_header_get_code (MonoMethodHeader *header, uint32_t* code_size, uint32_t* max_stack);
MONO_API int
mono_method_header_get_clauses (MonoMethodHeader *header, MonoMethod *method, void **iter, MonoExceptionClause *clause);
-MONO_API uint32_t
-mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec,
+MONO_API uint32_t
+mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec,
mono_bool as_field, mono_bool unicode, MonoMarshalConv *conv);
/*
int res_size);
MONO_API uint32_t mono_metadata_decode_table_row_col (MonoImage *image, int table,
- int idx,
+ int idx,
unsigned int col);
MONO_END_DECLS
$(RUNTIME) $(CLASS)/mkbundle.exe
if FULL_AOT_TESTS
-PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY,FULL_AOT_DESKTOP
+PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY,FULL_AOT_DESKTOP
endif
if HYBRID_AOT_TESTS
-PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY
+PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY
endif
if FULL_AOT_INTERP_TESTS
bug-10127.cs \
bug-18026.cs \
allow-synchronous-major.cs \
- block_guard_restore_aligment_on_exit.cs \
+ block_guard_restore_alignment_on_exit.cs \
thread_static_gc_layout.cs \
sleep.cs \
bug-27147.cs \
assembly-loadfrom-simplename.exe
endif
-# constraints-load.il:
-# Failed to load method 0x6000007 from '..../mono/tests/constraints-load.exe' due to
+# constraints-load.il:
+# Failed to load method 0x6000007 from '..../mono/tests/constraints-load.exe' due to
# Could not resolve type with token 01000002 assembly:mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 type:System.BrokenIComparable`1 member:<none>.
PROFILE_DISABLED_TESTS += \
constraints-load.exe \
if HOST_WIN32
# https://github.com/mono/mono/issues/12839
-CI_PR_DISABLED_TESTS += block_guard_restore_aligment_on_exit.exe
+CI_PR_DISABLED_TESTS += block_guard_restore_alignment_on_exit.exe
endif
# appdomain-threadpool-unload.exe creates 100 appdomains, takes too long with llvm
TestingReferenceReferenceAssembly.dll: TestingReferenceReferenceAssembly.cs TestingReferenceAssembly.dll
$(MCS) -r:TestingReferenceAssembly.dll -target:library -out:$@ $<
-%.exe$(PLATFORM_AOT_SUFFIX): %.exe
+%.exe$(PLATFORM_AOT_SUFFIX): %.exe
$(RUNTIME) $(TEST_AOT_BUILD_FLAGS) $<
-%.dll$(PLATFORM_AOT_SUFFIX): %.dll
+%.dll$(PLATFORM_AOT_SUFFIX): %.dll
$(RUNTIME) $(TEST_AOT_BUILD_FLAGS) $<
# mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
MONO_PATH="assemblyresolve_deps:$(CLASS)" $(top_builddir)/runtime/mono-wrapper $(TEST_AOT_BUILD_FLAGS) assemblyresolve_asm.dll
assemblyresolve_deps/Test.dll$(PLATFORM_AOT_SUFFIX): assemblyresolve_deps/Test.dll assemblyresolve_deps/TestBase.dll$(PLATFORM_AOT_SUFFIX)
-EXTRA_DIST += assemblyresolve_TestBase.cs assemblyresolve_Test.cs assemblyresolve_asm.cs
+EXTRA_DIST += assemblyresolve_TestBase.cs assemblyresolve_Test.cs assemblyresolve_asm.cs
assemblyresolve_deps:
mkdir -p assemblyresolve_deps
assemblyresolve_deps/TestBase.dll: assemblyresolve_deps $(srcdir)/assemblyresolve_TestBase.cs
assemblyresolve_event4.exe: assemblyresolve_deps/Test.dll assemblyresolve_deps/TestBase.dll
EXTRA_DIST += assemblyresolve_event5_label.cs assemblyresolve_event5_helper.cs
-assemblyresolve_deps/assemblyresolve_event5_label.dll: assemblyresolve_event5_label.cs assemblyresolve_deps
+assemblyresolve_deps/assemblyresolve_event5_label.dll: assemblyresolve_event5_label.cs assemblyresolve_deps
$(MCS) -target:library -out:assemblyresolve_deps/assemblyresolve_event5_label.dll $(srcdir)/assemblyresolve_event5_label.cs
assemblyresolve_event5_helper.dll: assemblyresolve_event5_helper.cs assemblyresolve_deps/assemblyresolve_event5_label.dll
$(MCS) -target:library -out:assemblyresolve_event5_helper.dll -r:assemblyresolve_deps/assemblyresolve_event5_label.dll $(srcdir)/assemblyresolve_event5_helper.cs
bug-81691.exe$(PLATFORM_AOT_SUFFIX): bug-81691-b.dll$(PLATFORM_AOT_SUFFIX)
bug-81691.exe bug-81691-a.dll bug-81691-b.dll: $(srcdir)/bug-81691.cs $(srcdir)/bug-81691-a.cs $(srcdir)/bug-81691-b.cs
- $(MCS) -target:library -out:bug-81691-a.dll $(srcdir)/bug-81691-a.cs
+ $(MCS) -target:library -out:bug-81691-a.dll $(srcdir)/bug-81691-a.cs
$(MCS) -r:bug-81691-a.dll -target:library -out:bug-81691-b.dll $(srcdir)/bug-81691-b.cs
$(MCS) -r:bug-81691-b.dll -out:bug-81691.exe $(srcdir)/bug-81691.cs
rm -f bug-81691-a.dll
if [ x$(AOT) = x1 ]; then $(with_mono_path) $(JITTEST_PROG_RUN) --aot --debug $$fn > /dev/null || exit 1; $(RUNTIME) $$fn > $$fn.stdout || exit 1; fi; \
done
-test-generic-sharing-managed: test-runner.exe $(TESTS_GSHARED) $(TESTSAOT_GSHARED)
+test-generic-sharing-managed: test-runner.exe $(TESTS_GSHARED) $(TESTSAOT_GSHARED)
$(Q) $(TOOLS_RUNTIME) $(TEST_RUNNER) -j a --testsuite-name "gshared" --disabled "$(DISABLED_TESTS)" --opt-sets "gshared gshared,shared gshared,-inline gshared,-inline,shared" $(TESTS_GSHARED)
test-generic-sharing:
EXTRA_DIST += modules.cs modules-m1.cs
modules-m1.netmodule: modules-m1.cs
$(MCS) -out:$@ /target:module $(srcdir)/modules-m1.cs
-modules.exe: modules.cs modules-m1.netmodule $(TEST_DRIVER_DEPEND)
+modules.exe: modules.cs modules-m1.netmodule $(TEST_DRIVER_DEPEND)
$(MCS) -out:$@ /addmodule:modules-m1.netmodule -r:TestDriver.dll $(srcdir)/modules.cs
# Useful if mono is compiled with --enable-shared=no
$(TOOLS_RUNTIME) $(TEST_RUNNER) --testsuite-name $@ $(INTERNALSVISIBLETO_TEST)
internalsvisibleto-correctcase.dll internalsvisibleto-wrongcase.dll internalsvisibleto-runtimetest.exe: internalsvisibleto-runtimetest.cs internalsvisibleto-library.cs
- $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase.dll -target:library -d:CORRECT_CASE -d:PERMISSIVE internalsvisibleto-library.cs
+ $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase.dll -target:library -d:CORRECT_CASE -d:PERMISSIVE internalsvisibleto-library.cs
$(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase.dll -target:library -d:WRONG_CASE -d:PERMISSIVE internalsvisibleto-library.cs
$(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-runtimetest.exe -warn:0 -r:internalsvisibleto-correctcase.dll -r:internalsvisibleto-wrongcase.dll internalsvisibleto-runtimetest.cs
- $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase.dll -target:library -d:CORRECT_CASE internalsvisibleto-library.cs
+ $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase.dll -target:library -d:CORRECT_CASE internalsvisibleto-library.cs
$(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase.dll -target:library -d:WRONG_CASE internalsvisibleto-library.cs
internalsvisibleto-correctcase-2.dll internalsvisibleto-wrongcase-2.dll internalsvisibleto-compilertest.exe: internalsvisibleto-compilertest.cs internalsvisibleto-library.cs
- $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase-2.dll -target:library -d:CORRECT_CASE internalsvisibleto-library.cs
+ $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase-2.dll -target:library -d:CORRECT_CASE internalsvisibleto-library.cs
$(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase-2.dll -target:library -d:WRONG_CASE internalsvisibleto-library.cs
$(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-compilertest.exe -warn:0 -r:internalsvisibleto-correctcase-2.dll -r:internalsvisibleto-wrongcase-2.dll internalsvisibleto-compilertest.cs
$(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase-sign2048.dll -target:library -d:WRONG_CASE -d:SIGN2048 internalsvisibleto-library.cs
internalsvisibleto-correctcase-2-sign2048.dll internalsvisibleto-wrongcase-2-sign2048.dll internalsvisibleto-compilertest-sign2048.exe: internalsvisibleto-compilertest.cs internalsvisibleto-library.cs internalsvisibleto-2048.snk
- $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase-2-sign2048.dll -target:library -d:CORRECT_CASE -d:SIGN2048 internalsvisibleto-library.cs
+ $(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-correctcase-2-sign2048.dll -target:library -d:CORRECT_CASE -d:SIGN2048 internalsvisibleto-library.cs
$(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-wrongcase-2-sign2048.dll -target:library -d:WRONG_CASE -d:SIGN2048 internalsvisibleto-library.cs
$(Q) $(MCS_NO_UNSAFE) -out:internalsvisibleto-compilertest-sign2048.exe -warn:0 -r:internalsvisibleto-correctcase-2-sign2048.dll -r:internalsvisibleto-wrongcase-2-sign2048.dll -d:SIGN2048 internalsvisibleto-compilertest.cs
weak-fields.exe: weak-fields.cs Mono.Runtime.Testing.dll
$(MCS) -r:Mono.Runtime.Testing.dll -r:$(CLASS)/System.dll -r:$(CLASS)/System.Xml.dll -r:$(CLASS)/System.Core.dll -r:TestDriver.dll $(TEST_DRIVER_HARD_KILL_FEATURE) -out:$@ $<
-CLEANFILES = $(TESTS_REGULAR) $(TESTS_STRESS) $(TESTSAOT_CS) $(TESTSAOT_IL) $(TESTSAOT_BENCH) $(TESTSAOT_STRESS) *.dll *.stdout *.aotlog *.exe stest.dat LeafAssembly.dll MidAssembly.dll appdomain-marshalbyref-assemblyload2/*.dll
+CLEANFILES = $(TESTS_REGULAR) $(TESTS_STRESS) $(TESTSAOT_CS) $(TESTSAOT_IL) $(TESTSAOT_BENCH) $(TESTSAOT_STRESS) *.dll *.stdout *.aotlog *.exe stest.dat LeafAssembly.dll MidAssembly.dll appdomain-marshalbyref-assemblyload2/*.dll
CLEANFILES += $(TESTS_TAILCALL_COMPILE) $(TESTSAOT_TAILCALL)
CLEANFILES += $(BUILT_SOURCES)
} finally {
res = 4;
Console.WriteLine ("EEE");
- while (!foo);
+ while (!foo);
res = 5;
Console.WriteLine ("in the finally block");
Thread.ResetAbort ();
res = 0;
}
}
-
+
static int Main () {
Thread t = new Thread (Func);
t.Start ();
Thread.Sleep (500);
return res;
}
-}
\ No newline at end of file
+}
{
w.WriteLine();
w.WriteLine(" [MethodImpl(MethodImplOptions.NoInlining)]");
- // Pass parameters by reference so we get consistency accross various ABIs.
+ // Pass parameters by reference so we get consistency across various ABIs.
// We get operands in memory and by adding an extra "nop" intrinsic we can
// force one of the operands in a register, just enough to catch some cases
// of containment.
These two non-atomic operations expose a race if the object is not a local variable, and
can be mutated by another thread.
- This is the tree generated for unboxing an int. Note the two occurences of "field ref m_obj".
+ This is the tree generated for unboxing an int. Note the two occurrences of "field ref m_obj".
[[
.method public static int32 Main()
{.entrypoint
.maxstack 3
-
+
call int32 FullProof::Test()
pop
-ldstr "Test SUCCCESS"
+ldstr "Test SUCCESS"
call void [System.Console]System.Console::WriteLine(string)
ldc.i4 100
ret
lock (eventsLock)
{
if (!bindOperations.ContainsKey(data.ActivityId))
- Assert.Fail(GetMisssingAssemblyBindStartMessage(data, $"Success={success}, Name={resultName}"));
+ Assert.Fail(GetMissingAssemblyBindStartMessage(data, $"Success={success}, Name={resultName}"));
BindOperation bind = bindOperations[data.ActivityId];
bind.Success = success;
lock (eventsLock)
{
if (!bindOperations.ContainsKey(data.ActivityId))
- Assert.Fail(GetMisssingAssemblyBindStartMessage(data, attempt.ToString()));
+ Assert.Fail(GetMissingAssemblyBindStartMessage(data, attempt.ToString()));
BindOperation bind = bindOperations[data.ActivityId];
bind.ResolutionAttempts.Add(attempt);
lock (eventsLock)
{
if (!bindOperations.ContainsKey(data.ActivityId))
- Assert.Fail(GetMisssingAssemblyBindStartMessage(data, handlerInvocation.ToString()));
+ Assert.Fail(GetMissingAssemblyBindStartMessage(data, handlerInvocation.ToString()));
BindOperation bind = bindOperations[data.ActivityId];
bind.AssemblyLoadContextResolvingHandlers.Add(handlerInvocation);
lock (eventsLock)
{
if (!bindOperations.ContainsKey(data.ActivityId))
- Assert.Fail(GetMisssingAssemblyBindStartMessage(data, handlerInvocation.ToString()));
+ Assert.Fail(GetMissingAssemblyBindStartMessage(data, handlerInvocation.ToString()));
BindOperation bind = bindOperations[data.ActivityId];
bind.AppDomainAssemblyResolveHandlers.Add(handlerInvocation);
lock (eventsLock)
{
if (!bindOperations.ContainsKey(data.ActivityId))
- Assert.Fail(GetMisssingAssemblyBindStartMessage(data, loadFrom.ToString()));
+ Assert.Fail(GetMissingAssemblyBindStartMessage(data, loadFrom.ToString()));
BindOperation bind = bindOperations[data.ActivityId];
bind.AssemblyLoadFromHandler = loadFrom;
lock (eventsLock)
{
if (!bindOperations.ContainsKey(data.ActivityId))
- Assert.Fail(GetMisssingAssemblyBindStartMessage(data, probedPath.ToString()));
+ Assert.Fail(GetMissingAssemblyBindStartMessage(data, probedPath.ToString()));
BindOperation bind = bindOperations[data.ActivityId];
bind.ProbedPaths.Add(probedPath);
return this.loadsToTrack.Any(n => n.Equals(name, StringComparison.InvariantCultureIgnoreCase));
}
- private string GetMisssingAssemblyBindStartMessage(EventWrittenEventArgs data, string parsedEventAsString)
+ private string GetMissingAssemblyBindStartMessage(EventWrittenEventArgs data, string parsedEventAsString)
{
var msg = new System.Text.StringBuilder();
msg.AppendLine($"{data.EventName} (ActivityId: {data.ActivityId}) should have a matching AssemblyBindStart");
fSuccess &= process.Start();
if (!fSuccess)
throw new Exception("Failed to start subprocess");
- StreamWriter subprocesssStdIn = process.StandardInput;
+ StreamWriter subprocessStdIn = process.StandardInput;
process.BeginOutputReadLine();
process.BeginErrorReadLine();
Logger.logger.Log($"subprocess started: {fSuccess}");
Logger.logger.Log($"subprocess PID: {process.Id}");
bool fGotToEnd = false;
- process.Exited += (s, e) =>
+ process.Exited += (s, e) =>
{
Logger.logger.Log("================= Subprocess Exited =================");
if (!fGotToEnd)
await duringExecution(process.Id);
fGotToEnd = true;
Logger.logger.Log($"Sending 'exit' to subprocess stdin");
- subprocesssStdIn.WriteLine("exit");
- subprocesssStdIn.Close();
+ subprocessStdIn.WriteLine("exit");
+ subprocessStdIn.Close();
while (!process.WaitForExit(5000))
{
Logger.logger.Log("Subprocess didn't exit in 5 seconds!");
public IpcHeader Header { get; private set; } = default;
public byte[] Serialize()
- {
+ {
byte[] serializedData = null;
// Verify things will fit in the size capacity
Header.Size = checked((UInt16)(IpcHeader.HeaderSizeInBytes + (Payload?.Length ?? 0))); ;
private static string IpcRootPath { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"\\.\pipe\" : Path.GetTempPath();
public static Stream GetStandardTransport(int processId)
{
- try
+ try
{
var process = Process.GetProcessById(processId);
}
{
throw new Exception($"Process {processId} seems to be elevated.");
}
-
+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
string pipeName = $"dotnet-diagnostic-{processId}";