Skip to content

Remove MEM_HEAP_PTR_64 macro #976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,6 @@ project (Jerry C ASM)

# Compiler / Linker flags
set(COMPILE_FLAGS_JERRY "-fno-builtin")
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
set(COMPILE_FLAGS_JERRY "${COMPILE_FLAGS_JERRY} -DMEM_HEAP_PTR_64")
endif()
if(NOT ("${PLATFORM}" STREQUAL "DARWIN"))
set(LINKER_FLAGS_COMMON "-Wl,-z,noexecstack")
endif()
Expand Down
2 changes: 1 addition & 1 deletion jerry-core/mem/mem-heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ typedef struct
uint32_t size; /* Size of region */
} mem_heap_free_t;

#ifdef MEM_HEAP_PTR_64
#if UINTPTR_MAX > UINT32_MAX
#define MEM_HEAP_GET_OFFSET_FROM_ADDR(p) ((uint32_t) ((uint8_t *) (p) - (uint8_t *) mem_heap.area))
#define MEM_HEAP_GET_ADDR_FROM_OFFSET(u) ((mem_heap_free_t *) &mem_heap.area[u])
#else
Expand Down
7 changes: 2 additions & 5 deletions jerry-core/mem/mem-poolman.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
typedef struct mem_pools_chunk
{
struct mem_pools_chunk *next_p; /* pointer to next pool chunk */
#ifndef MEM_HEAP_PTR_64
uint32_t dummy; /* dummy member for alignment */
#endif
} mem_pools_chunk_t;

/**
Expand Down Expand Up @@ -107,8 +104,8 @@ static void mem_pools_stat_dealloc (void);
void
mem_pools_init (void)
{
JERRY_STATIC_ASSERT (sizeof (mem_pools_chunk_t) == MEM_POOL_CHUNK_SIZE,
size_of_mem_pool_chunk_t_must_be_equal_to_MEM_POOL_CHUNK_SIZE);
JERRY_STATIC_ASSERT (sizeof (mem_pools_chunk_t) <= MEM_POOL_CHUNK_SIZE,
size_of_mem_pools_chunk_t_must_be_less_than_or_equal_to_MEM_POOL_CHUNK_SIZE);

mem_free_chunk_p = NULL;

Expand Down