Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arena allocator broken #1582

Closed
shawnl opened this issue Sep 23, 2018 · 1 comment
Closed

Arena allocator broken #1582

shawnl opened this issue Sep 23, 2018 · 1 comment

Comments

@shawnl
Copy link
Contributor

shawnl commented Sep 23, 2018

This code crashes with null pointer dereference:

const std = @import("std");
const heap = std.heap;

pub fn main() !void {
    var direct_allocator = heap.DirectAllocator.init();
    defer direct_allocator.deinit();
    var direct = direct_allocator.allocator;

    var arena_allocator = heap.ArenaAllocator.init(&direct);
    defer arena_allocator.deinit();
    var arena = arena_allocator.allocator;

    var buf = try arena.alloc(u8, 10);
}
@andrewrk
Copy link
Member

This is #591

@ghost ghost mentioned this issue Sep 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants