move header & library for morphism data structures to 'runtime' diretcory
- adapt Makefile for code size benchmark - write build files to 'target' directory
This commit is contained in:
parent
5a64334b1d
commit
630948139b
3 changed files with 26 additions and 19 deletions
morphisms/runtime/include/array
70
morphisms/runtime/include/array/length-prefix.h
Normal file
70
morphisms/runtime/include/array/length-prefix.h
Normal file
|
@ -0,0 +1,70 @@
|
|||
#pragma once
|
||||
#include <stdint.h>
|
||||
|
||||
/* UInt8 */
|
||||
|
||||
struct LengthPrefixUInt8Array {
|
||||
uint64_t len;
|
||||
uint8_t items[];
|
||||
};
|
||||
|
||||
void length_prefix_uint8_array_clear(
|
||||
struct LengthPrefixUInt8Array * data
|
||||
);
|
||||
void length_prefix_uint8_array_push(
|
||||
struct LengthPrefixUInt8Array * data,
|
||||
uint8_t value
|
||||
);
|
||||
int length_prefix_uint8_array_reverse(
|
||||
struct LengthPrefixUInt8Array const * restrict src,
|
||||
struct LengthPrefixUInt8Array * restrict dst
|
||||
);
|
||||
void length_prefix_uint8_array_dump(
|
||||
struct LengthPrefixUInt8Array const * data
|
||||
);
|
||||
|
||||
/* UInt64 */
|
||||
|
||||
struct LengthPrefixUInt64Array {
|
||||
uint64_t len;
|
||||
uint64_t items[];
|
||||
};
|
||||
|
||||
void length_prefix_uint64_array_clear(
|
||||
struct LengthPrefixUInt64Array * data
|
||||
);
|
||||
void length_prefix_uint64_array_push(
|
||||
struct LengthPrefixUInt64Array * data,
|
||||
uint64_t value
|
||||
);
|
||||
int length_prefix_uint64_array_reverse(
|
||||
struct LengthPrefixUInt64Array const * restrict src,
|
||||
struct LengthPrefixUInt64Array * restrict dst
|
||||
);
|
||||
void length_prefix_uint64_array_dump(
|
||||
struct LengthPrefixUInt64Array const * data
|
||||
);
|
||||
|
||||
/*
|
||||
* Map
|
||||
*/
|
||||
int length_prefix_array_map_64_to_64(
|
||||
int (*f) ( uint64_t const * restrict, uint64_t * restrict ),
|
||||
struct LengthPrefixUInt64Array const * restrict src,
|
||||
struct LengthPrefixUInt64Array * restrict dst
|
||||
);
|
||||
int length_prefix_array_map_8_to_64(
|
||||
int (*f) ( uint8_t const * restrict, uint64_t * restrict ),
|
||||
struct LengthPrefixUInt8Array const * restrict src,
|
||||
struct LengthPrefixUInt64Array * restrict dst
|
||||
);
|
||||
int length_prefix_array_map_64_to_8(
|
||||
int (*f) ( uint64_t const * restrict, uint8_t * restrict ),
|
||||
struct LengthPrefixUInt64Array const * restrict src,
|
||||
struct LengthPrefixUInt8Array * restrict dst
|
||||
);
|
||||
int length_prefix_array_map_8_to_8(
|
||||
int (*f) ( uint8_t const * restrict, uint8_t * restrict ),
|
||||
struct LengthPrefixUInt8Array const * restrict src,
|
||||
struct LengthPrefixUInt8Array * restrict dst
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue