Updated raylib memory pool (markdown)

master
Ray 3 년 전
부모
커밋
079bde40c1
1개의 변경된 파일7개의 추가작업 그리고 7개의 파일을 삭제
  1. +7
    -7
      raylib-memory-pool.md

+ 7
- 7
raylib-memory-pool.md

@ -3,12 +3,12 @@
By Kevin 'Assyrianic' Yonan @ https://github.com/assyrianic
**About**:
The Raylib Memory Pool is a quick, efficient, and minimal free list & stack-based allocator.
The raylib Memory Pool is a quick, efficient, and minimal free list & stack-based allocator.
**Purpose**:
Raylib Memory Pool's purpose is the following list:
raylib Memory Pool's purpose is the following list:
* A quicker, efficient memory allocator alternative to `malloc` and friends.
* Reduce the possibilities of memory leaks for beginner developers using Raylib.
* Reduce the possibilities of memory leaks for beginner developers using raylib.
* Being able to flexibly range check memory if necessary.
**Data Implementation**:
@ -166,11 +166,11 @@ Finally, to get the total amount of memory remaining (to make sure you don't acc
By Kevin 'Assyrianic' Yonan @ https://github.com/assyrianic
**About**:
The Raylib Object Pool is a fast and minimal fixed-size allocator.
The raylib Object Pool is a fast and minimal fixed-size allocator.
**Purpose**:
Raylib Object Pool was created as a complement to the Raylib Memory Pool.
Due to the general purpose nature of Raylib Memory Pool, memory block fragmentations can affect allocation and deallocation speeds. Because of this, the Raylib Object pool succeeds by having no fragmentation and accommodating for allocating fixed-size data while the Raylib memory pool accommodates allocating variadic/differently sized data.
raylib Object Pool was created as a complement to the raylib Memory Pool.
Due to the general purpose nature of raylib Memory Pool, memory block fragmentations can affect allocation and deallocation speeds. Because of this, the raylib Object pool succeeds by having no fragmentation and accommodating for allocating fixed-size data while the raylib memory pool accommodates allocating variadic/differently sized data.
**Implementation**:
The object pool is implemented as a hybrid array-stack of cells that are large enough to hold the size of your data at initialization:
@ -233,7 +233,7 @@ Deallocation itself is also very simple. There's two deallocation functions avai
ObjPool_Free(&vector_pool, origin);
```
Like Raylib memory pool, the Raylib object pool also comes with a convenient clean up function that takes a pointer to an allocated pointer, frees it, and sets the pointer to NULL for you!
Like raylib memory pool, the raylib object pool also comes with a convenient clean up function that takes a pointer to an allocated pointer, frees it, and sets the pointer to NULL for you!
```c
ObjPool_CleanUp(&vector_pool, (void **)&origin);
```

불러오는 중...
취소
저장