Store item in List rather than pointer to item

This commit is contained in:
josh committed 2023-10-25 21:28:27 -04:00
1 parent f5c6a35cef
commit 6251fee3ff
3 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -13,7 +13,7 @@ struct Acpi
/**
* List of ACPI tables.
*/
private static __gshared List!Header tables;
private static __gshared List!(Header *) tables;
enum uint XSDT_SIGNATURE = signature("XSDT");
+3 -3
View File
@@ -13,7 +13,7 @@ struct List(T)
/**
* Linked list item.
*/
T * item;
T item;
/**
* Next list entry.
@@ -23,7 +23,7 @@ struct List(T)
/**
* Add an item to this linked list.
*/
public void add(T * item)
public void add(T item)
{
List!T * last_entry = last_entry();
List!T * new_entry = A1.allocate!(List!T)();
@@ -34,7 +34,7 @@ struct List(T)
/**
* Allow foreach iteration across a List.
*/
public int opApply(scope int delegate(T *) dg)
public int opApply(scope int delegate(ref T) dg)
{
List!T * entry = &this;
while (entry.next != null)
+1 -1
View File
@@ -235,7 +235,7 @@ struct Pci
/**
* Store a list of discovered PCI devices.
*/
public static __gshared List!Device devices;
public static __gshared List!(Device *) devices;
private static uint read_config_register(Address address, uint register_id)
{