2024-01-29 23:27:45 -08:00
|
|
|
|
|
|
|
package sectr
|
|
|
|
// At least its less than C/C++ ...
|
|
|
|
|
2024-02-13 23:29:28 -08:00
|
|
|
import "base:builtin"
|
2024-01-29 23:27:45 -08:00
|
|
|
import "core:mem"
|
|
|
|
import "core:mem/virtual"
|
2024-02-13 14:16:39 -08:00
|
|
|
import "core:path/filepath"
|
2024-01-29 23:27:45 -08:00
|
|
|
|
|
|
|
Byte :: 1
|
|
|
|
Kilobyte :: 1024 * Byte
|
|
|
|
Megabyte :: 1024 * Kilobyte
|
|
|
|
Gigabyte :: 1024 * Megabyte
|
|
|
|
Terabyte :: 1024 * Gigabyte
|
|
|
|
Petabyte :: 1024 * Terabyte
|
|
|
|
Exabyte :: 1024 * Petabyte
|
|
|
|
|
|
|
|
kilobytes :: proc ( kb : $ integer_type ) -> integer_type {
|
|
|
|
return kb * Kilobyte
|
|
|
|
}
|
|
|
|
megabytes :: proc ( mb : $ integer_type ) -> integer_type {
|
|
|
|
return mb * Megabyte
|
|
|
|
}
|
|
|
|
gigabyte :: proc ( gb : $ integer_type ) -> integer_type {
|
|
|
|
return gb * Gigabyte
|
|
|
|
}
|
|
|
|
terabyte :: proc ( tb : $ integer_type ) -> integer_type {
|
|
|
|
return tb * Terabyte
|
|
|
|
}
|
|
|
|
|
2024-02-13 23:29:28 -08:00
|
|
|
copy :: builtin.copy
|
2024-01-29 23:27:45 -08:00
|
|
|
Allocator :: mem.Allocator
|
2024-02-13 14:16:39 -08:00
|
|
|
AllocatorError :: mem.Allocator_Error
|
2024-01-29 23:27:45 -08:00
|
|
|
alloc :: mem.alloc
|
2024-02-13 14:16:39 -08:00
|
|
|
alloc_bytes :: mem.alloc_bytes
|
2024-01-29 23:27:45 -08:00
|
|
|
Arena :: mem.Arena
|
|
|
|
arena_allocator :: mem.arena_allocator
|
|
|
|
arena_init :: mem.arena_init
|
2024-02-13 23:29:28 -08:00
|
|
|
free :: mem.free
|
2024-01-29 23:27:45 -08:00
|
|
|
ptr_offset :: mem.ptr_offset
|
|
|
|
slice_ptr :: mem.slice_ptr
|
|
|
|
Tracking_Allocator :: mem.Tracking_Allocator
|
|
|
|
tracking_allocator :: mem.tracking_allocator
|
|
|
|
tracking_allocator_init :: mem.tracking_allocator_init
|
2024-02-13 14:16:39 -08:00
|
|
|
file_name_from_path :: filepath.short_stem
|
2024-02-10 00:40:53 -08:00
|
|
|
OS_Type :: type_of(ODIN_OS)
|
2024-01-29 23:27:45 -08:00
|
|
|
|
2024-02-11 20:00:06 -08:00
|
|
|
get_bounds :: proc {
|
|
|
|
box_get_bounds,
|
|
|
|
view_get_bounds,
|
|
|
|
}
|