mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-03 15:41:57 +00:00
Add a way to initialize VFS globals.
This is needed since the kernel loader doesn't even zero out bss, much less call any static constructors.
This commit is contained in:
parent
97e0d75bcb
commit
2d1d01661b
Notes:
sideshowbarker
2024-07-19 18:46:13 +09:00
Author: https://github.com/awesomekling
Commit: 2d1d01661b
4 changed files with 16 additions and 2 deletions
|
@ -2,16 +2,22 @@
|
|||
#include <AK/HashMap.h>
|
||||
#include "FileSystem.h"
|
||||
|
||||
static dword s_lastFileSystemID = 0;
|
||||
static dword s_lastFileSystemID;
|
||||
static HashMap<dword, FileSystem*>* map;
|
||||
|
||||
static HashMap<dword, FileSystem*>& fileSystems()
|
||||
{
|
||||
static HashMap<dword, FileSystem*>* map;
|
||||
if (!map)
|
||||
map = new HashMap<dword, FileSystem*>();
|
||||
return *map;
|
||||
}
|
||||
|
||||
void FileSystem::initializeGlobals()
|
||||
{
|
||||
s_lastFileSystemID = 0;
|
||||
map = 0;
|
||||
}
|
||||
|
||||
FileSystem::FileSystem()
|
||||
: m_id(++s_lastFileSystemID)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue