iree/hal/local/loaders/system_library_loader.c
static const iree_hal_system_executable_footer_t*
iree_hal_system_executable_try_query_footer(
    iree_const_byte_span_t executable_data) {
  if (executable_data.data_length <
      sizeof(iree_hal_system_executable_footer_t)) {
    return NULL;
  }
  const uint8_t* footer_ptr = executable_data.data +
                              executable_data.data_length -
                              sizeof(iree_hal_system_executable_footer_t);
  const iree_hal_system_executable_footer_t* footer =
      (const iree_hal_system_executable_footer_t*)(footer_ptr);
  static_assert(sizeof(IREE_HAL_SYSTEM_EXECUTABLE_FOOTER_MAGIC) - /*NUL*/ 1 ==
                    sizeof(footer->magic),
                "magic number value must match struct size");
  if (memcmp(footer->magic, IREE_HAL_SYSTEM_EXECUTABLE_FOOTER_MAGIC,
             sizeof(footer->magic)) != 0) {
    return NULL;
  }
  return footer;
}
// Tries to find an iree_hal_system_executable_footer_t at the end of the
// given executable data stream.
Tries to find an iree_hal_system_executable_footer_t at the end of the
given executable data stream.
Tries to find an iree_hal_system_executable_footer_t at the end of the given executable data stream .
static const iree_hal_system_executable_footer_t*
iree_hal_system_executable_try_query_footer(
    iree_const_byte_span_t executable_data) {
  if (executable_data.data_length <
      sizeof(iree_hal_system_executable_footer_t)) {
    return NULL;
  }
  const uint8_t* footer_ptr = executable_data.data +
                              executable_data.data_length -
                              sizeof(iree_hal_system_executable_footer_t);
  const iree_hal_system_executable_footer_t* footer =
      (const iree_hal_system_executable_footer_t*)(footer_ptr);
  static_assert(sizeof(IREE_HAL_SYSTEM_EXECUTABLE_FOOTER_MAGIC) -  1 ==
                    sizeof(footer->magic),
                "magic number value must match struct size");
  if (memcmp(footer->magic, IREE_HAL_SYSTEM_EXECUTABLE_FOOTER_MAGIC,
             sizeof(footer->magic)) != 0) {
    return NULL;
  }
  return footer;
}
static const iree_hal_system_executable_footer_t * iree_hal_system_executable_try_query_footer ( iree_const_byte_span_t executable_data ) { if ( executable_data . data_length < sizeof ( iree_hal_system_executable_footer_t ) ) { return NULL ; } const uint8_t * footer_ptr = executable_data . data + executable_data . data_length - sizeof ( iree_hal_system_executable_footer_t ) ; const iree_hal_system_executable_footer_t * footer = ( const iree_hal_system_executable_footer_t * ) ( footer_ptr ) ; static_assert ( sizeof ( IREE_HAL_SYSTEM_EXECUTABLE_FOOTER_MAGIC ) - 1 == sizeof ( footer -> magic ) , " " ) ; if ( memcmp ( footer -> magic , IREE_HAL_SYSTEM_EXECUTABLE_FOOTER_MAGIC , sizeof ( footer -> magic ) ) != 0 ) { return NULL ; } return footer ; }
Tries to find an iree_hal_system_executable_footer_t at the end of the
given executable data stream.
Tries to find an iree_hal_system_executable_footer_t at the end of the given executable data stream .
/*NUL*/