Better HN
topnewbestaskshowjobs
Log inSign up

aes512

1 karma · joined Jun 14, 2023 (3y ago) · 1 submissions

Submissions

comment 3y ago · link · parent

You mentioned it yourself, but please use `strncmp` - you don't want to have unbounded c style strings like that as keys.

A lot of mallocs. Just malloc a pool and implement an allocation strategy on top of it. Malloc more as necessary (say 2^n).

You mention map types in other languages. They're not always implemented as a hashmap. A tree is commonly used to implement maps too.

Embedded environments generally avoid `malloc` and the heap entirely. You have a simple allocator on top of a fixed allotment of memory instead.