diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-07-12 20:07:59 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-07-27 04:47:51 -0400 |
commit | 0e875c3f1d7373812ddae9962edfc9538465d2ed (patch) | |
tree | 49a86dcbe6b875c042dc3e21070114a8cd4d5471 /includes/rts/ExecPage.h | |
parent | 3b07d8270341725c862230d8aec213fe34bd9fb6 (diff) | |
download | haskell-0e875c3f1d7373812ddae9962edfc9538465d2ed.tar.gz |
rts: Introduce and use ExecPage abstraction
Here we introduce a very thin abstraction for allocating, filling, and
freezing executable pages to replace allocateExec.
Diffstat (limited to 'includes/rts/ExecPage.h')
-rw-r--r-- | includes/rts/ExecPage.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/includes/rts/ExecPage.h b/includes/rts/ExecPage.h new file mode 100644 index 0000000000..4261b71259 --- /dev/null +++ b/includes/rts/ExecPage.h @@ -0,0 +1,18 @@ +/* + * Utilities for managing dynamically-allocated executable pages. + */ + +#pragma once + +typedef struct { + char contents; +} ExecPage; + +/* Allocate a writable page. */ +ExecPage *allocateExecPage(void); + +/* Make a page previously allocated by allocateExecPage. */ +void freezeExecPage(ExecPage *page); + +/* Free a page previously allocated by allocateExecPage. */ +void freeExecPage(ExecPage *page); |