[Gambas-user] gb.data: Trie class
Benoît Minisini
gambas at ...1...
Wed Sep 24 01:58:49 CEST 2014
Le 23/09/2014 21:47, Tobias Boege a écrit :
> Also, Benoit: tell me what you think about the interface. I documented
> everything in the source code (c_trie.c).
>
The interface seems perfect. It's just the name "Trie" that I find ugly. :-)
Another point on the implementation: you should not use malloc(), free()
and realloc(), but the functions provided by the interpreter API, i.e.
GB.Alloc(), GB.Free() and GB.Realloc().
They are usually faster, especially if you allocate small chunks of data.
Moreover, they can detect memory leaks by checking that every allocation
has been freed at the end of the program.
If you can compare with malloc() easily, don't hesitate not to trust me
and check. :-)
Regards,
--
Benoît Minisini
More information about the User
mailing list