jit_utils.c 446 B

12345678910111213141516171819
  1. /*
  2. * Copyright (C) 2021 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #include "jit_utils.h"
  6. JitBitmap *
  7. jit_bitmap_new(uintptr_t begin_index, unsigned bitnum)
  8. {
  9. JitBitmap *bitmap;
  10. if ((bitmap = jit_calloc(offsetof(JitBitmap, map) + (bitnum + 7) / 8))) {
  11. bitmap->begin_index = begin_index;
  12. bitmap->end_index = begin_index + bitnum;
  13. }
  14. return bitmap;
  15. }