]> git.mdlowis.com Git - archive/atc.git/commitdiff
Added skeleton for the heap module
authorMike D. Lowis <mike.lowis@gentex.com>
Tue, 31 Mar 2015 20:45:53 +0000 (16:45 -0400)
committerMike D. Lowis <mike.lowis@gentex.com>
Tue, 31 Mar 2015 20:45:53 +0000 (16:45 -0400)
Gemfile.lock
source/runtime/heap.c [new file with mode: 0644]
source/runtime/heap.h [new file with mode: 0644]

index 22e438cb2c9ec5c4c7ad159081f420d39eec3cca..88f9e23a51002ede5d7c3353f6c8368997105f06 100644 (file)
@@ -2,22 +2,23 @@ GEM
   remote: https://rubygems.org/
   specs:
     diff-lcs (1.2.5)
-    json (1.8.1)
-    rake (10.3.2)
-    rscons (1.8.1)
+    json (1.8.2)
+    rake (10.4.2)
+    rscons (1.9.0)
       json (~> 1.0)
-    rspec (3.1.0)
-      rspec-core (~> 3.1.0)
-      rspec-expectations (~> 3.1.0)
-      rspec-mocks (~> 3.1.0)
-    rspec-core (3.1.7)
-      rspec-support (~> 3.1.0)
-    rspec-expectations (3.1.2)
+    rspec (3.2.0)
+      rspec-core (~> 3.2.0)
+      rspec-expectations (~> 3.2.0)
+      rspec-mocks (~> 3.2.0)
+    rspec-core (3.2.2)
+      rspec-support (~> 3.2.0)
+    rspec-expectations (3.2.0)
       diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.1.0)
-    rspec-mocks (3.1.3)
-      rspec-support (~> 3.1.0)
-    rspec-support (3.1.2)
+      rspec-support (~> 3.2.0)
+    rspec-mocks (3.2.1)
+      diff-lcs (>= 1.2.0, < 2.0)
+      rspec-support (~> 3.2.0)
+    rspec-support (3.2.2)
 
 PLATFORMS
   ruby
diff --git a/source/runtime/heap.c b/source/runtime/heap.c
new file mode 100644 (file)
index 0000000..3635053
--- /dev/null
@@ -0,0 +1,24 @@
+/**
+  @file heap.c
+  @brief See header for details
+  $Revision$
+  $HeadURL$
+  */
+#include "heap.h"
+
+heap_t* heap_create(void)
+{
+    return NULL;
+}
+
+void heap_destroy(heap_t* heap)
+{
+    (void)heap;
+}
+
+void* heap_allocate(size_t block_size)
+{
+    (void)block_size;
+    return NULL;
+}
+
diff --git a/source/runtime/heap.h b/source/runtime/heap.h
new file mode 100644 (file)
index 0000000..54b78e6
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+  @file heap.h
+  @brief TODO: Describe this file
+*/
+#ifndef HEAP_H
+#define HEAP_H
+
+#include "segment.h"
+
+#define NUM_HEAP_STACKS ((sizeof(uintptr_t) * 8u) - 3u)
+
+typedef struct segnode_t {
+    segment_t* segment;
+    struct segnode_t* next;
+} segnode_t;
+
+typedef struct {
+    uintptr_t bytes_allocated;
+    struct {
+        segnode_t* first;
+        segnode_t* last;
+    } heaps[NUM_HEAP_STACKS];
+} heap_t;
+
+heap_t* heap_create(void);
+
+void heap_destroy(heap_t* heap);
+
+void* heap_allocate(size_t block_size);
+
+#endif /* HEAP_H */