Compare commits
No commits in common. "606bf14ffe3f8e5b299e79a480bc603e7a196834" and "657dec64152f42739306f770b5a31eb563dcfbd3" have entirely different histories.
606bf14ffe
...
657dec6415
4 changed files with 3 additions and 34 deletions
2
TODO
2
TODO
|
|
@ -36,6 +36,7 @@
|
|||
031 [x] standardize error handling (maybe odin-style enums?)
|
||||
032 [memory] more allocators!
|
||||
033 [sort] create sort module with quick sort, radix sort support (in place and copy versions)
|
||||
034 [x] can we add location info to Allocator_Proc?
|
||||
035 [memory] add debug allocator to track allocation locations, double frees, etc. (should wrap another allocator)
|
||||
036 [thread] create *simple* threading module
|
||||
037 [thread] add 'Mutex', 'Semaphore', 'Wait_Group' types - blocked by 036
|
||||
|
|
@ -82,4 +83,3 @@
|
|||
004 [thirdparty/luajit] create bindings
|
||||
001 [platform] create module for OS/platform-specific things
|
||||
024 [x] create file to document conventions/style guide
|
||||
034 [x] can we add location info to Allocator_Proc?
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
// @todo(judah): replace array_add
|
||||
|
||||
append :: inline (arr: *[..]$T, value: T) -> *T {
|
||||
ptr := basic.array_add(arr);
|
||||
ptr.* = value;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
append :: inline (arr: *[..]$T, values: ..T) -> *T {
|
||||
count := arr.count;
|
||||
basic.array_add(arr, ..values);
|
||||
return *arr.data[count];
|
||||
}
|
||||
|
||||
append :: inline (arr: *[..]$T) -> *T {
|
||||
return basic.array_add(arr);
|
||||
}
|
||||
|
||||
reset :: inline (arr: *[..]$T, $keep_memory := true) {
|
||||
arr.count = 0;
|
||||
#if !keep_memory {
|
||||
mem.release_memory(arr.data,, allocator = arr.allocator);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#scope_file;
|
||||
|
||||
mem :: #import "jc/memory";
|
||||
basic :: #import "Basic"; // @future
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
#module_parameters(RUN_TESTS := false);
|
||||
|
||||
#load "static_array.jai";
|
||||
#load "dynamic_array.jai";
|
||||
|
||||
#scope_module;
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ operator []= :: inline (a: *Static_Array, index: int, value: a.T, loc := #caller
|
|||
|
||||
for_expansion :: (a: *Static_Array, body: Code, flags: For_Flags) #expand {
|
||||
view := make_view(a);
|
||||
for *=(flags & .POINTER == .POINTER) <=(flags & .REVERSE == .REVERSE) `it, `it_index: view {
|
||||
for *=(flags & .POINTER == .POINTEr) <=(flags & .REVERSE == .REVERSE) `it, `it_index: iter {
|
||||
#insert,scope(body)(break = break it) body;
|
||||
}
|
||||
}
|
||||
|
|
@ -78,7 +78,7 @@ make_dynamic :: (a: *Static_Array) -> [..]a.T {
|
|||
#scope_file;
|
||||
|
||||
ensure_array_has_room :: (array: *Static_Array, count: int, loc := #caller_location) #expand {
|
||||
basic.assert(array.count + count <= array.capacity, "attempt to add too many elements! want: %, max: %", array.count + count, array.capacity, loc = loc);
|
||||
basic.assert(array.count + count <= array.capacity, "attempt to add too many elements! want: %, Max: %", array.count + count, array.capacity, loc = loc);
|
||||
}
|
||||
|
||||
mem :: #import "jc/memory";
|
||||
|
|
|
|||
Loading…
Reference in a new issue