Changeset 284

Show
Ignore:
Timestamp:
04/14/10 15:17:12 (2 years ago)
Author:
sean
Message:

A post of Steve's in the NG reminded me that delegates for opApply need to be "scope" or they'll allocte a dynamic stack frame. Now they are.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/import/object.di

    r278 r284  
    245245    @property void function() unitTest(); 
    246246 
    247     static int opApply(int delegate(ref ModuleInfo*)); 
     247    static int opApply(scope int delegate(ref ModuleInfo*)); 
    248248} 
    249249 
     
    258258    interface TraceInfo 
    259259    { 
    260         int opApply(int delegate(ref char[])); 
     260        int opApply(scope int delegate(ref char[])); 
    261261        string toString(); 
    262262    } 
     
    300300    void*  _aaRehash(void** pp, TypeInfo keyti); 
    301301 
    302     extern (D) typedef int delegate(void *) _dg_t; 
     302    extern (D) typedef scope int delegate(void *) _dg_t; 
    303303    int _aaApply(void* aa, size_t keysize, _dg_t dg); 
    304304 
    305     extern (D) typedef int delegate(void *, void *) _dg2_t; 
     305    extern (D) typedef scope int delegate(void *, void *) _dg2_t; 
    306306    int _aaApply2(void* aa, size_t keysize, _dg2_t dg); 
    307307 
     
    333333    } 
    334334 
    335     int opApply(int delegate(ref Key, ref Value) dg) 
     335    int opApply(scope int delegate(ref Key, ref Value) dg) 
    336336    { 
    337337        return _aaApply2(p, Key.sizeof, cast(_dg2_t)dg); 
    338338    } 
    339339 
    340     int opApply(int delegate(ref Value) dg) 
     340    int opApply(scope int delegate(ref Value) dg) 
    341341    { 
    342342        return _aaApply(p, Key.sizeof, cast(_dg_t)dg); 
  • trunk/src/core/runtime.d

    r283 r284  
    261261            } 
    262262             
    263             int opApply( int delegate(ref char[]) dg ) 
     263            int opApply( scope int delegate(ref char[]) dg ) 
    264264            { 
    265265                // NOTE: The first 5 frames with the current implementation are 
  • trunk/src/core/thread.d

    r263 r284  
    11581158     *  Zero if all elemented are visited, nonzero if not. 
    11591159     */ 
    1160     static int opApply( int delegate( ref Thread ) dg ) 
     1160    static int opApply( scope int delegate( ref Thread ) dg ) 
    11611161    { 
    11621162        synchronized( slock ) 
     
    24222422     * Operates on all threads currently tracked by this object. 
    24232423     */ 
    2424     final int opApply( int delegate( ref Thread ) dg ) 
     2424    final int opApply( scope int delegate( ref Thread ) dg ) 
    24252425    { 
    24262426        synchronized( this ) 
  • trunk/src/object_.d

    r270 r284  
    11221122    interface TraceInfo 
    11231123    { 
    1124         int opApply(int delegate(ref char[])); 
     1124        int opApply(scope int delegate(ref char[])); 
    11251125    } 
    11261126 
     
    15651565 
    15661566 
    1567     static int opApply(int delegate(ref ModuleInfo*) dg) 
     1567    static int opApply(scope int delegate(ref ModuleInfo*) dg) 
    15681568    { 
    15691569        int ret = 0; 
     
    20792079    void* _aaRehash(void** pp, TypeInfo keyti); 
    20802080 
    2081     extern (D) typedef int delegate(void *) _dg_t; 
     2081    extern (D) typedef scope int delegate(void *) _dg_t; 
    20822082    int _aaApply(void* aa, size_t keysize, _dg_t dg); 
    20832083 
    2084     extern (D) typedef int delegate(void *, void *) _dg2_t; 
     2084    extern (D) typedef scope int delegate(void *, void *) _dg2_t; 
    20852085    int _aaApply2(void* aa, size_t keysize, _dg2_t dg); 
    20862086 
     
    21122112    } 
    21132113 
    2114     int opApply(int delegate(ref Key, ref Value) dg) 
     2114    int opApply(scope int delegate(ref Key, ref Value) dg) 
    21152115    { 
    21162116        return _aaApply2(p, Key.sizeof, cast(_dg2_t)dg); 
    21172117    } 
    21182118 
    2119     int opApply(int delegate(ref Value) dg) 
     2119    int opApply(scope int delegate(ref Value) dg) 
    21202120    { 
    21212121        return _aaApply(p, Key.sizeof, cast(_dg_t)dg);