SectrPrototype/code/grime.odin

50 lines
1.3 KiB
Odin
Raw Normal View History

2024-01-29 23:27:45 -08:00
package sectr
// At least its less than C/C++ ...
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
}
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
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
OS_Type :: type_of(ODIN_OS)
2024-01-29 23:27:45 -08:00
get_bounds :: proc {
box_get_bounds,
view_get_bounds,
}