Changeset 107

Show
Ignore:
Timestamp:
07/10/05 18:24:36 (3 years ago)
Author:
pragma
Message:

Misc changes since beginning of hiatus.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dsp/ServletCompiler.d

    r102 r107  
    8585                " " ~ requestConfig.options ~ 
    8686                " -op" ~ 
     87                " -LNOM" ~ 
    8788                " -od" ~ requestConfig.tempDirectory ~  
    8889                " -of" ~ requestConfig.destServletFilename ~ 
  • trunk/dsp/ServletGenerator.d

    r104 r107  
    4141    T opCall(Box value) 
    4242    { 
    43         assert (value.type !== null); 
     43        assert (value.type !is null); 
    4444         
    4545        if (typeid(T) is value.type) 
  • trunk/dsp/servlet/DSPLibraryCache.d

    r98 r107  
    2828private import dsp.servlet.DSPLibrary; 
    2929 
     30/* 
     31/+ 
     32    Behavior: 
     33     
     34    As each library is used, it is promoted up one position in the cache.  
     35    The overall action is not unlike a bubble-sort, where multiple sorting 
     36    actions eventually sort the cache out. 
     37+/ 
     38class DSPLibraryCache{ 
     39    struct CacheEntry{ 
     40        DSPLibrary lib; 
     41        char[] key; 
     42    } 
     43 
     44    CacheEntry[] positions; 
     45    DSPLibrary[char[]] cache; 
     46    uint freeCount; 
     47 
     48    this(uint capacity){ 
     49        freeCount = capacity; 
     50        positions.length = capacity; 
     51    } 
     52     
     53    protected void addLibrary(DSPLibrary lib,char[] key){ 
     54        debug printf("addLibrary\n"); 
     55         
     56        if(freeCount==0){ 
     57            // search for the lowest ranking library that is not in use 
     58            for(uint i=positions.length-1; i>=0; i--){ 
     59                if(!positions[i].lib.inUse){ 
     60                 
     61                    // close out the library 
     62                    positions[i].lib.unload(); 
     63                 
     64                    // remove the entry from the cache 
     65                    cache.remove(positions[i].key); 
     66                                         
     67                    // replace the idle library with this one instead 
     68                    positions[i].lib = lib; 
     69                    positions[i].key = key; 
     70                    cache[key] = lib; 
     71                     
     72                    return; 
     73                } 
     74            } 
     75             
     76            // balloon the cache since all libs are being used           
     77            freeCount++; 
     78             
     79            //(fallthrough) 
     80        } 
     81         
     82        positions[$-freeCount] = lib; 
     83        cache[key] = lib; 
     84        freeCount--; 
     85    } 
     86     
     87    protected void removeLibrary(DSPLibrary lib){ 
     88        debug printf("removeLibrary\n"); 
     89        assert(!lib.inUse); 
     90         
     91        for(uint i=0; i<positions.length; i++){ 
     92            if(positions[i].lib == lib){ 
     93                char[] key = positions[i].key; 
     94                if(i < positions.length-1){ 
     95                    positions[i..$-1] = [i+1..$]; // move entire array up to fill the gap 
     96                } 
     97                positions[$-1] = null; 
     98                freeCount++; 
     99                cache.remove(key); 
     100                return; 
     101            } 
     102        } 
     103        assert(false); 
     104    } 
     105 
     106    protected void getLibrary(char[] key){ 
     107        debug printf("getLibrary\n"); 
     108        if(key in cache){ 
     109            for(uint i=0; i<positions.length; i++){ 
     110                 
     111            } 
     112            return cache[key]; 
     113        } 
     114        return null; 
     115    } 
     116     
     117     
     118    void put(char[] path,DSPLibrary lib){ 
     119        // place entry in the queue 
     120        if(lib){ 
     121            synchronized(this){ 
     122                assert(!(path in cache)); 
     123                addLibrary(lib,path.dup); 
     124            } 
     125        } 
     126         
     127        // remove the entry from the queue 
     128        else{ 
     129            //remove this entry from the list 
     130            synchronized(this){ 
     131                removeLibrary(lib); 
     132            } 
     133        } 
     134    } 
     135     
     136    DSPLibrary get(char[] path){ 
     137        DSPLibrary result; 
     138        synchronized(this) result = getLibrary(lib); 
     139        return result; 
     140    } 
     141     
     142    char[] toString(){ 
     143        char[] output = ""; 
     144        return output; 
     145    } 
     146}*/ 
     147 
     148 
     149 
    30150private import mango.cache.HashMap; 
     151 
    31152 
    32153class DSPLibraryCache{ 
  • trunk/misc/Exportable.d

    r40 r107  
    5959            } 
    6060            c = c.base; 
    61         }while(c !== null); 
     61        }while(c !is null); 
    6262        return null; 
    6363    } 
  • trunk/misc/TypeLibraryDLLStub.d

    r40 r107  
    6464        obj = typeConstructors[typename](); 
    6565        version(externalGC){} else{ 
    66             if(obj !== null){ 
     66            if(obj !is null){ 
    6767                watchList[(cast(Object)obj).toHash()] = obj; 
    6868            } 
  • trunk/server.d

    r97 r107  
    3838 
    3939        // for threads 
    40 import  mango.base.System; 
     40import  mango.sys.System; 
    4141 
    4242        //for logging 
     
    120120 
    121121int main () 
    122 {    
     122{ 
    123123        BasicConfigurator.configure (); 
    124124        mainLogger = Logger.getLogger ("dsp.servlets"); 
    125125        mainLogger.setLevel (mainLogger.Level.Info); 
    126  
     126         
    127127        try { 
    128128            testServletEngine(); 
  • trunk/xml/xpath/fn.d

    r69 r107  
    3838    static XPathVar abs(XPathContext context,XPathVar[] args){ 
    3939        mixin XPathFunctionAssert!(xtd.numeric); 
    40         smartAssert(arg1 !== null); 
     40        smartAssert(arg1 !is null); 
    4141 
    4242        return arg1.abs.toVar(); 
     
    4646    static XPathVar ceiling(XPathContext context,XPathVar[] args){ 
    4747        mixin XPathFunctionAssert!(xtd.numeric); 
    48         smartAssert(arg1 !== null); 
     48        smartAssert(arg1 !is null); 
    4949 
    5050        return arg1.ceiling.toVar(); 
     
    5454    static XPathVar floor(XPathContext context,XPathVar[] args){ 
    5555        mixin XPathFunctionAssert!(xtd.numeric); 
    56         smartAssert(arg1 !== null); 
     56        smartAssert(arg1 !is null); 
    5757 
    5858        return arg1.floor.toVar(); 
     
    6262    static XPathVar round(XPathContext context,XPathVar[] args){ 
    6363        mixin XPathFunctionAssert!(xtd.numeric); 
    64         smartAssert(arg1 !== null); 
     64        smartAssert(arg1 !is null); 
    6565 
    6666        return arg1.round.toVar(); 
     
    7171    static XPathVar roundHalfToEven(XPathContext context,XPathVar[] args){ 
    7272        mixin XPathFunctionAssert!(xtd.numeric,xs.integer); 
    73         smartAssert(arg1 !== null); 
     73        smartAssert(arg1 !is null); 
    7474 
    7575        return arg1.roundHalfToEven(arg2).toVar(); 
     
    8282    static XPathVar codepointsToString(XPathContext context,XPathVar[] args){ 
    8383        mixin XPathFunctionAssert!(Sequence!(xs.integer)); 
    84         smartAssert(arg1 !== null); 
     84        smartAssert(arg1 !is null); 
    8585 
    8686        xs.string result = new xs.string(); 
     
    9696    static XPathVar stringToCodepoints(XPathContext context,XPathVar[] args){ 
    9797        mixin XPathFunctionAssert!(xs.string); 
    98         smartAssert(arg1 !== null); 
     98        smartAssert(arg1 !is null); 
    9999 
    100100        XPathVar result;