Skip to content

assess AI_dictAdd potential small memleak and compare against rax usage #326

Open
@filipecosta90

Description

@filipecosta90

something to keep in mind for future refactoring ( assess if it makes sense to maitain AI_dict or replace them with a rax implementation which is already battle tested ).

==12802== 80 (32 direct, 48 indirect) bytes in 1 blocks are definitely lost in loss record 759 of 908
==12802==    at 0x4C31B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==12802==    by 0x67C94FF: AI_dictExpand (dict.c:196)
==12802==    by 0x67CADE0: _dictExpandIfNeeded (dict.c:965)
==12802==    by 0x67CAEC7: _dictKeyIndex (dict.c:1007)
==12802==    by 0x67C9999: AI_dictAddRaw (dict.c:339)
==12802==    by 0x67C98DA: AI_dictAdd (dict.c:304)

quickly reproduce:

DEBUG=1 VALGRIND=1 make -C opt clean && VALGRIND=1 WITH_TFLITE=0 WITH_ORT=0 DEBUG=1 make -C opt test &> valgrind.out

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions