Giter Club home page Giter Club logo

algo-cpp's People

Contributors

archeryue avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

algo-cpp's Issues

发现deque有内存泄露的问题

deque进行popback和popfront的的时候没考虑到如果存储的类型中含有指针指向的堆内存,这时不仅仅需要减少size,应该还要调用它的析构函数防止内存泄露。但是如果简单的进行析构的话,可能会导致deque析构的时候发生重复析构,因为delete[]会调用申请的这个数组的每个析构函数,应该用这时应该使用::operator delete取代delete将释放内存的过程和析构函数解藕。这样一来,想想突然发现单单申请内存时候与不需要调用到构造函数同样也可以解藕优化,cpp万恶之源😂

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.