File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -1662,9 +1662,30 @@ extern fn SDL_ShowSimpleMessageBox(
1662
1662
1663
1663
//--------------------------------------------------------------------------------------------------
1664
1664
//
1665
- // Standard Library Functionality
1665
+ // " Standard Library" Functionality
1666
1666
//
1667
1667
//--------------------------------------------------------------------------------------------------
1668
1668
pub const Bool = c_int ;
1669
1669
pub const False = @as (Bool , 0 );
1670
1670
pub const True = @as (Bool , 1 );
1671
+
1672
+ /// Allocate uinitialized memory.
1673
+ ///
1674
+ /// The allocated memory returned by this function must be freed with SDL_free().
1675
+ ///
1676
+ /// If `size` is 0, it will be set to 1.
1677
+ ///
1678
+ /// If you want to allocate memory aligned to a specific alignment, consider using SDL_aligned_alloc().
1679
+ ///
1680
+ /// Returns a pointer to the allocated memory, or NULL if allocation failed.
1681
+ pub const malloc = SDL_malloc ;
1682
+ extern fn SDL_malloc (isize ) * anyopaque ;
1683
+
1684
+ /// Free allocated memory.
1685
+ /// The pointer is no longer valid after this call and cannot be dereferenced anymore.
1686
+ pub const free = SDL_free ;
1687
+ extern fn SDL_free (* anyopaque ) void ;
1688
+
1689
+ // TODO
1690
+ // - Declare SDL_malloc_func, SDL_calloc_func, SDL_realloc_func and SDL_free_func
1691
+ // - Zig Allocator interface
You can’t perform that action at this time.
0 commit comments