'касательно' ключевого слова и AppDomains

Проблема в том, что целевой процессор должен быть не менее 386.

поэтому функция должна быть такой:

double sin(double x){
    asm{
        fld qword ptr [x]
        fsin
        fstp qword ptr [x]
    }
    return x;
}

Я получил подобный код для компиляции в TASM с .386 после .MODEL "size"

7
задан Community 23 May 2017 в 12:34
поделиться

2 ответа

Adding "ref" might, or might not help. It all depends on the smartness of the particular marshaller implementation. If you call, for example, a web service, no amount of "ref"s is going to help you -- the parameters of the function are simply not sent back over the wire. The only thing that comes back from the service is the function's return value. When dealing with remoting you have to understand (at least to some degree) the way things actually work -- the fact that parameters need to be serialized and sent to the callee over some sort of "wire", deserialized on the other end, work is performed by the server, and the results serialized and sent back to you. Whether these results include changes to the parameters you passed in the first place depends more on the specific remoting implementation, then on the "ref"s that you add to decorate your parameters...

4
ответ дан 7 December 2019 в 12:24
поделиться

I wonder why did you say "reference/pointer"?. There's a big difference between those terms. See, a pointer is just an address, say an int.

On the other hand, a reference is nothing but an alias to something. In terms of C++:

int x;
int& y = x;

From here on, whatever happens to x, happens to y and viceversa, they are bound "forever".

Again, in C++, a pass-by-ref:

void foo(int& y);
int main(){
    int x = 0;
    foo(x);
}

It means that y, is just another name (alias) for x within foo's scope. This is what ref means in C#.

1
ответ дан 7 December 2019 в 12:24
поделиться
Другие вопросы по тегам:

Похожие вопросы: