mirror of
https://github.com/IllusionMan1212/flac-odin.git
synced 2026-10-24 02:12:29 +00:00
odin compiler update
This commit is contained in:
@@ -861,8 +861,9 @@ read_next_frame :: proc(r: ^Reader, flac: ^Flac, allocator := context.allocator)
|
|||||||
|
|
||||||
crc_buffer: Buffer
|
crc_buffer: Buffer
|
||||||
// NOTE: using the default heap allocator here causes a use-after-free bug on files subset/05, subset/06, and subset/25
|
// NOTE: using the default heap allocator here causes a use-after-free bug on files subset/05, subset/06, and subset/25
|
||||||
// No idea what the cause of the bug is.
|
// No idea what the cause of the bug is. I am inclined to believe that it's a bug of the default heap allocator but
|
||||||
buffer_init_allocator(&crc_buffer, 0, 128, context.temp_allocator)
|
// maybe my code is fucking up the memory so bad it makes it seems that way.
|
||||||
|
buffer_init_allocator(&crc_buffer, 0, 128)
|
||||||
|
|
||||||
crc := buffer_to_stream(&crc_buffer)
|
crc := buffer_to_stream(&crc_buffer)
|
||||||
r := &Reader{
|
r := &Reader{
|
||||||
|
|||||||
+2
-2
@@ -310,7 +310,7 @@ decode_extended_utf8 :: proc(r: ^Reader) -> (decoded_num: u64, err: Error) {
|
|||||||
return decoded_num, nil
|
return decoded_num, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@(optimization_mode = "speed")
|
@(optimization_mode = "favor_size")
|
||||||
calculate_crc8 :: proc(data: []byte) -> u8 #no_bounds_check {
|
calculate_crc8 :: proc(data: []byte) -> u8 #no_bounds_check {
|
||||||
crc: u8 = 0
|
crc: u8 = 0
|
||||||
|
|
||||||
@@ -321,7 +321,7 @@ calculate_crc8 :: proc(data: []byte) -> u8 #no_bounds_check {
|
|||||||
return crc
|
return crc
|
||||||
}
|
}
|
||||||
|
|
||||||
@(optimization_mode = "speed")
|
@(optimization_mode = "favor_size")
|
||||||
calculate_crc16 :: proc(data: []byte) -> u16 #no_bounds_check {
|
calculate_crc16 :: proc(data: []byte) -> u16 #no_bounds_check {
|
||||||
crc: u16 = 0
|
crc: u16 = 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user