GithubHelp home page GithubHelp logo

rescrv / e Goto Github PK

View Code? Open in Web Editor NEW
71.0 71.0 26.0 575 KB

Library containing high-performance datastructures and utilities for C++

License: BSD 3-Clause "New" or "Revised" License

C++ 87.81% C 6.42% Makefile 0.90% M4 4.87%

e's People

Contributors

mohaps avatar mreiferson avatar nedgonaes avatar rescrv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

e's Issues

Tag for 0.11.0?

HyperDex contains a download to version 0.11.0 of e, but it is unclear which commit this was crafted from.

Build fails

/tmp/e> make
make --no-print-directory all-am
  CXX      atomic.lo
In file included from atomic.cc:44:0:
e/atomic.h: In function 'void e::atomic::memory_barrier()':
e/atomic.h:87:38: error: 'exchange_32_fullbarrier' was not declared in this scope
         exchange_32_fullbarrier(&x, 0);
                                      ^
e/atomic.h: In function 'uint64_t e::atomic::compare_and_swap_64_nobarrier(volatile uint64_t*, uint64_t, uint64_t)':
e/atomic.h:372:45: error: 'old_val' was not declared in this scope
     return __sync_val_compare_and_swap(ptr, old_val, new_val);
                                             ^
e/atomic.h:372:54: error: 'new_val' was not declared in this scope
     return __sync_val_compare_and_swap(ptr, old_val, new_val);
                                                      ^
e/atomic.h: In function 'uint64_t e::atomic::exchange_64_nobarrier(volatile uint64_t*, uint64_t)':
e/atomic.h:502:56: error: 'new_val' was not declared in this scope
     } while (__sync_val_compare_and_swap(ptr, old_val, new_val) != old_val);
                                                        ^
make[1]: *** [atomic.lo] Error 1
make: *** [all] Error 2

/tmp/e> uname -a
Linux pc-uoi 3.13.0-40-generic #69-Ubuntu SMP Thu Nov 13 17:56:26 UTC 2014 i686 i686 i686 GNU/Linux

/tmp/e> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:    14.04
Codename:   trusty

slice::compare() does not work as expected.

I re-used the slice.h/cc in a project as it was a convenient bit of code to re-use without pulling in larger dependencies.

While reading it I noticed that the compare method seems to be either trivially wrong or at least not what i would have expected...

The implementation is:

inline int
slice :: compare(const slice& rhs) const
{
    if (m_sz < rhs.m_sz)
    {
        return -1;
    }
    else if (m_sz > rhs.m_sz)
    {
        return 1;
    }
    else
    {
        return memcmp(m_data, rhs.m_data, m_sz);
    }
}

So compare() sorts slices based on length alone, and only if they happen to be same length does it give (expected) lexicographical comparison.

As a result slice("z") sorts before slice("aaa").

Is this intentional? Seems a large oversight if that class is ever used anywhere if not. If it is intentional, what is the rationale for that behaviour. I'm not sure I see how it would ever be useful...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.