mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[project] Lose the battle between tabs & spaces
I'm a tabs guy. I like tabs, it's an elegant way to represent indentation instead of brute-forcing it. But I have to admit that the world seems to be going towards spaces, and tooling tends not to play nice with tabs. So here we go, changing the whole repo to spaces since I'm getting tired of all the inconsistent formatting.
This commit is contained in:
committed by
Justin C. Miller
parent
d36b2d8057
commit
8f529046a9
@@ -3,15 +3,15 @@
|
||||
/// Page allocator class definition
|
||||
|
||||
namespace uefi {
|
||||
class boot_services;
|
||||
class boot_services;
|
||||
}
|
||||
|
||||
namespace kernel {
|
||||
namespace init {
|
||||
enum class allocation_type : uint8_t;
|
||||
struct allocation_register;
|
||||
struct module;
|
||||
struct modules_page;
|
||||
enum class allocation_type : uint8_t;
|
||||
struct allocation_register;
|
||||
struct module;
|
||||
struct modules_page;
|
||||
}}
|
||||
|
||||
namespace boot {
|
||||
@@ -22,46 +22,46 @@ using alloc_type = kernel::init::allocation_type;
|
||||
class allocator
|
||||
{
|
||||
public:
|
||||
using allocation_register = kernel::init::allocation_register;
|
||||
using module = kernel::init::module;
|
||||
using modules_page = kernel::init::modules_page;
|
||||
using allocation_register = kernel::init::allocation_register;
|
||||
using module = kernel::init::module;
|
||||
using modules_page = kernel::init::modules_page;
|
||||
|
||||
allocator(uefi::boot_services &bs);
|
||||
allocator(uefi::boot_services &bs);
|
||||
|
||||
void * allocate(size_t size, bool zero = false);
|
||||
void free(void *p);
|
||||
void * allocate(size_t size, bool zero = false);
|
||||
void free(void *p);
|
||||
|
||||
void * allocate_pages(size_t count, alloc_type type, bool zero = false);
|
||||
void * allocate_pages(size_t count, alloc_type type, bool zero = false);
|
||||
|
||||
template <typename M>
|
||||
M * allocate_module(size_t extra = 0) {
|
||||
return static_cast<M*>(allocate_module_untyped(sizeof(M) + extra));
|
||||
}
|
||||
template <typename M>
|
||||
M * allocate_module(size_t extra = 0) {
|
||||
return static_cast<M*>(allocate_module_untyped(sizeof(M) + extra));
|
||||
}
|
||||
|
||||
void memset(void *start, size_t size, uint8_t value);
|
||||
void copy(void *to, void *from, size_t size);
|
||||
void memset(void *start, size_t size, uint8_t value);
|
||||
void copy(void *to, void *from, size_t size);
|
||||
|
||||
inline void zero(void *start, size_t size) { memset(start, size, 0); }
|
||||
inline void zero(void *start, size_t size) { memset(start, size, 0); }
|
||||
|
||||
/// Initialize the global allocator
|
||||
/// \arg allocs [out] Poiinter to the initial allocation register
|
||||
/// \arg modules [out] Pointer to the initial modules_page
|
||||
/// \arg bs UEFI boot services
|
||||
static void init(
|
||||
allocation_register *&allocs,
|
||||
modules_page *&modules,
|
||||
uefi::boot_services *bs);
|
||||
/// Initialize the global allocator
|
||||
/// \arg allocs [out] Poiinter to the initial allocation register
|
||||
/// \arg modules [out] Pointer to the initial modules_page
|
||||
/// \arg bs UEFI boot services
|
||||
static void init(
|
||||
allocation_register *&allocs,
|
||||
modules_page *&modules,
|
||||
uefi::boot_services *bs);
|
||||
|
||||
private:
|
||||
void add_register();
|
||||
void add_modules();
|
||||
module * allocate_module_untyped(size_t size);
|
||||
void add_register();
|
||||
void add_modules();
|
||||
module * allocate_module_untyped(size_t size);
|
||||
|
||||
uefi::boot_services &m_bs;
|
||||
uefi::boot_services &m_bs;
|
||||
|
||||
allocation_register *m_register;
|
||||
modules_page *m_modules;
|
||||
module *m_next_mod;
|
||||
allocation_register *m_register;
|
||||
modules_page *m_modules;
|
||||
module *m_next_mod;
|
||||
};
|
||||
|
||||
} // namespace memory
|
||||
|
||||
Reference in New Issue
Block a user