most of the work towards 4.0.20

master
Allen Webster 2017-05-27 16:04:13 -04:00
parent 1056f80681
commit aba967065d
18 changed files with 200 additions and 154 deletions

View File

@ -634,8 +634,8 @@ config_array_good(Config_Array_Reader *array_reader){
static void
lexer_keywords_default_init(Partition *part, Cpp_Keyword_Table *kw_out, Cpp_Keyword_Table *pp_out){
size_t kw_size = cpp_get_table_memory_size_default(CPP_TABLE_KEYWORDS);
size_t pp_size = cpp_get_table_memory_size_default(CPP_TABLE_PREPROCESSOR_DIRECTIVES);
umem_4tech kw_size = cpp_get_table_memory_size_default(CPP_TABLE_KEYWORDS);
umem_4tech pp_size = cpp_get_table_memory_size_default(CPP_TABLE_PREPROCESSOR_DIRECTIVES);
void *kw_mem = push_block(part, (i32_4tech)kw_size);
void *pp_mem = push_block(part, (i32_4tech)pp_size);

View File

@ -13,6 +13,8 @@ TYPE: 'major-system-include'
#include "4coder_helper/4coder_jump_parsing.h"
#define FCODER_JUMP_COMMANDS
#include "4coder_default_framework.h"
#include "4coder_base_commands.cpp"
#include "4coder_auto_indent.cpp"
@ -25,6 +27,9 @@ TYPE: 'major-system-include'
#include "4coder_default_hooks.cpp"
#include "4coder_function_list.cpp"
#undef FCODER_JUMP_COMMANDS
#include "4coder_sticky_jump.cpp"
#include "4coder_helper/4coder_bind_helper.h"
#include "4coder_helper/4coder_helper.h"
#include "4coder_helper/4coder_streaming.h"

View File

@ -26,7 +26,11 @@ typedef uint16_t u16_4tech;
typedef uint32_t u32_4tech;
typedef uint64_t u64_4tech;
#if defined(FTECH_32_BIT)
typedef u32_4tech umem_4tech;
#else
typedef u64_4tech umem_4tech;
#endif
typedef float f32_4tech;
typedef double f64_4tech;

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,11 @@ typedef uint16_t u16_4tech;
typedef uint32_t u32_4tech;
typedef uint64_t u64_4tech;
#if defined(FTECH_32_BIT)
typedef u32_4tech umem_4tech;
#else
typedef u64_4tech umem_4tech;
#endif
typedef float f32_4tech;
typedef double f64_4tech;

View File

@ -26,7 +26,11 @@ typedef uint16_t u16_4tech;
typedef uint32_t u32_4tech;
typedef uint64_t u64_4tech;
#if defined(FTECH_32_BIT)
typedef u32_4tech umem_4tech;
#else
typedef u64_4tech umem_4tech;
#endif
typedef float f32_4tech;
typedef double f64_4tech;

View File

@ -26,7 +26,11 @@ typedef uint16_t u16_4tech;
typedef uint32_t u32_4tech;
typedef uint64_t u64_4tech;
#if defined(FTECH_32_BIT)
typedef u32_4tech umem_4tech;
#else
typedef u64_4tech umem_4tech;
#endif
typedef float f32_4tech;
typedef double f64_4tech;
@ -1774,8 +1778,8 @@ DOC_SEE(cpp_make_token_array)
umem_4tech keywords_memsize = cpp_get_table_memory_size_default(CPP_TABLE_KEYWORDS);
umem_4tech preprocessor_words_memsize = cpp_get_table_memory_size_default(CPP_TABLE_PREPROCESSOR_DIRECTIVES);
void *keywords_mem = malloc(keywords_memsize);
void *preprocessor_words_mem = malloc(preprocessor_words_memsize);
void *keywords_mem = malloc((size_t)keywords_memsize);
void *preprocessor_words_mem = malloc((size_t)preprocessor_words_memsize);
Cpp_Keyword_Table keywords = cpp_make_table_default(CPP_TABLE_KEYWORDS, keywords_mem, keywords_memsize);
Cpp_Keyword_Table preprocessor_words = cpp_make_table_default(CPP_TABLE_PREPROCESSOR_DIRECTIVES, preprocessor_words_mem, preprocessor_words_memsize);

View File

@ -476,12 +476,15 @@ internal_get_buffer_first(Working_Set *working_set, Buffer_Summary *buffer){
internal void
internal_get_buffer_next(Working_Set *working_set, Buffer_Summary *buffer){
Editing_File *file;
file = working_set_get_active_file(working_set, buffer->buffer_id);
Editing_File *file = working_set_get_active_file(working_set, buffer->buffer_id);
if (file){
file = (Editing_File*)file->node.next;
fill_buffer_summary(buffer, file, working_set);
if (file != (Editing_File*)&working_set->used_sentinel){
fill_buffer_summary(buffer, file, working_set);
}
else{
*buffer = null_buffer_summary;
}
}
else{
*buffer = null_buffer_summary;

View File

@ -22,7 +22,7 @@
#include "4ed_system.h"
#include "4ed_profile.h"
//#define USE_DEBUG_MEMORY
#define USE_DEBUG_MEMORY
#define FSTRING_IMPLEMENTATION
#define FSTRING_C

View File

@ -31,17 +31,17 @@ debug_gm_open(System_Functions *system, Debug_GM *general, void *memory, i32 siz
static void*
debug_gm_allocate(Debug_GM *general, int32_t size){
System_Functions *system = general->system;
persist u32 round_val = OS_PAGE_SIZE-1;
local_persist u32 round_val = OS_PAGE_SIZE-1;
size = (size + round_val) & (~round_val);
void *result = system->memory_allocate(0, size + OS_PAGE_SIZE);
system->memory_set_protection(0, (u8*)result + size, OS_PAGE_SIZE, 0);
void *result = system->memory_allocate(size + OS_PAGE_SIZE);
system->memory_set_protection((u8*)result + size, OS_PAGE_SIZE, 0);
return(result);
}
static void
debug_gm_free(Debug_GM *general, void *memory){
System_Functions *system = general->system;
system->memory_free(0, memory, 0);
system->memory_free(memory, 0);
}
static void*

View File

@ -995,6 +995,7 @@ struct Code_Wrap_State{
Code_Wrap_X plane_wrap_x;
i32 *line_starts;
i32 line_count;
i32 line_index;
i32 next_line_start;
@ -1023,6 +1024,7 @@ wrap_state_init(System_Functions *system, Code_Wrap_State *state, Editing_File *
state->end_token = state->token_ptr + state->token_array.count;
state->line_starts = file->state.buffer.line_starts;
state->line_count = file->state.buffer.line_count;
state->next_line_start = state->line_starts[1];
Gap_Buffer *buffer = &file->state.buffer;
@ -1102,9 +1104,17 @@ wrap_state_consume_token(System_Functions *system, Render_Font *font, Code_Wrap_
}
// TODO(allen): exponential search this shit!
while (i >= state->next_line_start){
++state->line_index;
state->next_line_start = state->line_starts[state->line_index + 1];
for (;i >= state->next_line_start;){
state->next_line_start = state->size;
if (state->line_index < state->line_count){
++state->line_index;
if (state->line_index + 1 < state->line_count){
state->next_line_start = state->line_starts[state->line_index + 1];
}
}
else{
break;
}
}
i32 line_start = state->line_starts[state->line_index];
@ -1220,6 +1230,9 @@ wrap_state_consume_token(System_Functions *system, Render_Font *font, Code_Wrap_
}
++state->token_ptr;
if (state->token_ptr > state->end_token){
state->token_ptr = state->end_token;
}
}
result.position_end = state->i;
@ -2125,7 +2138,7 @@ Job_Callback_Sig(job_full_lex){
Gap_Buffer *buffer = &file->state.buffer;
i32 text_size = buffer_size(buffer);
i32 aligned_buffer_size = (text_size + 3)&(~3);
u32 aligned_buffer_size = (text_size + 3)&(~3);
for (;memory->size < aligned_buffer_size + parse_context.memory_size;){
void *old_base = memory->data;
@ -2189,8 +2202,7 @@ Job_Callback_Sig(job_full_lex){
data_size -= parse_context.memory_size;
tokens.tokens = (Cpp_Token*)(data_ptr);
tokens.max_count = (u32)(data_size / sizeof(Cpp_Token));
}
break;
}break;
case LexResult_HitTokenLimit:
{

Binary file not shown.

View File

@ -136,8 +136,8 @@ enum Thread_Group_ID{
struct Thread_Memory{
void *data;
i32 size;
i32 id;
u32 size;
u32 id;
};
global Thread_Memory null_thread_memory = {0};

View File

@ -485,8 +485,9 @@ static void
standard_build(char *cdir, u32 flags){
fsm_generator(cdir);
metagen(cdir);
do_buildsuper(cdir, Custom_Default, flags);
//do_buildsuper(cdir, Custom_Experiments, flags);
do_buildsuper(cdir, Custom_Casey, flags);
//do_buildsuper(cdir, Custom_Casey, flags);
//do_buildsuper(cdir, Custom_ChronalVim, flags);
build_main(cdir, flags);
}

View File

@ -21,7 +21,11 @@ typedef uint16_t u16_4tech;
typedef uint32_t u32_4tech;
typedef uint64_t u64_4tech;
#if defined(FTECH_32_BIT)
typedef u32_4tech umem_4tech;
#else
typedef u64_4tech umem_4tech;
#endif
typedef float f32_4tech;
typedef double f64_4tech;

View File

@ -9,11 +9,8 @@ TYPE: 'build-target'
#if !defined(FCODER_EXPERIMENTS_CPP)
#define FCODER_EXPERIMENTS_CPP
#define FCODER_JUMP_COMMANDS
#include "4coder_default_include.cpp"
#include "4coder_miblo_numbers.cpp"
#undef FCODER_JUMP_COMMANDS
#include "4coder_sticky_jump.cpp"
#define NO_BINDING
#include "4coder_default_bindings.cpp"

View File

@ -12,7 +12,11 @@ typedef uint16_t u16_4tech;
typedef uint32_t u32_4tech;
typedef uint64_t u64_4tech;
#if defined(FTECH_32_BIT)
typedef u32_4tech umem_4tech;
#else
typedef u64_4tech umem_4tech;
#endif
typedef float f32_4tech;
typedef double f64_4tech;