about summary refs log tree commit diff
path: root/users/tazjin/german-string
AgeCommit message (Collapse)AuthorFilesLines
2024-08-25 r/8581 feat(tazjin/german-string): impl Clone for GermanStringVincent Ambo1-0/+20
Small strings are always copied fully, without allocations. Large transient strings copy the data and allocate. Large persistent strings are also a trivial copy. Change-Id: I319c0b800fa7a4a62e634176b959bb2fa766a4eb Reviewed-on: https://cl.tvl.fyi/c/depot/+/12342 Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2024-08-22 r/8551 feat(tazjin/german-string): add constructor that leaks a Vec<u8>Vincent Ambo1-2/+29
Change-Id: Id0b6b4794128573ddb62e82fd77d080e564978be Reviewed-on: https://cl.tvl.fyi/c/depot/+/12264 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su>
2024-08-22 r/8550 feat(tazjin/german-string): add persistent construction from staticsVincent Ambo1-9/+56
Makes it possible to construct persistent German Strings from data with 'static lifetime. This doesn't leak any additional data. Change-Id: Ifb3a36ff72b106724883302e4c2195ac54acd352 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12263 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su>
2024-08-22 r/8549 refactor(tazjin/german-string): add type for encoding storage classVincent Ambo1-6/+24
Adds a StorageClassPtr type that is set up to be able to steal bits from an aligned pointer to encode the storage class of a German String. Change-Id: I64591174eac1ebcb73e624a59bd107ba1e02c69d Reviewed-on: https://cl.tvl.fyi/c/depot/+/12262 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2024-08-19 r/8535 feat(tazjin/german-string): add constructor method from owned dataVincent Ambo1-12/+40
Makes it possible to construct a GermanString from an owned byte vector, without having to clone the data. This is done by "disowning" the vector using ManuallyDrop to access its internal pointer. For transient strings, this memory is then owned (and freed) by the GermanString instance. Small strings are copied out of the heap and stored inline as before, to avoid any dereferencing operations. Change-Id: I754736099f71d646d430aed73e558a5a7626c394 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12249 Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2024-08-19 r/8534 feat(tazjin/german-string): add pointer equality check in EqVincent Ambo1-2/+3
This can short-circuit two large string comparisons. Change-Id: If45e7cf33921fe571482dc710c27ef8cc7c70885 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12245 Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2024-08-19 r/8533 chore(tazjin/german-string): add Nix buildVincent Ambo1-0/+5
Change-Id: I1e8c500c9bb4ba365ba32f53f60bcf657f62ed62 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12243 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2024-08-19 r/8532 feat(tazjin/german-string): add [Partial]Ord implementationVincent Ambo1-0/+62
Change-Id: I8002ec63be45a15160387c21ed1fa8721a7c3eb4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12242 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su>
2024-08-19 r/8531 test(tazjin/german-string): add roundtrip proptestsVincent Ambo1-1/+21
Change-Id: Iee392368252d5c6e96d879b213aee34a301d13d6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12241 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2024-08-19 r/8530 feat(tazjin/german-string): add Eq impl & corresponding proptestsVincent Ambo3-1/+428
Change-Id: I66a258fad5d4e249268b9d2743d46b30c5ac1dac Reviewed-on: https://cl.tvl.fyi/c/depot/+/12240 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su>
2024-08-19 r/8529 feat(tazjin/german-string): add Debug implementationVincent Ambo1-0/+7
Change-Id: I9a4a8a4815ac210c402cfc2feb1fe0606affb327 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12239 Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2024-08-19 r/8528 feat(tazjin/german-string): PartialEq implementation for GermanStringVincent Ambo1-0/+16
This is where one of the advantages of this string representation starts to shine: For small strings there's no derefencing any heap memory at all, and for the long representation we can compare the prefix before moving on. Change-Id: Iac333a52e8d7c9dd09e33dbcf51754e321c880e6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12238 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2024-08-19 r/8525 fix(tazjin/german-string): add maximum length checkVincent Ambo1-0/+4
Change-Id: I4fd9b2a31749d65632b662807c4e703a9df9ec9e Reviewed-on: https://cl.tvl.fyi/c/depot/+/12237 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2024-08-19 r/8524 feat(tazjin/german-string): add data accessors for &str and &[u8]Vincent Ambo1-1/+67
Change-Id: I992e625861f79ef6d9993e8caee4e02d3fc5557e Reviewed-on: https://cl.tvl.fyi/c/depot/+/12236 Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: tazjin <tazjin@tvl.su>
2024-08-19 r/8523 feat(tazjin/german-string): add Drop impl for transient stringsVincent Ambo1-0/+17
All of these strings are currently transient (the storage class is not yet represented anywhere), and the ones that are heap allocated need to be deallocated when the transient string dies. Change-Id: Iba0ca926df5db7594f304c5d5318db9d69c6f42c Reviewed-on: https://cl.tvl.fyi/c/depot/+/12235 Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2024-08-19 r/8522 feat(tazjin/german-string): init initial representationVincent Ambo4-0/+82
This adds an initial implementation of the so-called "German Strings" in Rust. https://cedardb.com/blog/german_strings/ This implementation is *far from* complete, the only thing that can be done right now is construct a string, and even that I'm not fully happy with. Change-Id: I2697932a0ef373be76ffd14d59677493a5783b58 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12234 Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>