Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: quarantine v4 #20

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extract: $(ALL_KRML_FILES)
-bundle Steel.SpinLock= -bundle 'FStar.\*,Steel.\*' \
-bundle 'StarMalloc=Mman2,FatalError,Map.\*,Impl.\*,Spec.\*,Main,Main2,Main.Meta,LargeAlloc'[rename=StarMalloc] \
-bundle 'SlabsCommon,SlabsFree,SlabsAlloc'[rename=Slabs] \
-bundle 'SlotsFree,SlotsAlloc'[rename=Slots] \
-bundle 'SlotsFree,SlotsAlloc,SlotsCommon'[rename=Slots] \
-bundle 'ArrayList,ArrayListGen'[rename=ArrayList] \
-no-prefix LargeAlloc \
-no-prefix Mman \
Expand All @@ -93,6 +93,7 @@ FILES = \
dist/Slots.c \
dist/Bitmap5.c \
dist/Utils2.c \
dist/Constants.c \
dist/SizeClass.c \
dist/SizeClassSelection.c \
dist/PtrdiffWrapper.c \
Expand Down
6 changes: 3 additions & 3 deletions dist/Config.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ size_t Config_guard_pages_interval = (size_t)2U;

bool Config_enable_quarantine = true;

bool Config_enable_quarantine_slot = true;

bool Config_enable_quarantine_trap = true;

bool Config_enable_quarantine_strict_trap = false;

size_t Config_quarantine_queue_length = (size_t)1024U;

size_t Config_quarantine_queue_threshold = (size_t)256U;
size_t Config_quarantine_queue_length = (size_t)4096U;

bool Config_enable_zeroing_malloc = true;

Expand Down
4 changes: 2 additions & 2 deletions dist/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ extern size_t Config_guard_pages_interval;

extern bool Config_enable_quarantine;

extern bool Config_enable_quarantine_slot;

extern bool Config_enable_quarantine_trap;

extern bool Config_enable_quarantine_strict_trap;

extern size_t Config_quarantine_queue_length;

extern size_t Config_quarantine_queue_threshold;

extern bool Config_enable_zeroing_malloc;

extern bool Config_enable_zeroing_free;
Expand Down
5 changes: 5 additions & 0 deletions dist/Constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@

uint32_t Constants_page_size = 4096U;

uint32_t Constants_nb_slots(uint32_t size_class)
{
return 4096U / size_class;
}

2 changes: 2 additions & 0 deletions dist/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

extern uint32_t Constants_page_size;

uint32_t Constants_nb_slots(uint32_t size_class);


#define __Constants_H_DEFINED
#endif
2 changes: 2 additions & 0 deletions dist/SizeClass.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ uint8_t *SizeClass_allocate_size_class(SizeClass_size_class_struct_ scs)
SlabsAlloc_allocate_slab(scs.size,
scs.slab_region,
scs.md_bm_region,
scs.md_bm_region_q,
scs.md_region,
scs.md_count,
scs.slabs_idxs);
Expand All @@ -27,6 +28,7 @@ SizeClass_deallocate_size_class(SizeClass_size_class_struct_ scs, uint8_t *ptr,
scs.size,
scs.slab_region,
scs.md_bm_region,
scs.md_bm_region_q,
scs.md_region,
scs.md_count,
scs.slabs_idxs,
Expand Down
1 change: 1 addition & 0 deletions dist/SizeClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ typedef struct SizeClass_size_class_struct__s
size_t *md_count;
uint8_t *slab_region;
uint64_t *md_bm_region;
uint64_t *md_bm_region_q;
ArrayList_cell *md_region;
}
SizeClass_size_class_struct_;
Expand Down
Loading
Loading