mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[CRT]
Implement __alloca_probe_16 svn path=/branches/cmake-bringup/; revision=49660
This commit is contained in:
parent
66a7b7ba1d
commit
d65aa994f7
1 changed files with 29 additions and 0 deletions
|
@ -14,8 +14,37 @@
|
|||
|
||||
PUBLIC __chkstk
|
||||
PUBLIC __alloca_probe
|
||||
PUBLIC __alloca_probe_16
|
||||
.code
|
||||
|
||||
/* 16 byte aligned alloca probe
|
||||
* EAX = size to be allocated */
|
||||
__alloca_probe_16:
|
||||
/* save the ECX register */
|
||||
push ecx
|
||||
|
||||
/* ecx = top of the previous stack frame */
|
||||
lea ecx, [esp + 8]
|
||||
|
||||
/* Calculate end of allocation */
|
||||
sub ecx, eax
|
||||
|
||||
/* Get the misalignment */
|
||||
and ecx, 15
|
||||
|
||||
/* Add the misalignment to the original alloc size */
|
||||
add eax, ecx
|
||||
|
||||
/* Check for overflow */
|
||||
jnc l1
|
||||
|
||||
/* Set maximum value */
|
||||
mov eax, HEX(0ffffffff)
|
||||
l1:
|
||||
/* Restore ecx */
|
||||
pop ecx
|
||||
/* Fall through to __chkstk */
|
||||
|
||||
/*
|
||||
_chkstk() is called by all stack allocations of more than 4 KB. It grows the
|
||||
stack in areas of 4 KB each, trying to access each area. This ensures that the
|
||||
|
|
Loading…
Reference in a new issue