[ruby-cvs:69374] k0kubun:r62193 (trunk): mjit.c: use InterlockedExchangePointer

k0kubun at ruby-lang.org k0kubun at ruby-lang.org
Sun Feb 4 17:24:59 JST 2018


k0kubun	2018-02-04 17:24:58 +0900 (Sun, 04 Feb 2018)

  New Revision: 62193

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62193

  Log:
    mjit.c: use InterlockedExchangePointer
    
    for Windows, if it's available.
    
    Before this commit, Windows builds printed following warnings.
    mjit.c
    ../mjit.c(802) : warning C4047: 'function' : 'volatile LONG *' differs in levels of indirection from 'void **'
    ../mjit.c(802) : warning C4024: '_InterlockedExchange' : different types for formal and actual parameter 1
    ../mjit.c(802) : warning C4047: 'function' : 'LONG' differs in levels of indirection from 'void *'
    ../mjit.c(802) : warning C4024: '_InterlockedExchange' : different types for formal and actual parameter 2
    
    ATOMIC_SET is using InterlockedExchange which takes LONG as its value.
    As InterlockedExchangePointer takes PVOID, we should use this to set
    function pointer atomically.

  Modified files:
    trunk/mjit.c


More information about the ruby-cvs mailing list