Skip to content

Commit

Permalink
Major overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaTheFoxgirl committed Sep 19, 2024
1 parent 97c9b96 commit aeebf57
Show file tree
Hide file tree
Showing 32 changed files with 721 additions and 130 deletions.
20 changes: 13 additions & 7 deletions source/numem/all.d
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
/*
Copyright © 2024, Inochi2D Project
Distributed under the 2-Clause BSD License, see LICENSE file.
Authors: Luna the Foxgirl
*/

/**
Automatically imports all of the numem types.
*/
module numem.all;

public import numem.mem;
public import numem.mem.ptr;
public import numem.mem.string;
public import numem.mem.vector;
public import numem.mem.map;
public import numem.mem.set;
public import numem.mem.exception;
public import numem.core;
public import numem.core.memory;
public import numem.collections;
public import numem.core.exception;
public import numem.io;
public import numem.string;
public import numem.conv;
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Authors: Guillaume Piolat
*/
module numem.mem.internal.btree;
import numem.mem;
module numem.collections.internal.btree;
import numem.core;

import std.functional : binaryFun;

Expand Down
7 changes: 7 additions & 0 deletions source/numem/collections/internal/package.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
Copyright © 2023, Inochi2D Project
Distributed under the 2-Clause BSD License, see LICENSE file.
Authors: Luna Nielsen
*/
module numem.core.internal;
6 changes: 3 additions & 3 deletions source/numem/mem/map.d → source/numem/collections/map.d
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
Authors: Authors: Steven Schveighoffer, $(HTTP erdani.com, Andrei Alexandrescu), Guillaume Piolat
*/
module numem.mem.map;
import numem.mem.internal.btree;
import numem.mem;
module numem.collections.map;
import numem.collections.internal.btree;
import numem.core;
import std.functional : binaryFun;

@nogc:
Expand Down
15 changes: 15 additions & 0 deletions source/numem/collections/package.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
Copyright © 2023, Inochi2D Project
Distributed under the 2-Clause BSD License, see LICENSE file.
Authors: Luna Nielsen
*/

/**
Standard numem collection types.
*/
module numem.collections;

public import numem.collections.vector;
public import numem.collections.set;
public import numem.collections.map;
6 changes: 3 additions & 3 deletions source/numem/mem/set.d → source/numem/collections/set.d
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
Authors: Authors: Steven Schveighoffer, $(HTTP erdani.com, Andrei Alexandrescu), Guillaume Piolat
*/
module numem.mem.set;
import numem.mem.internal.btree;
import numem.mem;
module numem.collections.set;
import numem.collections.internal.btree;
import numem.core;
import std.functional : binaryFun;


Expand Down
13 changes: 7 additions & 6 deletions source/numem/mem/vector.d → source/numem/collections/vector.d
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/*
Copyright © 2023, Inochi2D Project
Copyright © 2024, Inochi2D Project
Distributed under the 2-Clause BSD License, see LICENSE file.
Authors: Luna Nielsen
Authors: Luna the Foxgirl
*/
module numem.mem.vector;
import numem.mem.ptr;
import numem.mem;

module numem.collections.vector;
import numem.core.memory.smartptr;
import numem.core;
import core.stdc.stdlib : malloc, realloc, free;
import core.stdc.string : memcpy, memmove;
import core.atomic : atomicFetchAdd, atomicFetchSub, atomicStore, atomicLoad;
Expand Down
9 changes: 8 additions & 1 deletion source/numem/conv.d
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
Copyright © 2024, Inochi2D Project
Distributed under the 2-Clause BSD License, see LICENSE file.
Authors: Luna the Foxgirl
*/

/**
Utilities for converting between some basic types
*/
Expand All @@ -11,7 +18,7 @@ version(NoC) {
import core.stdc.stdlib;
import core.stdc.stdio : snprintf;
import std.traits;
import numem.mem.exception;
import numem.core.exception;

@nogc:

Expand Down
16 changes: 12 additions & 4 deletions source/numem/mem/exception.d → source/numem/core/exception.d
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
/*
Copyright © 2024, Inochi2D Project
Distributed under the 2-Clause BSD License, see LICENSE file.
Authors: Luna the Foxgirl
*/

/**
Numem Exception support
*/
module numem.mem.exception;
import numem.mem.string;
import numem.mem;
module numem.core.exception;
import numem.string;
import numem.core;

import core.stdc.stdio;
import numem.mem.internal.trace;
import numem.core.trace;

@nogc:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
Authors: Luna Nielsen
*/
module numem.mem;

module numem.core.memory;
import core.stdc.stdlib : free, exit, malloc;
import std.traits;
import numem.mem.utils;
import numem.mem.internal.trace;
import numem.core.utils;
import numem.core.trace;

public import numem.core.memory.smartptr;

version(Have_tinyd_rt) {
private __gshared
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
Authors: Luna Nielsen
*/
module numem.mem.ptr;

module numem.core.memory.smartptr;
import core.atomic : atomicFetchAdd, atomicFetchSub, atomicStore, atomicLoad;
import std.traits;
import numem.mem;
import numem.core;

//
// SMART POINTERS
Expand Down Expand Up @@ -600,7 +601,7 @@ unittest {

@("unique_ptr: move to array")
unittest {
import numem.mem.vector;
import numem.collections.vector;
struct A { int b; }

vector!(unique_ptr!A) uniques;
Expand Down
3 changes: 3 additions & 0 deletions source/numem/core/package.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module numem.core;

public import numem.core.memory;
Loading

0 comments on commit aeebf57

Please sign in to comment.