Opened 14 years ago

Closed 12 years ago

#1300 closed defect (wontfix)

HashTable is semi-mutable

Reported by: Martin Sjölund Owned by: Martin Sjölund
Priority: blocker Milestone:
Component: Backend Version:
Keywords: Cc: Martin Sjölund

Description

The HashTable contains some fields that are mutable and some that are not. If it should be an immutable structure, it needs to use vectors instead of arrays.

But it should be mutable. It's used under the assumption that it is anyway.

Solution: Make all the scalar fields in a HashTable into arrays of size 1, or encapsulate it into type HashTable = HashTableImpl[:].

Change History (4)

comment:1 by Martin Sjölund, 14 years ago

Problem: If you make this mutable as it should be, the FunctionTree structure is no longer always generated.

comment:2 by Martin Sjölund, 14 years ago

Created branch https://openmodelica.org:8443/cb/proj/sources/sccFileLog.do?proj_id=1&filename=branches/sjoelund-functiontree&isDir=true

The initial step is to move FUNCTION from Element to Function uniontype. Then we need to move FunctionTree from DAE.DAElist to Env.Cache. After that, we can make the FunctionTree mutable.

comment:3 by Martin Sjölund, 14 years ago

The branch now uses a non-mutable hashtable which solves this issue (but the branch is not 100% testsuite compatible yet). Note that the issue still remains (updating a value in the hashtable is mutable; adding a new value is not).

comment:4 by Martin Sjölund, 12 years ago

Cc: sjoelund.se, → sjoelund.se
Component: Backend
Resolution: wontfix
Status: acceptedclosed

I'm too tired to fix this :(

Note: See TracTickets for help on using tickets.