Skip to content

Commit

Permalink
fixed the comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmdis1999 committed Mar 26, 2024
1 parent 60dca65 commit 1dee9a9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/lyk.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,12 @@ void set_location(Proto *f, int i) {

inline void yk_on_instruction_loaded(Proto *f, Instruction i, int idx) {
if (f->yklocs == NULL) {
// If the locations haven't been initialized, allocate the array using
// calloc
// Allocate initial array
f->yklocs = calloc(f->sizecode, sizeof(YkLocation *));
lua_assert(f->yklocs != NULL && "Expected yklocs to be defined!");
f->yklocs_size = f->sizecode;
} else if (f->sizecode > f->yklocs_size) {
// If the size of yklocs needs to be changed, reallocate the array using
// realloc
// Extend the array
YkLocation **new_locations =
realloc(f->yklocs, f->sizecode * sizeof(YkLocation *));
lua_assert(new_locations != NULL && "Expected yklocs to be defined!");
Expand Down

0 comments on commit 1dee9a9

Please sign in to comment.