diff --git a/conanfile.py b/conanfile.py index fcb7c2c..61f59d3 100644 --- a/conanfile.py +++ b/conanfile.py @@ -16,12 +16,15 @@ class ArgonConan(ConanFile): # Remove tool_requires, no flex from Conan requires = [ "gmp/6.3.0", - "bdwgc/8.2.8" + "bdwgc/8.2.6" ] default_options = { "gmp/*:shared": False, - "bdwgc/*:shared": False + "bdwgc/*:shared": False, + "bdwgc/*:parallel_mark": False, + "bdwgc/*:threads": True, + "bdwgc/*:disable_debug": True, } def layout(self): diff --git a/src/runtime/internals/hashmap/hashmap.c b/src/runtime/internals/hashmap/hashmap.c index 6ec84f2..397178a 100644 --- a/src/runtime/internals/hashmap/hashmap.c +++ b/src/runtime/internals/hashmap/hashmap.c @@ -27,13 +27,15 @@ struct hashmap_GC *createHashmap_GC() { } static int compare_node_asc(const void *a, const void *b) { - const struct node_GC *na = (const struct node_GC *)a; - const struct node_GC *nb = (const struct node_GC *)b; + const struct node_GC *na = (const struct node_GC *)a; + const struct node_GC *nb = (const struct node_GC *)b; - // Ascending order (smallest order first) - if (na->order < nb->order) return -1; - if (na->order > nb->order) return 1; - return 0; + // Ascending order (smallest order first) + if (na->order < nb->order) + return -1; + if (na->order > nb->order) + return 1; + return 0; } void hashmap_GC_to_array(struct hashmap_GC *t, struct node_GC **array, @@ -51,13 +53,16 @@ void hashmap_GC_to_array(struct hashmap_GC *t, struct node_GC **array, } for (size_t i = 0; i < t->size; i++) { - if (!t->list[i]) - continue; if (*array_length >= array_size) { array_size *= 2; *array = ar_realloc(*array, array_size * sizeof(struct node_GC)); } - (*array)[(*array_length)++] = *t->list[i]; + struct node_GC *list = t->list[i]; + struct node_GC *temp = list; + while (temp) { + (*array)[(*array_length)++] = *t->list[i]; + temp = temp->next; + } } qsort(*array, *array_length, sizeof(struct node_GC), compare_node_asc); diff --git a/tests/anonymous_function.ar b/tests/anonymous_function.ar index d5540ac..9ddfe45 100644 --- a/tests/anonymous_function.ar +++ b/tests/anonymous_function.ar @@ -1,64 +1,3 @@ -let knownContentTypes = {} -knownContentTypes["html"] = "text/html" -knownContentTypes["css"] = "text/css" -knownContentTypes["js"] = "application/javascript" -knownContentTypes["json"] = "application/json" -knownContentTypes["png"] = "image/png" -knownContentTypes["jpg"] = "image/jpeg" -knownContentTypes["jpeg"] = "image/jpeg" -knownContentTypes["gif"] = "image/gif" -knownContentTypes["svg"] = "image/svg+xml" -knownContentTypes["ico"] = "image/x-icon" -knownContentTypes["txt"] = "text/plain" -knownContentTypes["md"] = "text/markdown" -knownContentTypes["xml"] = "application/xml" -knownContentTypes["pdf"] = "application/pdf" -knownContentTypes["zip"] = "application/zip" -knownContentTypes["gz"] = "application/gzip" -knownContentTypes["tar"] = "application/x-tar" -knownContentTypes["ogg"] = "audio/ogg" -knownContentTypes["mp3"] = "audio/mpeg" -knownContentTypes["mp4"] = "video/mp4" -knownContentTypes["webm"] = "video/webm" -knownContentTypes["webp"] = "image/webp" -knownContentTypes["woff"] = "font/woff" -knownContentTypes["woff2"] = "font/woff2" -knownContentTypes["ttf"] = "font/ttf" -knownContentTypes["otf"] = "font/otf" -knownContentTypes["eot"] = "application/vnd.ms-fontobject" -knownContentTypes["sfnt"] = "application/font-sfnt" -knownContentTypes["wasm"] = "application/wasm" -knownContentTypes["csv"] = "text/csv" -knownContentTypes["tsv"] = "text/tab-separated-values" -knownContentTypes["rtf"] = "application/rtf" -knownContentTypes["7z"] = "application/x-7z-compressed" -knownContentTypes["rar"] = "application/x-rar-compressed" -knownContentTypes["bz"] = "application/x-bzip" -knownContentTypes["bz2"] = "application/x-bzip2" -knownContentTypes["xz"] = "application/x-xz" -knownContentTypes["exe"] = "application/x-msdownload" -knownContentTypes["swf"] = "application/x-shockwave-flash" -knownContentTypes["flv"] = "video/x-flv" -knownContentTypes["wmv"] = "video/x-ms-wmv" -knownContentTypes["avi"] = "video/x-msvideo" -knownContentTypes["mpg"] = "video/mpeg" -knownContentTypes["mpeg"] = "video/mpeg" -knownContentTypes["mov"] = "video/quicktime" -knownContentTypes["weba"] = "audio/webm" -knownContentTypes["wav"] = "audio/wav" -knownContentTypes["flac"] = "audio/flac" -knownContentTypes["midi"] = "audio/midi" -knownContentTypes["mid"] = "audio/midi" -knownContentTypes["m4a"] = "audio/m4a" -knownContentTypes["m4v"] = "video/m4v" -knownContentTypes["3gp"] = "video/3gpp" -knownContentTypes["3g2"] = "video/3gpp2" -knownContentTypes["ogv"] = "video/ogg" -knownContentTypes["m3u8"] = "application/vnd.apple.mpegurl" -knownContentTypes["ts"] = "video/mp2t" -knownContentTypes["flv"] = "video/x-flv" -knownContentTypes["wmv"] = "video/x-ms-wmv" - term.log(()=10) term.log((x)=10) term.log((x,y)=10) diff --git a/tests/hashmap_order.ar b/tests/hashmap_order.ar index ec4bb79..65f57e7 100644 --- a/tests/hashmap_order.ar +++ b/tests/hashmap_order.ar @@ -1,4 +1,4 @@ -x = {} +let x = {'p':1} x.z = 1 x.b = 2 x.c = 3