mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-05 03:11:09 +02:00
* InterlockedIncrement/Decrement must return the modified value, not the initial one. Fixes a number of interface memory leaks in MIPS test suite. The functions remain not thread-safe yet.
git-svn-id: trunk@23393 -
This commit is contained in:
parent
b35d04ffa8
commit
4c84febfae
@ -543,18 +543,20 @@ end;
|
||||
function InterLockedDecrement (var Target: longint) : longint; assembler; nostackframe;
|
||||
asm
|
||||
{$warning FIXME: This implementation of InterLockedDecrement in not yet ThreadSafe }
|
||||
// must return value after decrement
|
||||
lw $v0,($a0)
|
||||
addi $v1,$v0,-1
|
||||
sw $v1,($a0)
|
||||
addi $v0,$v0,-1
|
||||
sw $v0,($a0)
|
||||
end;
|
||||
|
||||
|
||||
function InterLockedIncrement (var Target: longint) : longint; assembler; nostackframe;
|
||||
asm
|
||||
{$warning FIXME: This implementation of InterLockedIncrement in not yet ThreadSafe }
|
||||
// must return value after increment
|
||||
lw $v0,($a0)
|
||||
addi $v1,$v0,1
|
||||
sw $v1,($a0)
|
||||
addi $v0,$v0,1
|
||||
sw $v0,($a0)
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user