change workflow to support other plateforms
This commit is contained in:
@@ -36,8 +36,7 @@ void darray_armem_resize(darray_armem *arr, size_t new_size) {
|
||||
}
|
||||
|
||||
size_t required_bytes = new_size * arr->element_size;
|
||||
size_t new_capacity_bytes =
|
||||
((required_bytes + CHUNK_SIZE - 1) / CHUNK_SIZE) * CHUNK_SIZE;
|
||||
size_t new_capacity_bytes =required_bytes*2;
|
||||
size_t new_capacity = new_capacity_bytes / arr->element_size;
|
||||
|
||||
if (!new_capacity) {
|
||||
|
||||
@@ -10,12 +10,14 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "string.h"
|
||||
#include "../number/number.h"
|
||||
|
||||
ArgonObject *ARGON_STRING_TYPE = NULL;
|
||||
|
||||
ArgonObject *new_string_object(char*data, size_t length) {
|
||||
ArgonObject * object = new_object();
|
||||
add_field(object, "__class__", ARGON_STRING_TYPE);
|
||||
add_field(object, "length", new_number_object_from_long(length, 1));
|
||||
object->type = TYPE_STRING;
|
||||
object->value.as_str.data = ar_alloc_atomic(length);
|
||||
memcpy(object->value.as_str.data, data, length);
|
||||
|
||||
Reference in New Issue
Block a user