jcrist / msgspec

A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML
https://jcristharif.com/msgspec/
BSD 3-Clause "New" or "Revised" License
2.01k stars 59 forks source link

Support numeric constraints for Decimal types #692

Open corentin-regent opened 1 month ago

corentin-regent commented 1 month ago

This is my first time playing around with C, so please feel free to tell me if more micro-optimizations can be achieved. Same for compiler hints, notably for the MS_INLINE and MS_NOINLINE near ms_check_decimal_constraints(...): I implemented it in a manner similar to what was done for floats for example, though I must admit that I did not quite understand the pattern for when to use each.

Also, I added a DevContainer for easier setup for newcomers to the project.

Closes https://github.com/jcrist/msgspec/issues/683.