Lower inital memory allocation amounts. (Lower latency iteration for running generator)

I need to change it so that they all use one big arena allocation for the initial. This can be done when the global allocator is changed to a growable arena.
This commit is contained in:
Edward R. Gonzalez 2023-08-21 23:49:23 -04:00
parent a42e241afb
commit d0c995893d
3 changed files with 19 additions and 19 deletions

View File

@ -5,10 +5,10 @@
#pragma region Constants #pragma region Constants
#ifndef GEN_GLOBAL_BUCKET_SIZE #ifndef GEN_GLOBAL_BUCKET_SIZE
# define GEN_GLOBAL_BUCKET_SIZE megabytes(10) # define GEN_GLOBAL_BUCKET_SIZE megabytes(4)
#endif #endif
#ifndef GEN_CODEPOOL_NUM_BLOCKS #ifndef GEN_CODEPOOL_NUM_BLOCKS
# define GEN_CODEPOOL_NUM_BLOCKS kilobytes(64) # define GEN_CODEPOOL_NUM_BLOCKS kilobytes(16)
#endif #endif
#ifndef GEN_SIZE_PER_STRING_ARENA #ifndef GEN_SIZE_PER_STRING_ARENA
# define GEN_SIZE_PER_STRING_ARENA megabytes(1) # define GEN_SIZE_PER_STRING_ARENA megabytes(1)
@ -26,7 +26,7 @@
# define GEN_TOKEN_FMT_TOKEN_MAP_MEM_SIZE kilobytes(4) # define GEN_TOKEN_FMT_TOKEN_MAP_MEM_SIZE kilobytes(4)
#endif #endif
#ifndef GEN_LEX_ALLOCATOR_SIZE #ifndef GEN_LEX_ALLOCATOR_SIZE
# define GEN_LEX_ALLOCATOR_SIZE megabytes(10) # define GEN_LEX_ALLOCATOR_SIZE megabytes(4)
#endif #endif
#ifndef GEN_BUILDER_STR_BUFFER_RESERVE #ifndef GEN_BUILDER_STR_BUFFER_RESERVE
# define GEN_BUILDER_STR_BUFFER_RESERVE megabytes(1) # define GEN_BUILDER_STR_BUFFER_RESERVE megabytes(1)

View File

@ -229,6 +229,7 @@ namespace Parser
global Array<Token> Tokens; global Array<Token> Tokens;
neverinline
TokArray lex( StrC content ) TokArray lex( StrC content )
{ {
# define current ( * scanner ) # define current ( * scanner )
@ -1155,7 +1156,7 @@ internal CodeUsing parse_using ();
constexpr bool inplace_def = true; constexpr bool inplace_def = true;
internal inline internal
CodeComment parse_comment() CodeComment parse_comment()
{ {
using namespace Parser; using namespace Parser;
@ -1214,7 +1215,7 @@ CodeDefine parse_define()
return define; return define;
} }
internal inline internal
CodePreprocessCond parse_preprocess_cond() CodePreprocessCond parse_preprocess_cond()
{ {
using namespace Parser; using namespace Parser;
@ -1247,7 +1248,7 @@ CodePreprocessCond parse_preprocess_cond()
return cond; return cond;
} }
internal inline internal
CodeInclude parse_include() CodeInclude parse_include()
{ {
using namespace Parser; using namespace Parser;
@ -1273,7 +1274,7 @@ CodeInclude parse_include()
return include; return include;
} }
internal inline internal
CodePragma parse_pragma() CodePragma parse_pragma()
{ {
using namespace Parser; using namespace Parser;
@ -1299,7 +1300,7 @@ CodePragma parse_pragma()
return pragma; return pragma;
} }
internal inline internal
Code parse_static_assert() Code parse_static_assert()
{ {
using namespace Parser; using namespace Parser;
@ -1340,7 +1341,7 @@ Code parse_static_assert()
return assert; return assert;
} }
internal inline internal
Code parse_array_decl() Code parse_array_decl()
{ {
using namespace Parser; using namespace Parser;
@ -1478,7 +1479,7 @@ CodeAttributes parse_attributes()
return { nullptr }; return { nullptr };
} }
internal inline internal
Parser::Token parse_identifier() Parser::Token parse_identifier()
{ {
using namespace Parser; using namespace Parser;
@ -1572,7 +1573,7 @@ Parser::Token parse_identifier()
return name; return name;
} }
internal internal inline
CodeParam parse_params( bool use_template_capture = false ) CodeParam parse_params( bool use_template_capture = false )
{ {
using namespace Parser; using namespace Parser;
@ -1836,7 +1837,7 @@ CodeFn parse_function_after_name(
return result; return result;
} }
internal inline internal
CodeOperator parse_operator_after_ret_type( CodeOperator parse_operator_after_ret_type(
ModuleFlag mflags ModuleFlag mflags
, CodeAttributes attributes , CodeAttributes attributes
@ -2122,7 +2123,7 @@ CodeOperator parse_operator_after_ret_type(
} }
// Variable parsing is handled in multiple places because its initial signature is shared with function parsing // Variable parsing is handled in multiple places because its initial signature is shared with function parsing
internal inline internal
CodeVar parse_variable_after_name( CodeVar parse_variable_after_name(
ModuleFlag mflags ModuleFlag mflags
, CodeAttributes attributes , CodeAttributes attributes
@ -2296,7 +2297,7 @@ Code parse_simple_preprocess( Parser::TokType which )
return result; return result;
} }
internal inline internal
Code parse_operator_function_or_variable( bool expects_function, CodeAttributes attributes, CodeSpecifiers specifiers ) Code parse_operator_function_or_variable( bool expects_function, CodeAttributes attributes, CodeSpecifiers specifiers )
{ {
using namespace Parser; using namespace Parser;
@ -2418,7 +2419,7 @@ Code parse_foward_or_definition( Parser::TokType which, bool is_inplace )
return CodeInvalid; return CodeInvalid;
} }
internal inline internal
Code parse_complicated_definition( Parser::TokType which ) Code parse_complicated_definition( Parser::TokType which )
{ {
using namespace Parser; using namespace Parser;
@ -2511,7 +2512,7 @@ Code parse_complicated_definition( Parser::TokType which )
} }
} }
internal internal neverinline
CodeBody parse_class_struct_body( Parser::TokType which, Parser::Token name = Parser::NullToken ) CodeBody parse_class_struct_body( Parser::TokType which, Parser::Token name = Parser::NullToken )
{ {
using namespace Parser; using namespace Parser;
@ -2909,7 +2910,7 @@ Code parse_function_body()
return result; return result;
} }
internal internal neverinline
CodeBody parse_global_nspace( CodeT which ) CodeBody parse_global_nspace( CodeT which )
{ {
using namespace Parser; using namespace Parser;
@ -4559,7 +4560,7 @@ CodeTypedef parse_typedef( StrC def )
return parse_typedef(); return parse_typedef();
} }
internal internal neverinline
CodeUnion parse_union( bool inplace_def ) CodeUnion parse_union( bool inplace_def )
{ {
using namespace Parser; using namespace Parser;

View File

@ -10,7 +10,6 @@ enum class OpValidateResult : u32
Member Member
}; };
inline
OpValidateResult operator__validate( OperatorT op, CodeParam params_code, CodeType ret_type, CodeSpecifiers specifier ) OpValidateResult operator__validate( OperatorT op, CodeParam params_code, CodeType ret_type, CodeSpecifiers specifier )
{ {
using namespace EOperator; using namespace EOperator;