소스 검색

Inline `assert` condition

gingerBill 2 년 전
부모
커밋
cf4afc2e7b
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      core/mem/virtual/arena.odin

+ 1 - 1
core/mem/virtual/arena.odin

@@ -44,7 +44,7 @@ arena_init_static :: proc(arena: ^Arena, reserved: uint, commit_size: uint = DEF
 }
 
 arena_alloc :: proc(arena: ^Arena, size: uint, alignment: uint, loc := #caller_location) -> (data: []byte, err: Allocator_Error) {
-	assert(mem.is_power_of_two(uintptr(alignment)), "non-power of two alignment", loc)
+	assert(alignment & (alignment-1) == 0, "non-power of two alignment", loc)
 
 	size := size
 	if size == 0 {