Skip to content

Remove memory management-related dead code #934

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
5 changes: 0 additions & 5 deletions jerry-core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
*/
#define CONFIG_MEM_POOL_CHUNK_SIZE (8)

/**
* Size of heap chunk
*/
#define CONFIG_MEM_HEAP_CHUNK_SIZE (64)

/**
* Size of heap
*/
Expand Down
7 changes: 0 additions & 7 deletions jerry-core/jrt/jrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,6 @@ extern void __noreturn jerry_fatal (jerry_fatal_code_t);
* Alignment
*/

/**
* Aligns @a value to @a alignment.
*
* Returns maximum positive value, that divides @a alignment and is less than or equal to @a value
*/
#define JERRY_ALIGNDOWN(value, alignment) ((alignment) * ((value) / (alignment)))

/**
* Aligns @a value to @a alignment.
*
Expand Down
5 changes: 0 additions & 5 deletions jerry-core/mem/mem-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
*/
#define MEM_HEAP_SIZE ((size_t) (CONFIG_MEM_HEAP_AREA_SIZE))

/**
* Size of heap chunk
*/
#define MEM_HEAP_CHUNK_SIZE ((size_t) (CONFIG_MEM_HEAP_CHUNK_SIZE))

/**
* Size of pool chunk
*/
Expand Down
17 changes: 0 additions & 17 deletions jerry-core/mem/mem-heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ void mem_heap_valgrind_freya_mempool_request (void)
# define VALGRIND_FREYA_FREELIKE_SPACE(p)
#endif /* JERRY_VALGRIND_FREYA */

/**
* Chunk size should satisfy the required alignment value
*/
JERRY_STATIC_ASSERT (MEM_HEAP_CHUNK_SIZE % MEM_ALIGNMENT == 0,
MEM_HEAP_CHUNK_SIZE_must_be_multiple_of_MEM_ALIGNMENT);

/* Calculate heap area size, leaving space for a pointer to the free list */
#define MEM_HEAP_AREA_SIZE (MEM_HEAP_SIZE - MEM_ALIGNMENT)
#define MEM_HEAP_END_OF_LIST ((mem_heap_free_t *const) ~((uint32_t) 0x0))
Expand Down Expand Up @@ -551,17 +545,6 @@ mem_heap_free_block_size_stored (void *ptr) /**< pointer to the memory block */
mem_heap_free_block (original_p, original_p->size);
} /* mem_heap_free_block_size_stored */

/**
* Recommend allocation size based on chunk size.
*
* @return recommended allocation size
*/
size_t __attr_pure___
mem_heap_recommend_allocation_size (size_t minimum_allocation_size) /**< minimum allocation size */
{
return JERRY_ALIGNUP (minimum_allocation_size, MEM_HEAP_CHUNK_SIZE);
} /* mem_heap_recommend_allocation_size */

/**
* Compress pointer
*
Expand Down
1 change: 0 additions & 1 deletion jerry-core/mem/mem-heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ extern void mem_heap_free_block_size_stored (void *);
extern uintptr_t mem_heap_compress_pointer (const void *);
extern void *mem_heap_decompress_pointer (uintptr_t);
extern bool mem_is_heap_pointer (const void *);
extern size_t __attr_pure___ mem_heap_recommend_allocation_size (size_t);
extern void mem_heap_print ();

#ifdef MEM_STATS
Expand Down