drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
ut0byte.h File Reference
#include "univ.i"
Include dependency graph for ut0byte.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

UNIV_INLINE ib_uint64_t ut_ull_create (ulint high, ulint low) __attribute__((const))
UNIV_INLINE ib_uint64_t ut_uint64_align_down (ib_uint64_t n, ulint align_no)
UNIV_INLINE ib_uint64_t ut_uint64_align_up (ib_uint64_t n, ulint align_no)
UNIV_INLINE void * ut_align (const void *ptr, ulint align_no)
UNIV_INLINE void * ut_align_down (const void *ptr, ulint align_no) __attribute__((const))
UNIV_INLINE ulint ut_align_offset (const void *ptr, ulint align_no) __attribute__((const))
UNIV_INLINE ibool ut_bit_get_nth (ulint a, ulint n)
UNIV_INLINE ulint ut_bit_set_nth (ulint a, ulint n, ibool val)

Detailed Description

Utilities for byte operations

Created 1/20/1994 Heikki Tuuri

Definition in file ut0byte.h.

Macro Definition Documentation

◆ ut0byte_h

#define ut0byte_h

Definition at line 28 of file ut0byte.h.

Function Documentation

◆ ut_align()

UNIV_INLINE void * ut_align ( const void * ptr,
ulint align_no )

The following function rounds up a pointer to the nearest aligned address.

Returns
aligned pointer in: align by this number
Parameters
ptrin: pointer

◆ ut_align_down()

UNIV_INLINE void * ut_align_down ( const void * ptr,
ulint align_no ) const

The following function rounds down a pointer to the nearest aligned address.

Returns
aligned pointer
Parameters
ptrin: pointer
align_noin: align by this number

◆ ut_align_offset()

UNIV_INLINE ulint ut_align_offset ( const void * ptr,
ulint align_no ) const

The following function computes the offset of a pointer from the nearest aligned address.

Returns
distance from aligned pointer
Parameters
ptrin: pointer
align_noin: align by this number

◆ ut_bit_get_nth()

UNIV_INLINE ibool ut_bit_get_nth ( ulint a,
ulint n )

Gets the nth bit of a ulint.

Returns
TRUE if nth bit is 1; 0th bit is defined to be the least significant in: nth bit requested
Parameters
ain: ulint

◆ ut_bit_set_nth()

UNIV_INLINE ulint ut_bit_set_nth ( ulint a,
ulint n,
ibool val )

Sets the nth bit of a ulint.

Returns
the ulint with the bit set as requested in: value for the bit to set
Parameters
ain: ulint
nin: nth bit requested

◆ ut_uint64_align_down()

UNIV_INLINE ib_uint64_t ut_uint64_align_down ( ib_uint64_t n,
ulint align_no )

Rounds a 64-bit integer downward to a multiple of a power of 2.

Returns
rounded value in: align by this number which must be a power of 2
Parameters
nin: number to be rounded

◆ ut_uint64_align_up()

UNIV_INLINE ib_uint64_t ut_uint64_align_up ( ib_uint64_t n,
ulint align_no )

Rounds ib_uint64_t upward to a multiple of a power of 2.

Returns
rounded value in: align by this number which must be a power of 2
Parameters
nin: number to be rounded

◆ ut_ull_create()

UNIV_INLINE ib_uint64_t ut_ull_create ( ulint high,
ulint low ) const

Creates a 64-bit integer out of two 32-bit integers.

Returns
created dulint
Parameters
highin: high-order 32 bits
lowin: low-order 32 bits