Skip to content

CEE0810 Error on Reallocate Statement #6

@acejoh

Description

@acejoh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions