浏览代码

clear

master
Felix Brendel 5 年前
父节点
当前提交
5550ed849c
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. +6
    -0
      bucket_allocator.hpp

+ 6
- 0
bucket_allocator.hpp 查看文件

@@ -11,6 +11,12 @@ struct Bucket_Allocator {
Array_List<type*> free_list;
type** buckets;

void clear() {
next_index_in_latest_bucket = 0;
next_bucket_index = 0;
free_list.clear();
}

void expand() {
buckets = (type**)realloc(buckets, bucket_count * 2 * sizeof(type*));
bucket_count *= 2;


正在加载...
取消
保存