mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
high speed can run in small ram
This commit is contained in:
parent
0fb2eb9892
commit
4bfd926ec1
0
port/linux/api-make-linux.sh
Normal file → Executable file
0
port/linux/api-make-linux.sh
Normal file → Executable file
0
port/linux/api-make-win10.sh
Normal file → Executable file
0
port/linux/api-make-win10.sh
Normal file → Executable file
0
port/linux/api-make.sh
Normal file → Executable file
0
port/linux/api-make.sh
Normal file → Executable file
0
port/linux/gtest.sh
Normal file → Executable file
0
port/linux/gtest.sh
Normal file → Executable file
0
port/linux/init.sh
Normal file → Executable file
0
port/linux/init.sh
Normal file → Executable file
0
port/linux/make.sh
Normal file → Executable file
0
port/linux/make.sh
Normal file → Executable file
0
port/linux/package/pikascript/rust-msc-latest-linux
Normal file → Executable file
0
port/linux/package/pikascript/rust-msc-latest-linux
Normal file → Executable file
0
port/linux/pull-core.sh
Normal file → Executable file
0
port/linux/pull-core.sh
Normal file → Executable file
0
port/linux/push-core.sh
Normal file → Executable file
0
port/linux/push-core.sh
Normal file → Executable file
0
port/linux/test-banchmark.sh
Normal file → Executable file
0
port/linux/test-banchmark.sh
Normal file → Executable file
@ -1,5 +1,6 @@
|
||||
#include "dataMemory.h"
|
||||
|
||||
#define use_mem_pool 1
|
||||
#define pika_aline 8
|
||||
#define pika_pool_size 8192
|
||||
uint8_t pika_bitmap[pika_pool_size / pika_aline / 8] = {0};
|
||||
@ -8,7 +9,6 @@ Pool pikaPool = {.aline = pika_aline,
|
||||
.bitmap = pika_bitmap,
|
||||
.mem = pika_pool_mem,
|
||||
.size = pika_pool_size};
|
||||
#define use_mem_pool 1
|
||||
#if use_mem_pool
|
||||
void* __impl_pikaMalloc(size_t size) {
|
||||
void* mem = pool_malloc(&pikaPool, size);
|
||||
|
0
port/linux/update-compiler.sh
Normal file → Executable file
0
port/linux/update-compiler.sh
Normal file → Executable file
@ -205,7 +205,17 @@ void pool_free(Pool* pool, void* mem, uint32_t size) {
|
||||
/* save last free block index to add speed */
|
||||
uint32_t block_end = block_index + block_num - 1;
|
||||
if (block_end == pool->purl_free_block_start - 1) {
|
||||
pool->purl_free_block_start = block_index;
|
||||
uint32_t first_pure_free_block = block_index;
|
||||
/* back to first used block */
|
||||
if (0 != first_pure_free_block) {
|
||||
while (0 == bitmap_get(pool->bitmap, first_pure_free_block - 1)) {
|
||||
first_pure_free_block--;
|
||||
if (0 == first_pure_free_block) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
pool->purl_free_block_start = first_pure_free_block;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user