Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions core/iwasm/common/wasm_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,10 +796,9 @@ wasm_runtime_shared_heap_malloc(WASMModuleInstanceCommon *module_inst,
*p_native_addr = native_addr;
}

return memory->is_memory64
? shared_heap->start_off_mem64
: shared_heap->start_off_mem32
+ ((uint8 *)native_addr - shared_heap->base_addr);
return (memory->is_memory64 ? shared_heap->start_off_mem64
: shared_heap->start_off_mem32)
+ (uintptr_t)((uint8 *)native_addr - shared_heap->base_addr);
}

void
Expand Down
1 change: 1 addition & 0 deletions core/shared/platform/zephyr/zephyr_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ os_openat(os_file_handle handle, const char *path, __wasi_oflags_t oflags,
}

if (!build_absolute_path(abs_path, sizeof(abs_path), path)) {
BH_FREE(*out);
return __WASI_ENOMEM;
}

Expand Down
7 changes: 5 additions & 2 deletions core/shared/utils/bh_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,15 @@ bh_queue_destroy(bh_queue *queue)
bool
bh_post_msg2(bh_queue *queue, bh_queue_node *msg)
{
bh_queue_mutex_lock(&queue->queue_lock);

if (queue->cnt >= queue->max) {
queue->drops++;
bh_free_msg(msg);
bh_queue_mutex_unlock(&queue->queue_lock);
return false;
}

bh_queue_mutex_lock(&queue->queue_lock);

if (queue->cnt == 0) {
bh_assert(queue->head == NULL);
bh_assert(queue->tail == NULL);
Expand Down Expand Up @@ -131,7 +132,9 @@ bh_post_msg(bh_queue *queue, unsigned short tag, void *body, unsigned int len)
{
bh_queue_node *msg = bh_new_msg(tag, body, len, NULL);
if (msg == NULL) {
bh_queue_mutex_lock(&queue->queue_lock);
queue->drops++;
bh_queue_mutex_unlock(&queue->queue_lock);
if (len != 0 && body)
BH_FREE(body);
return false;
Expand Down
Loading