Skip to content

Strictly enforce memory requirements. #295

Open
@shakedregev

Description

@shakedregev

Summary

There are some places in the code where memory is used in a sloppy manner. This is an example which likely occurs many times in the code.
For example, a vector may be allocated twice in certain cases or the code can try to delete something that was never allocated. We should enforce strict usage to make sure the code runs efficiently and that debugging is easy.

In methods such as this, we should add asserts to create segfaults.

Rationale

Sloppy memory management can make writing code easier, but it can create nasty bugs that are difficult to find. For example, one might expect data to be in one location, but it isn't because the function that was supposed to move it there quietly did nothing. In this case the incorrect result can be observed far downstream from the error and it can be very hard to track down.

Description

A solution can build upon this and add assert statements. An alternative is to use a check error wrapper that pinpoints issues to a specific line.

Additional information

@superwhiskers - do you have bandwidth for this?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions