Changeset 165

Show
Ignore:
Timestamp:
05/03/07 12:05:35 (2 years ago)
Author:
JarrettBillingsley
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/benchmark/fasta.md

    r163 r165  
    1 module fasta; 
     1module benchmark.fasta; 
    22 
    33// laptop: n = 25,000,000, 860 sec 
  • trunk/benchmark/pidigits.md

    r162 r165  
    55function Next(z) 
    66{ 
    7     return (3zz * z[0] + z[1]) / (3 * z[2] + z[3]); 
     7    return (3 * z[0] + z[1]) / (3 * z[2] + z[3]); 
    88} 
    99 
  • trunk/dsss.conf

    r112 r165  
    22 
    33[minid] 
    4 exclude = test.d mdcl.d minidc.d 
    54 
    65[mdcl.d] 
    76target = mdcl 
     7buildflags = -release -O -inline 
    88 
    99[minidc.d] 
  • trunk/minid/oslib.d

    r162 r165  
    3333    import std.c.windows.windows; 
    3434} 
     35else version(Unix) 
     36{ 
     37    import std.c.unix.unix; 
     38    alias timezone struct_timezone; 
     39} 
     40else version(linux) 
     41{ 
     42    import std.c.linux.linux; 
     43} 
    3544else 
    36 
    37     import std.c.linux.linux; 
    38 
     45    static assert(false, "No valid platform defined"); 
    3946 
    4047class OSLib 
     
    7380        else 
    7481        { 
    75             // Let's just assume that most other OSes besides Windows support gettimeofday()... 
    76             std.c.linux.linux.timeval tv; 
     82            timeval tv; 
    7783            struct_timezone tz; 
    78             std.c.linux.linux.gettimeofday(&tv, &tz); 
     84            gettimeofday(&tv, &tz); 
    7985            s.push(cast(ulong)(tv.tv_sec * 1_000_000L) + cast(ulong)tv.tv_usec); 
    8086        } 
  • trunk/minid/types.d

    r164 r165  
    19941994    public MDValue* opIndex(MDString key) 
    19951995    { 
    1996         return opIn_r(key); 
     1996        Slot* slot = lookup(key); 
     1997         
     1998        if(slot is null) 
     1999            return null; 
     2000 
     2001        return &slot.value; 
    19972002    } 
    19982003 
     
    20002005    { 
    20012006        scope str = MDString.newTemp(key); 
    2002         return opIndex(str); 
     2007         
     2008        Slot* slot = lookup(str); 
     2009 
     2010        if(slot is null) 
     2011            return null; 
     2012 
     2013        return &slot.value; 
    20032014    } 
    20042015 
     
    20112022            mSlots[h].key = key; 
    20122023            mSlots[h].value = value; 
     2024             
     2025            if(h is mColSlot) 
     2026                moveColSlot(); 
    20132027        } 
    20142028        else 
     
    20342048 
    20352049            slot.next = &mSlots[mColSlot]; 
    2036              
    2037             for( ; mColSlot < mSlots.length; mColSlot++) 
    2038                 if(mSlots[mColSlot].key is null) 
    2039                     return; 
    2040  
    2041             grow(); 
    2042  
    2043             for(mColSlot = 0; mColSlot < mSlots.length; mColSlot++) 
    2044                 if(mSlots[mColSlot].key is null) 
    2045                     return; 
    2046  
    2047             assert(false, "MDNamespace.opIndexAssign"); 
     2050            moveColSlot(); 
    20482051        } 
    20492052         
     
    21232126                continue; 
    21242127 
    2125             hash_t h = typeid(typeof(v.key)).getHash(&v.key) % newSlots.length; 
     2128            hash_t h = v.key.toHash() % newSlots.length; 
    21262129 
    21272130            if(newSlots[h].key is null) 
     
    21502153         
    21512154        mSlots = newSlots; 
     2155    } 
     2156     
     2157    protected void moveColSlot() 
     2158    { 
     2159        for( ; mColSlot < mSlots.length; mColSlot++) 
     2160            if(mSlots[mColSlot].key is null) 
     2161                return; 
     2162 
     2163        grow(); 
     2164 
     2165        for(mColSlot = 0; mColSlot < mSlots.length; mColSlot++) 
     2166            if(mSlots[mColSlot].key is null) 
     2167                return; 
     2168 
     2169        assert(false, "MDNamespace.moveColSlot"); 
    21522170    } 
    21532171} 
  • trunk/samples/simple.md

    r164 r165  
    11module simple; 
     2 
    23 
    34class Base 
  • trunk/test.d

    r164 r165  
    1616        s = MDInitialize(); 
    1717        MDFileLoader().addPath(`samples`); 
    18         MDFileLoader().addPath(`imports`); 
    19         MDFileLoader().addPath(`benchmark`); 
    2018 
    2119        MDGlobalState().importModule("simple");