Giter Site home page Giter Site logo

Comments (2)

 avatar commented on July 20, 2024

newchunk->next->pre并没有指向chunk,而是默认值NULL,只有已经被申请的内存块的pre指针才有意义(:smile:我瞎猜的,欢迎大佬批评指正

from hurlex-doc.

nekopara-orz avatar nekopara-orz commented on July 20, 2024

newchunk->next->pre并没有指向chunk,而是默认值NULL,只有已经被申请的内存块的pre指针才有意义(😄我瞎猜的,欢迎大佬批评指正

1->2
考虑这样一种情况,在某次分配、合并结束后有上面这两块内存,1号没被分配2号被分配了这时候2指向1。

1->3->2

这时候我又从1中分配了了一块内存这时候newchunk就是3,3的next->pre如果不更改的话就会还指向1也就是2的pre还是1不是3。
那么如果3被分配出去了。1和2回收时不管3回收没都会被glue函数回收掉。

from hurlex-doc.

Related Issues (20)

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.