@@ -807,7 +807,7 @@ static bool parse_function(rbs_parser_t *parser, bool accept_type_binding, parse
807807NODISCARD
808808static bool parse_proc_type (rbs_parser_t * parser , rbs_types_proc_t * * proc ) {
809809 rbs_position_t start = parser -> current_token .range .start ;
810- parse_function_result * result = rbs_allocator_alloc (ALLOCATOR (), parse_function_result );
810+ parse_function_result * result = rbs_alloc (ALLOCATOR (), parse_function_result );
811811 CHECK_PARSE (parse_function (parser , true, & result ));
812812
813813 rbs_position_t end = parser -> current_token .range .end ;
@@ -1472,7 +1472,7 @@ bool rbs_parse_method_type(rbs_parser_t *parser, rbs_method_type_t **method_type
14721472 rbs_range_t type_range ;
14731473 type_range .start = parser -> next_token .range .start ;
14741474
1475- parse_function_result * result = rbs_allocator_alloc (ALLOCATOR (), parse_function_result );
1475+ parse_function_result * result = rbs_alloc (ALLOCATOR (), parse_function_result );
14761476 CHECK_PARSE (parse_function (parser , false, & result ));
14771477
14781478 rg .end = parser -> current_token .range .end ;
@@ -3167,7 +3167,7 @@ static void comment_insert_new_line(rbs_allocator_t *allocator, rbs_comment_t *c
31673167}
31683168
31693169static rbs_comment_t * alloc_comment (rbs_allocator_t * allocator , rbs_token_t comment_token , rbs_comment_t * last_comment ) {
3170- rbs_comment_t * new_comment = rbs_allocator_alloc (allocator , rbs_comment_t );
3170+ rbs_comment_t * new_comment = rbs_alloc (allocator , rbs_comment_t );
31713171
31723172 * new_comment = (rbs_comment_t ) {
31733173 .start = comment_token .range .start ,
@@ -3251,20 +3251,20 @@ bool rbs_parse_type_params(rbs_parser_t *parser, bool module_type_params, rbs_no
32513251}
32523252
32533253id_table * alloc_empty_table (rbs_allocator_t * allocator ) {
3254- id_table * table = rbs_allocator_alloc (allocator , id_table );
3254+ id_table * table = rbs_alloc (allocator , id_table );
32553255
32563256 * table = (id_table ) {
32573257 .size = 10 ,
32583258 .count = 0 ,
3259- .ids = rbs_allocator_calloc (allocator , 10 , rbs_constant_id_t ),
3259+ .ids = rbs_calloc (allocator , 10 , rbs_constant_id_t ),
32603260 .next = NULL ,
32613261 };
32623262
32633263 return table ;
32643264}
32653265
32663266id_table * alloc_reset_table (rbs_allocator_t * allocator ) {
3267- id_table * table = rbs_allocator_alloc (allocator , id_table );
3267+ id_table * table = rbs_alloc (allocator , id_table );
32683268
32693269 * table = (id_table ) {
32703270 .size = 0 ,
@@ -3301,7 +3301,7 @@ bool rbs_parser_insert_typevar(rbs_parser_t *parser, rbs_constant_id_t id) {
33013301 // expand
33023302 rbs_constant_id_t * ptr = table -> ids ;
33033303 table -> size += 10 ;
3304- table -> ids = rbs_allocator_calloc (ALLOCATOR (), table -> size , rbs_constant_id_t );
3304+ table -> ids = rbs_calloc (ALLOCATOR (), table -> size , rbs_constant_id_t );
33053305 memcpy (table -> ids , ptr , sizeof (rbs_constant_id_t ) * table -> count );
33063306 }
33073307
@@ -3363,7 +3363,7 @@ rbs_ast_comment_t *rbs_parser_get_comment(rbs_parser_t *parser, int subject_line
33633363}
33643364
33653365rbs_lexer_t * rbs_lexer_new (rbs_allocator_t * allocator , rbs_string_t string , const rbs_encoding_t * encoding , int start_pos , int end_pos ) {
3366- rbs_lexer_t * lexer = rbs_allocator_alloc (allocator , rbs_lexer_t );
3366+ rbs_lexer_t * lexer = rbs_alloc (allocator , rbs_lexer_t );
33673367
33683368 rbs_position_t start_position = (rbs_position_t ) {
33693369 .byte_pos = 0 ,
@@ -3394,7 +3394,7 @@ rbs_parser_t *rbs_parser_new(rbs_string_t string, const rbs_encoding_t *encoding
33943394 rbs_allocator_t * allocator = rbs_allocator_init ();
33953395
33963396 rbs_lexer_t * lexer = rbs_lexer_new (allocator , string , encoding , start_pos , end_pos );
3397- rbs_parser_t * parser = rbs_allocator_alloc (allocator , rbs_parser_t );
3397+ rbs_parser_t * parser = rbs_alloc (allocator , rbs_parser_t );
33983398
33993399 * parser = (rbs_parser_t ) {
34003400 .rbs_lexer_t = lexer ,
@@ -3455,13 +3455,13 @@ void rbs_parser_set_error(rbs_parser_t *parser, rbs_token_t tok, bool syntax_err
34553455 int length = vsnprintf (NULL , 0 , fmt , args );
34563456 va_end (args );
34573457
3458- char * message = rbs_allocator_alloc_many (ALLOCATOR (), length + 1 , char );
3458+ char * message = rbs_alloc_many (ALLOCATOR (), length + 1 , char );
34593459
34603460 va_start (args , fmt );
34613461 vsnprintf (message , length + 1 , fmt , args );
34623462 va_end (args );
34633463
3464- parser -> error = rbs_allocator_alloc (ALLOCATOR (), rbs_error_t );
3464+ parser -> error = rbs_alloc (ALLOCATOR (), rbs_error_t );
34653465 parser -> error -> token = tok ;
34663466 parser -> error -> message = message ;
34673467 parser -> error -> syntax_error = syntax_error ;
0 commit comments