Giter Site home page Giter Site logo

Comments (2)

TyelorD avatar TyelorD commented on June 3, 2024

I found a potential work around. I can make a pull request for this fix, if it's deemed appropriate and bug free.

My change is as follows, in Debug.h change the definition of DebugExtension::_readFile to:

virtual char *_readFile(const String &path, int *length) {
    auto data = _extension->_readFile(path, length);
    
    if (_allocated.count(data) == 0) {
        _allocated[data] = Allocation(data, sizeof(char) * (*length), nullptr, 0);
        _allocations++;
        _usedMemory += sizeof(char) * (*length);
    }
    
    return data;
}

I will note that this doesn't add the FILE or LINE values to the Allocation struct, since I wanted to avoid making changes outside of Debug.h.

from spine-runtimes.

badlogic avatar badlogic commented on June 3, 2024

The warning is actually correct. While Atlas calls the extension, the extension itself is not allocating this memory. It's Cocos2D-x that loads the file and allocates the in-memory buffer for its contents.

See https://github.com/EsotericSoftware/spine-runtimes/blob/4.2/spine-cocos2dx/spine-cocos2dx/src/spine/spine-cocos2dx.cpp#L134-L150

That said, the warning no longer really serves a purpose, as that part of the runtime has been thoroughly tested. I've applied your change. Thanks!

from spine-runtimes.

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.