More code, closer to working, still builds.
This commit is contained in:
parent
c9f50572ab
commit
f751fc8a09
14 changed files with 138 additions and 133 deletions
|
|
@ -13,6 +13,14 @@
|
|||
#include "memory/memory.h"
|
||||
#include "memory/node.h"
|
||||
#include "memory/pointer.h"
|
||||
#include "memory/pso.h"
|
||||
#include "memory/pso2.h"
|
||||
#include "memory/tags.h"
|
||||
|
||||
#include "payloads/exception.h"
|
||||
|
||||
#include "ops/bind.h"
|
||||
#include "ops/string_ops.h"
|
||||
|
||||
/**
|
||||
* @brief Freelists for each size class.
|
||||
|
|
@ -24,6 +32,7 @@ struct pso_pointer freelists[MAX_SIZE_CLASS];
|
|||
*/
|
||||
bool memory_initialised = false;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Initialise the memory allocation system.
|
||||
*
|
||||
|
|
@ -34,8 +43,12 @@ bool memory_initialised = false;
|
|||
* @return int
|
||||
*/
|
||||
struct pso_pointer initialise_memory( uint32_t node ) {
|
||||
struct pso_pointer result = nil;
|
||||
if ( memory_initialised ) {
|
||||
// TODO: throw an exception
|
||||
result =
|
||||
make_exception( c_string_to_lisp_string
|
||||
( L"Attenpt to reinitialise environment" ), nil,
|
||||
nil );
|
||||
} else {
|
||||
for ( uint8_t i = 0; i <= MAX_SIZE_CLASS; i++ ) {
|
||||
freelists[i] = nil;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue