Giter VIP home page Giter VIP logo

rpg's Introduction

RPG

This repository contains utility functions and collection implementations for IBM i.

Collections

Maps

Sets

Authors

  • Edoardo Luppi

Acknowledgments

Thanks to Mihael Schmidt and to the StackOverflow community.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

rpg's People

Contributors

lppedd 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rpg's Issues

HashMap - nextEntry when removing an entry

Hello,

I've so far only read the code, and never tried using it, so I'm just making an assumption.

I've noticed that in the remove function, the entry is set to *Null, but the the nextEntry of the previous element isn't updated with the nextEntry of the entry currently removed.

Doesn't this make all the entries after the entry currently deleted inaccessible? I would imagine this would lead to memory leaks because the dispose function loops until "entry@ = *null".

Regards

CEE0810 Error on Reallocate Statement

Hi,

Thanks for sharing your code. I ran into an issue when adding a 'large' amount of entries to my hashmap. After a while I would get a CEE0810 Error on a hashmapPut call.
After some testing I discovered that the problem lies in the addEntry procedure:

   if (entryPtr = *null);
       allocSpace(entryPtr:ENTRY_SIZE);
       bucket.entryPtr = entryPtr;
   ...
     allocSpace(entry.keyPtr:keySize);
     allocSpace(entry.valuePtr:valueSize); 

Space is allocated but not initialized. As a result entry.keyPtr and entry.valuePtr could contain garbage and this causes allocSpace to fail with the CEE0810 error.
My solution was to add a "clear entry" statement after allocSpace(entryPtr:ENTRY_SIZE);

The same problem applies to arraylist: (arrayAdd procedure)

    entryPtr = getEntry(arrayPtr:index_);
     clear entry;                                                     // initialize entry
     allocSpace(entry.objectPtr:objectSize); 

Kind regards

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.