move code size benchmark to separate directory
This commit is contained in:
parent
cea1f36e63
commit
24e28e7bb5
6 changed files with 13 additions and 71 deletions
morphisms
24
morphisms/length_prefix.morphism-base
Normal file
24
morphisms/length_prefix.morphism-base
Normal file
|
@ -0,0 +1,24 @@
|
|||
morph_array_as_valterm_to_lenpfx (Terminator:x86.UInt8)
|
||||
<Seq~<ValueTerminated Terminator> x86.UInt8>
|
||||
--> <Seq~<LengthPrefix x86.UInt64> x86.UInt8>
|
||||
```
|
||||
length_prefix_uint8_array_clear(dst);
|
||||
while( *src != Terminator ) {
|
||||
length_prefix_uint8_array_push(dst, *src);
|
||||
src++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
```
|
||||
|
||||
morph_array_as_lenpfx_to_valterm (Terminator:x86.UInt8)
|
||||
<Seq~<LengthPrefix x86.UInt64> x86.UInt8>
|
||||
--> <Seq~<ValueTerminated Terminator> x86.UInt8>
|
||||
```
|
||||
for( uint64_t i = 0; i < src->len; ++i ) {
|
||||
*dst ++ = src->items[i];
|
||||
}
|
||||
*dst = Terminator;
|
||||
|
||||
return 0;
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue