Skip to content

Commit

Permalink
added bytes address 64
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Oct 12, 2023
1 parent d6eb1fe commit 2bad7f4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/std/bytes.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ HL_PRIM int hl_bytes_subtract( vbyte *a, vbyte *b ) {
return (int)(a - b);
}

HL_PRIM int_val hl_bytes_address64( vbyte *a ) {
return (int_val)a;
}

HL_PRIM int hl_bytes_address( vbyte *a, int *high ) {
# ifdef HL_64
*high = (int)(((uint64)a)>>32);
Expand All @@ -258,6 +262,10 @@ HL_PRIM vbyte *hl_bytes_from_address( int low, int high ) {
# endif
}

HL_PRIM vbyte *hl_bytes_from_address64( int_val v ) {
return (vbyte*)v;
}

HL_PRIM int hl_string_compare( vbyte *a, vbyte *b, int len ) {
return memcmp(a,b,len * sizeof(uchar));
}
Expand All @@ -278,3 +286,5 @@ DEFINE_PRIM(_BYTES,bytes_offset, _BYTES _I32);
DEFINE_PRIM(_I32,bytes_subtract, _BYTES _BYTES);
DEFINE_PRIM(_I32,bytes_address, _BYTES _REF(_I32));
DEFINE_PRIM(_BYTES,bytes_from_address, _I32 _I32);
DEFINE_PRIM(_I64,bytes_address64, _BYTES);
DEFINE_PRIM(_BYTES,bytes_from_address64, _I64);

0 comments on commit 2bad7f4

Please sign in to comment.