hi @liangfu, thanks for taking a look at my proposal!

I agree the names field is a little complex. here are some alternatives:

N1. use an array of `const char[MAX_FUNC_NAME_LENGTH][num_funcs]`. The positive 
is that you can traverse the list without scanning; the negative is it could 
waste space especially for small functions. if that wasted space is >1 word, 
you may as well consider N2. another negative is that `MAX_FUNC_NAME_LENGTH` 
may need to be adjusted frequently.

N2. use an array of `const char*`, and encode each name as a separate string in 
flash. the positive is you can traverse the whole list without scanning every 
name. the negative is adding 1 word per function name. I think here, i'm 
wondering in what case you wouldn't need to traverse; I think the answer is 
likely if you sorted the names and implemented binary search. you could do 
that; i'd argue that it's not that important yet (num funcs is small, and 
function name lookup is (i don't think) that time-sensitive) and is itself 
added complexity/code space. however, it is well-understood so the complexity 
doesn't bother me as much.

i'm open to each of these, but I would like to point out that special handling 
done here is just combining strcmp with strlen. I agree it's still artisanal.

could you be a bit more specific wrt your API design comment?

Andrew





---
[Visit 
Topic](https://discuss.tvm.ai/t/rfc-misra-c-changes-for-rpc-support/7098/4) to 
respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.ai/email/unsubscribe/48d6d82b6e43fc04db79b6fde67e28121a81f21858294182a7f5716966e44b89).

Reply via email to