File tree Expand file tree Collapse file tree 1 file changed +0
-25
lines changed
Expand file tree Collapse file tree 1 file changed +0
-25
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,6 @@ pub fn main() !void {
44 try FixedBufferAllocator .main ();
55 try ThreadSafeFixedBufferAllocator .main ();
66 try ArenaAllocator .main ();
7- if (builtin .os .tag == .windows ) {
8- try HeapAllocator .main ();
9- }
107 try c_allocaotr .main ();
118 try page_allocator .main ();
129 try StackFallbackAllocator .main ();
@@ -119,28 +116,6 @@ const ArenaAllocator = struct {
119116 // #endregion ArenaAllocator
120117};
121118
122- const HeapAllocator = struct {
123- // #region HeapAllocator
124- const std = @import ("std" );
125-
126- pub fn main () ! void {
127- // 获取分配器模型
128- var heap = std .heap .HeapAllocator .init ();
129- // 善后工作,但有一点需要注意
130- // 这个善后工作只有在你手动指定 heapallocaotr 的 heap_handle 字段时,才有效
131- defer heap .deinit ();
132-
133- // 获取分配器
134- const allocator = heap .allocator ();
135-
136- // 分配内存
137- const num = try allocator .alloc (u8 , 1 );
138- // free 内存
139- defer allocator .free (num );
140- }
141- // #endregion HeapAllocator
142- };
143-
144119const c_allocaotr = struct {
145120 // #region c_allocator
146121 const std = @import ("std" );
You can’t perform that action at this time.
0 commit comments