2D Run-and-gun shooter inspired by One Man's Doomsday, Counter-Strike, and Metal Slug.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

43 lines
772 B

  1. #ifndef IZ_POOL_H
  2. #define IZ_POOL_H
  3. #include "../../common/IZ_common.h"
  4. #include "../../log/IZ_log.h"
  5. #include "../../stdinc/IZ_string.h"
  6. #include "../../stdinc/IZ_stdlib.h"
  7. #include "../data/IZ_list.h"
  8. #define POOL_MAX_SIZE (1llu << 26) // 64MB
  9. struct IZ_Pool;
  10. typedef struct {
  11. size_t size;
  12. u64 priority;
  13. u64 timestamp;
  14. } IZ_PoolAllocationArgs;
  15. typedef struct {
  16. void* pointer;
  17. IZ_PoolAllocationArgs args;
  18. struct IZ_Pool* pool;
  19. } IZ_PoolItem;
  20. typedef struct IZ_Pool {
  21. IZ_List items;
  22. u64 next_address;
  23. size_t allocated_memory;
  24. size_t max_size;
  25. void* memory;
  26. } IZ_Pool;
  27. void IZ_PoolInitialize(IZ_Pool*, size_t);
  28. IZ_PoolItem* IZ_PoolAllocate(IZ_Pool*, IZ_PoolAllocationArgs);
  29. void IZ_PoolDeallocate(IZ_PoolItem*);
  30. void IZ_PoolTeardown(IZ_Pool*);
  31. #endif