Giter Site home page Giter Site logo

疑似有内存泄漏 about nino HOT 6 CLOSED

jasonxudeveloper avatar jasonxudeveloper commented on June 8, 2024
疑似有内存泄漏

from nino.

Comments (6)

JasonXuDeveloper avatar JasonXuDeveloper commented on June 8, 2024 1

应该是隐式转换的地方传入了长度去检查,实际上应该是长度-1来作为索引,这块我晚点整理一下。

from nino.

JasonXuDeveloper avatar JasonXuDeveloper commented on June 8, 2024 1

处理好了,特意增加了个用来以总量进行判断的函数

from nino.

JasonXuDeveloper avatar JasonXuDeveloper commented on June 8, 2024

index是索引,是下标,所以是一直需要小于当前长度的。
下标所允许的最大值应该是总长度-1,所以这里用小于,而非小于等于是正确的

隐式转换的地方没看到有操作TotalLength

from nino.

paris-bupt avatar paris-bupt commented on June 8, 2024

image

image

from nino.

paris-bupt avatar paris-bupt commented on June 8, 2024

直觉上,EnsureCapacity函数参数的语义应该以“容量”而不是“索引”来处理会好一些

from nino.

JasonXuDeveloper avatar JasonXuDeveloper commented on June 8, 2024

嗯,主要是一般都是检查访问的index是否存在,所以检查的时候就是检查index是否小于totalLength了,隐式转换的地方我晚点用电脑处理一下

from nino.

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.