diff --git a/package/zlib/fastlz.c b/package/zlib/fastlz.c index 3ec76a600..01307e61c 100644 --- a/package/zlib/fastlz.c +++ b/package/zlib/fastlz.c @@ -22,7 +22,7 @@ */ #include "fastlz.h" - +#include "PikaObj.h" #include #pragma GCC diagnostic push @@ -232,7 +232,8 @@ int fastlz1_compress(const void* input, int length, void* output) { const uint8_t* ip_limit = ip + length - 12 - 1; uint8_t* op = (uint8_t*)output; - uint32_t htab[HASH_SIZE]; + // uint32_t htab[HASH_SIZE]; + uint32_t* htab = (uint32_t*)pikaMalloc(sizeof(uint32_t) * HASH_SIZE); uint32_t seq, hash; /* initializes hash table */ @@ -289,6 +290,7 @@ int fastlz1_compress(const void* input, int length, void* output) { uint32_t copy = (uint8_t*)input + length - anchor; op = flz_literals(copy, anchor, op); + pikaFree(htab, sizeof(uint32_t) * HASH_SIZE); return op - (uint8_t*)output; } @@ -377,7 +379,8 @@ int fastlz2_compress(const void* input, int length, void* output) { const uint8_t* ip_limit = ip + length - 12 - 1; uint8_t* op = (uint8_t*)output; - uint32_t htab[HASH_SIZE]; + // uint32_t htab[HASH_SIZE]; + uint32_t* htab = (uint32_t*)pikaMalloc(sizeof(uint32_t) * HASH_SIZE); uint32_t seq, hash; /* initializes hash table */ @@ -446,6 +449,7 @@ int fastlz2_compress(const void* input, int length, void* output) { /* marker for fastlz2 */ *(uint8_t*)output |= (1 << 5); + pikaFree(htab, sizeof(uint32_t) * HASH_SIZE); return op - (uint8_t*)output; } diff --git a/port/linux/package/pikascript/pikascript-lib/zlib/fastlz.c b/port/linux/package/pikascript/pikascript-lib/zlib/fastlz.c index 3ec76a600..01307e61c 100644 --- a/port/linux/package/pikascript/pikascript-lib/zlib/fastlz.c +++ b/port/linux/package/pikascript/pikascript-lib/zlib/fastlz.c @@ -22,7 +22,7 @@ */ #include "fastlz.h" - +#include "PikaObj.h" #include #pragma GCC diagnostic push @@ -232,7 +232,8 @@ int fastlz1_compress(const void* input, int length, void* output) { const uint8_t* ip_limit = ip + length - 12 - 1; uint8_t* op = (uint8_t*)output; - uint32_t htab[HASH_SIZE]; + // uint32_t htab[HASH_SIZE]; + uint32_t* htab = (uint32_t*)pikaMalloc(sizeof(uint32_t) * HASH_SIZE); uint32_t seq, hash; /* initializes hash table */ @@ -289,6 +290,7 @@ int fastlz1_compress(const void* input, int length, void* output) { uint32_t copy = (uint8_t*)input + length - anchor; op = flz_literals(copy, anchor, op); + pikaFree(htab, sizeof(uint32_t) * HASH_SIZE); return op - (uint8_t*)output; } @@ -377,7 +379,8 @@ int fastlz2_compress(const void* input, int length, void* output) { const uint8_t* ip_limit = ip + length - 12 - 1; uint8_t* op = (uint8_t*)output; - uint32_t htab[HASH_SIZE]; + // uint32_t htab[HASH_SIZE]; + uint32_t* htab = (uint32_t*)pikaMalloc(sizeof(uint32_t) * HASH_SIZE); uint32_t seq, hash; /* initializes hash table */ @@ -446,6 +449,7 @@ int fastlz2_compress(const void* input, int length, void* output) { /* marker for fastlz2 */ *(uint8_t*)output |= (1 << 5); + pikaFree(htab, sizeof(uint32_t) * HASH_SIZE); return op - (uint8_t*)output; } diff --git a/port/linux/test/python/socket/socket_GET.py b/port/linux/test/python/socket/socket_GET.py index 7fb48576f..78323a97d 100644 --- a/port/linux/test/python/socket/socket_GET.py +++ b/port/linux/test/python/socket/socket_GET.py @@ -5,13 +5,13 @@ def test_socket_GET(): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # 获取服务器的IP地址 - server_ip = socket.gethostbyname('baidu.com') + # server_ip = socket.gethostbyname('baidu.com') server_port = 80 # 连接到服务器 - s.connect((server_ip, server_port)) + s.connect(('pikapython.com', server_port)) # 创建HTTP GET请求 - request = 'GET / HTTP/1.1\r\nHost: baidu.com\r\n\r\n' + request = 'GET / HTTP/1.1\r\nHost: pikascript.com\r\n\r\n' # print('request:', request) s.send(request.encode()) @@ -29,7 +29,9 @@ def test_socket_GET(): return response for i in range(10): - res = 'HTTP/1.1 200 OK' in test_socket_GET() + response = test_socket_GET() + res = 'HTTP/1.1' in response if res == True: break print('test_socket_GET() failed, retrying...') + print('response', response) diff --git a/src/PikaVersion.h b/src/PikaVersion.h index d0df82d9f..6f465b25a 100644 --- a/src/PikaVersion.h +++ b/src/PikaVersion.h @@ -2,4 +2,4 @@ #define PIKA_VERSION_MINOR 12 #define PIKA_VERSION_MICRO 4 -#define PIKA_EDIT_TIME "2023/07/26 17:08:07" +#define PIKA_EDIT_TIME "2023/07/26 22:10:04" diff --git a/tools/pikaByteCodeGen/main.c b/tools/pikaByteCodeGen/main.c index 640645f92..cc0c61934 100644 --- a/tools/pikaByteCodeGen/main.c +++ b/tools/pikaByteCodeGen/main.c @@ -145,7 +145,7 @@ static int _do_main(int argc, char **argv) { char *file_out_name = strsAppend(&buffs, file_name_no_ext, ".md"); printf("file_out_name: %s\r\n", file_out_name); char *file_out_path = strsPathJoin(&buffs, file_folder, file_out_name); - Parser *parser = New_parser(); + Parser *parser = parser_create(); printf("generating doc %s: %s\r\n", file_path, file_out_path); parser_file2DocFile(parser, file_path, file_out_path); strsDeinit(&buffs); @@ -160,7 +160,7 @@ static int _do_main(int argc, char **argv) { Args buffs = {0}; char *file_path = argv[2]; char *file_out_path = argv[4]; - Parser *parser = New_parser(); + Parser *parser = parser_create(); printf("generating doc %s: %s\r\n", file_path, file_out_path); parser_file2DocFile(parser, file_path, file_out_path); strsDeinit(&buffs); diff --git a/tools/pikaCompiler/rust-msc-latest-win10.exe b/tools/pikaCompiler/rust-msc-latest-win10.exe index 8993ea36a..73b2f09e3 100644 Binary files a/tools/pikaCompiler/rust-msc-latest-win10.exe and b/tools/pikaCompiler/rust-msc-latest-win10.exe differ