GithubHelp home page GithubHelp logo

devinacker / exhal Goto Github PK

View Code? Open in Web Editor NEW
62.0 10.0 8.0 80 KB

Compression and decompression tools for NES, SNES, and Game Boy games by HAL Laboratory

License: MIT License

C 99.29% Makefile 0.71%
compression romhacking rom-hacking nes snes gameboy

exhal's People

Contributors

bentley avatar devin-ami avatar devinacker avatar tiiffi 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

exhal's Issues

Thread-safety

Is there any reason why pack() might not be thread-safe? PInvoking pack() multiple times in parallel (with separate buffers for each call) results in access violation exceptions:

// PInvoke signature
[DllImport("compress.dll", EntryPoint = "pack", CallingConvention = CallingConvention.Cdecl)]
public static extern int Pack(byte[] unpacked, int inputsize, byte[] packed, int fast);

// Create random test buffers
byte[][] testBuffers = new byte[16][];
var rand = new Random();

for (int i = 0; i < 16; i++)
{
    testBuffers[i] = new byte[4096];
    rand.NextBytes(testBuffers[i]);
}

// Create output buffers
byte[][] outputBuffers = new byte[16][];
for (int i = 0; i < 16; i++)
    outputBuffers[i] = new byte[64 * 1024];

// Run pack() in parallel
Parallel.For(0, 16, i =>
    {
        int index = i;
        int packedSize = Pack(testBuffers[index], 4096, outputBuffers[index], 1);
    });

// Program crashes with "A first chance exception of type 'System.AccessViolationException' occurred"

It seems that pack() otherwise works fine in serial.

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.