aboutsummaryrefslogtreecommitdiff
path: root/lib/wamr/core/shared/utils/bh_bitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/wamr/core/shared/utils/bh_bitmap.c')
-rw-r--r--lib/wamr/core/shared/utils/bh_bitmap.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/wamr/core/shared/utils/bh_bitmap.c b/lib/wamr/core/shared/utils/bh_bitmap.c
deleted file mode 100644
index 2ee9180..0000000
--- a/lib/wamr/core/shared/utils/bh_bitmap.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2021 Intel Corporation. All rights reserved.
- * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- */
-
-#include "bh_bitmap.h"
-
-bh_bitmap *
-bh_bitmap_new(uintptr_t begin_index, unsigned bitnum)
-{
- bh_bitmap *bitmap;
- uint32 bitmap_size = (bitnum + 7) / 8;
- uint32 total_size = offsetof(bh_bitmap, map) + bitmap_size;
-
- if (bitnum > UINT32_MAX - 7 || total_size < offsetof(bh_bitmap, map)
- || (total_size - offsetof(bh_bitmap, map)) != bitmap_size) {
- return NULL; /* integer overflow */
- }
-
- if ((bitmap = BH_MALLOC(total_size)) != NULL) {
- memset(bitmap, 0, total_size);
- bitmap->begin_index = begin_index;
- bitmap->end_index = begin_index + bitnum;
- }
-
- return bitmap;
-}