Yet another fix of typos (#128)

This commit is contained in:
Derick Alangi 2021-06-24 12:17:54 +01:00 committed by GitHub
parent 273fbafa09
commit c1cde4c69b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -133,7 +133,7 @@ void markObject(PKVM* vm, Object* self) {
self->is_marked = true; self->is_marked = true;
// Add the object to the VM's working_set so that we can recursively mark // Add the object to the VM's working_set so that we can recursively mark
// it's referenced objects later. // its referenced objects later.
if (vm->working_set_count >= vm->working_set_capacity) { if (vm->working_set_count >= vm->working_set_capacity) {
vm->working_set_capacity *= 2; vm->working_set_capacity *= 2;
vm->working_set = (Object**)vm->config.realloc_fn( vm->working_set = (Object**)vm->config.realloc_fn(
@ -213,7 +213,7 @@ static void popMarkedObjectsInternal(Object* obj, PKVM* vm) {
markVarBuffer(vm, &scr->globals); markVarBuffer(vm, &scr->globals);
vm->bytes_allocated += sizeof(Var) * scr->globals.capacity; vm->bytes_allocated += sizeof(Var) * scr->globals.capacity;
// Integer buffer have no gray call. // Integer buffer has no gray call.
vm->bytes_allocated += sizeof(uint32_t) * scr->global_names.capacity; vm->bytes_allocated += sizeof(uint32_t) * scr->global_names.capacity;
markVarBuffer(vm, &scr->literals); markVarBuffer(vm, &scr->literals);
@ -450,8 +450,9 @@ Fiber* newFiber(PKVM* vm, Function* fn) {
fiber->func = fn; fiber->func = fn;
if (fn->is_native) { if (fn->is_native) {
// For native functions we're only using stack for parameters, there wont // For native functions, we're only using stack for parameters,
// be any locals or temps (which are belongs to the native "C" stack). // there won't be any locals or temps (which are belongs to the
// native "C" stack).
int stack_size = utilPowerOf2Ceil(fn->arity + 1); int stack_size = utilPowerOf2Ceil(fn->arity + 1);
fiber->stack = ALLOCATE_ARRAY(vm, Var, stack_size); fiber->stack = ALLOCATE_ARRAY(vm, Var, stack_size);
fiber->stack_size = stack_size; fiber->stack_size = stack_size;
@ -571,7 +572,7 @@ List* rangeAsList(PKVM* vm, Range* self) {
} }
String* stringLower(PKVM* vm, String* self) { String* stringLower(PKVM* vm, String* self) {
// If the string itself is already lower don't allocate new string. // If the string itself is already lower, don't allocate new string.
uint32_t index = 0; uint32_t index = 0;
for (const char* c = self->data; *c != '\0'; c++, index++) { for (const char* c = self->data; *c != '\0'; c++, index++) {
if (isupper(*c)) { if (isupper(*c)) {
@ -774,7 +775,7 @@ List* listJoin(PKVM* vm, List* l1, List* l2) {
return list; return list;
} }
// Return a has value for the object. // Return a hash value for the object.
static uint32_t _hashObject(Object* obj) { static uint32_t _hashObject(Object* obj) {
ASSERT(isObjectHashable(obj->type), ASSERT(isObjectHashable(obj->type),