mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
ealanos: Tests for new heap implementation.
This commit is contained in:
42
repos/ealanos/src/test/coreheap_test/main.cc
Normal file
42
repos/ealanos/src/test/coreheap_test/main.cc
Normal file
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* @file main.cc
|
||||
* @author your name (you@domain.com)
|
||||
* @brief Component for testing CPU core-local heaps
|
||||
* @version 0.1
|
||||
* @date 2025-04-23
|
||||
*
|
||||
* @copyright Copyright (c) 2025
|
||||
*
|
||||
*/
|
||||
|
||||
#include <base/component.h>
|
||||
#include <base/env.h>
|
||||
#include <base/heap.h>
|
||||
#include <ealanos/memory/coreheap.h>
|
||||
|
||||
namespace Ealan::Memory {
|
||||
class CoreheapTest;
|
||||
using namespace Genode;
|
||||
}
|
||||
|
||||
class Ealan::Memory::CoreheapTest
|
||||
{
|
||||
private:
|
||||
Env &_env;
|
||||
Core_heap<64, 2048> _heap{_env.pd(), _env.rm()};
|
||||
|
||||
public:
|
||||
|
||||
CoreheapTest(Env &env) : _env(env)
|
||||
{
|
||||
log("Starting tests for Core_heap");
|
||||
|
||||
void *p = _heap.aligned_alloc(42, 16);
|
||||
log("Allocated memory at ", p);
|
||||
}
|
||||
};
|
||||
|
||||
void Component::construct(Genode::Env &env)
|
||||
{
|
||||
static Ealan::Memory::CoreheapTest test(env);
|
||||
}
|
||||
6
repos/ealanos/src/test/coreheap_test/target.mk
Normal file
6
repos/ealanos/src/test/coreheap_test/target.mk
Normal file
@@ -0,0 +1,6 @@
|
||||
TARGET = coreheap_test
|
||||
SRC_CC = main.cc
|
||||
LIBS = base
|
||||
INC_DIR = $(PRG_DIR)
|
||||
INC_DIR += $(REP_DIR)/include
|
||||
|
||||
Reference in New Issue
Block a user