557 |
|
|
558 |
/* Allocate space for the thread-specific value stack */ |
/* Allocate space for the thread-specific value stack */ |
559 |
if((thread->stackBase = (CVMWord *)ILGCAllocPersistent |
if((thread->stackBase = (CVMWord *)ILGCAllocPersistent |
560 |
|
#ifdef IL_CONFIG_APPDOMAINS |
561 |
|
(sizeof(CVMWord) * process->engine->stackSize)) == 0) |
562 |
|
#else |
563 |
(sizeof(CVMWord) * process->stackSize)) == 0) |
(sizeof(CVMWord) * process->stackSize)) == 0) |
564 |
|
#endif |
565 |
{ |
{ |
566 |
ILGCFreePersistent(thread); |
ILGCFreePersistent(thread); |
567 |
return 0; |
return 0; |
568 |
} |
} |
569 |
|
#ifdef IL_CONFIG_APPDOMAINS |
570 |
|
thread->stackLimit = thread->stackBase + process->engine->stackSize; |
571 |
|
#else |
572 |
thread->stackLimit = thread->stackBase + process->stackSize; |
thread->stackLimit = thread->stackBase + process->stackSize; |
573 |
|
#endif |
574 |
|
|
575 |
/* Allocate space for the initial frame stack */ |
/* Allocate space for the initial frame stack */ |
576 |
if((thread->frameStack = (ILCallFrame *)ILGCAllocPersistent |
if((thread->frameStack = (ILCallFrame *)ILGCAllocPersistent |
577 |
|
#ifdef IL_CONFIG_APPDOMAINS |
578 |
|
(sizeof(ILCallFrame) * process->engine->frameStackSize)) |
579 |
|
#else |
580 |
(sizeof(ILCallFrame) * process->frameStackSize)) |
(sizeof(ILCallFrame) * process->frameStackSize)) |
581 |
|
#endif |
582 |
== 0) |
== 0) |
583 |
{ |
{ |
584 |
ILGCFreePersistent(thread->stackBase); |
ILGCFreePersistent(thread->stackBase); |
587 |
} |
} |
588 |
|
|
589 |
thread->numFrames = 0; |
thread->numFrames = 0; |
590 |
|
#ifdef IL_CONFIG_APPDOMAINS |
591 |
|
thread->maxFrames = process->engine->frameStackSize; |
592 |
|
#else |
593 |
thread->maxFrames = process->frameStackSize; |
thread->maxFrames = process->frameStackSize; |
594 |
|
#endif |
595 |
|
|
596 |
/* Initialize the thread state */ |
/* Initialize the thread state */ |
597 |
thread->supportThread = 0; |
thread->supportThread = 0; |