comparison include/jeffpc/mem.h @ 794:d018af7c979c

slab: make struct mem_cache private Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Sun, 15 Mar 2020 15:52:09 +0200
parents e7ac3c21c816
children
comparison
equal deleted inserted replaced
793:599751d10ee3 794:d018af7c979c
1 /* 1 /*
2 * Copyright (c) 2015-2018 Josef 'Jeff' Sipek <jeffpc@josefsipek.net> 2 * Copyright (c) 2015-2020 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy 4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal 5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights 6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
68 68
69 /* 69 /*
70 * slab allocator 70 * slab allocator
71 */ 71 */
72 72
73 struct mem_cache { 73 struct mem_cache;
74 size_t size;
75 size_t align;
76 };
77 74
78 extern struct mem_cache *mem_cache_create(char *name, size_t size, size_t align); 75 extern struct mem_cache *mem_cache_create(char *name, size_t size, size_t align);
79 extern void mem_cache_destroy(struct mem_cache *cache); 76 extern void mem_cache_destroy(struct mem_cache *cache);
80 77
81 extern void *mem_cache_alloc(struct mem_cache *cache); 78 extern void *mem_cache_alloc(struct mem_cache *cache);