stevenvar / OMicroB

An OCaml generic virtual machine for microcontrollers
Other
138 stars 23 forks source link

Missing Val_string and String_val macros #29

Open jserot opened 4 years ago

jserot commented 4 years ago

These macros are not listed in src/bytecode/vm/values-xxx.h. Is this deliberate ?

Vertmo commented 4 years ago

I think that's because in OMicroB, static strings are stored in the flash memory (as much as possible in any case) in order to save RAM. If I understand correctly, that means access to the string must be done on a character basis (otherwise you would have to basically copy the string in the RAM, which a simple macro like String_val probably shouldn't do). I hope that's helpful. Maybe @bvaugon can explain better ?