mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-10-15 21:39:41 -07:00
share arena between type deduper and MSF
This commit is contained in:
1 parent
f5fc3c66b7
commit
d7a87b7765
3 files changed
+36
-14
No files matched your search
@@ -1343,14 +1343,12 @@ msf_stream_align(MSF_Context *msf, MSF_StreamNumber sn, MSF_UInt align)
|
||||
////////////////////////////////
|
||||
|
||||
internal MSF_Context *
|
||||
msf_alloc__(MSF_UInt page_size, MSF_PageNumber active_fpm)
|
||||
msf_alloc__(Arena *arena, MSF_UInt page_size, MSF_PageNumber active_fpm)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Assert(active_fpm == MSF_FPM0 || active_fpm == MSF_FPM1);
|
||||
Assert(IsPow2(page_size));
|
||||
|
||||
Arena *arena = arena_alloc();
|
||||
|
||||
MSF_Context *msf = push_array(arena, MSF_Context, 1);
|
||||
msf->arena = arena;
|
||||
msf->page_size = page_size;
|
||||
@@ -1361,9 +1359,9 @@ msf_alloc__(MSF_UInt page_size, MSF_PageNumber active_fpm)
|
||||
}
|
||||
|
||||
internal MSF_Context *
|
||||
msf_alloc(MSF_UInt page_size, MSF_UInt active_fpm)
|
||||
msf_alloc_(Arena *arena, MSF_UInt page_size, MSF_UInt active_fpm)
|
||||
{
|
||||
MSF_Context *msf = msf_alloc__(page_size, active_fpm);
|
||||
MSF_Context *msf = msf_alloc__(arena, page_size, active_fpm);
|
||||
|
||||
// reserve first page for header
|
||||
msf->header_page_list = msf_alloc_pages(msf, 1);
|
||||
@@ -1378,6 +1376,12 @@ msf_alloc(MSF_UInt page_size, MSF_UInt active_fpm)
|
||||
return msf;
|
||||
}
|
||||
|
||||
internal MSF_Context *
|
||||
msf_alloc(MSF_UInt page_size, MSF_UInt active_fpm)
|
||||
{
|
||||
return msf_alloc_(arena_alloc( .name = "MSF"), page_size, active_fpm);
|
||||
}
|
||||
|
||||
internal MSF_StreamNode *
|
||||
msf_find_stream_node(MSF_Context *msf, MSF_StreamNumber sn)
|
||||
{
|
||||
@@ -1608,7 +1612,7 @@ msf_open(String8 data, MSF_Context **msf_out)
|
||||
}
|
||||
|
||||
// allocate MSF context and don't reserve special pages
|
||||
msf = msf_alloc__(header->page_size, header->active_fpm);
|
||||
msf = msf_alloc__(arena_alloc(.name = "MSF"), header->page_size, header->active_fpm);
|
||||
|
||||
// divide data into fixed size nodes (with 4KB page each node is 128MB)
|
||||
msf_set_page_data_list(msf->arena, &page_data_list, header->page_size, data);
|
||||
|
||||
@@ -3516,10 +3516,10 @@ dbi_push_section(PDB_DbiContext *dbi, COFF_SectionHeader *hdr)
|
||||
////////////////////////////////
|
||||
|
||||
internal MSF_Context *
|
||||
pdb_alloc_msf(U64 page_size)
|
||||
pdb_alloc_msf(Arena *arena, U64 page_size)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
MSF_Context *msf = msf_alloc(page_size, MSF_DEFAULT_FPM);
|
||||
MSF_Context *msf = msf_alloc_(arena, page_size, MSF_DEFAULT_FPM);
|
||||
MSF_StreamNumber null_sn = msf_stream_alloc(msf);
|
||||
MSF_StreamNumber info_sn = msf_stream_alloc(msf);
|
||||
MSF_StreamNumber tpi_sn = msf_stream_alloc(msf);
|
||||
@@ -3535,13 +3535,12 @@ pdb_alloc_msf(U64 page_size)
|
||||
}
|
||||
|
||||
internal PDB_Context *
|
||||
pdb_alloc(U64 page_size, COFF_MachineType machine, COFF_TimeStamp time_stamp, U32 age, Guid guid)
|
||||
pdb_alloc_(Arena *arena, U64 page_size, COFF_MachineType machine, COFF_TimeStamp time_stamp, U32 age, Guid guid)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
Arena *arena = arena_alloc();
|
||||
PDB_Context *pdb = push_array(arena, PDB_Context, 1);
|
||||
pdb->arena = arena;
|
||||
pdb->msf = pdb_alloc_msf(page_size);
|
||||
pdb->msf = pdb_alloc_msf(arena, page_size);
|
||||
pdb->info = pdb_info_alloc(age, time_stamp, guid);
|
||||
pdb->dbi = dbi_alloc(machine, age);
|
||||
pdb->gsi = gsi_alloc();
|
||||
@@ -3554,6 +3553,12 @@ pdb_alloc(U64 page_size, COFF_MachineType machine, COFF_TimeStamp time_stamp, U3
|
||||
return pdb;
|
||||
}
|
||||
|
||||
internal PDB_Context *
|
||||
pdb_alloc(U64 page_size, COFF_MachineType machine, COFF_TimeStamp time_stamp, U32 age, Guid guid)
|
||||
{
|
||||
return pdb_alloc_(arena_alloc(.name = "PDB"), page_size, machine, time_stamp, age, guid);
|
||||
}
|
||||
|
||||
internal PDB_Context *
|
||||
pdb_open(String8 data)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user