added a magic value to check clobbering of the free list

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2103 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper
2002-11-28 14:10:20 +00:00
parent 60d9ed9e3b
commit 3b70f94330
2 changed files with 20 additions and 12 deletions
+7 -3
View File
@@ -1,4 +1,4 @@
/* pools.h
/* pools.h
* simple fixed size block allocator
*/
@@ -21,8 +21,12 @@ struct pool_mem {
benaphore lock;
};
#define FREE_MAGIC 'BORK'
struct free_blk {
char *next;
uint32 magic;
struct free_blk *next;
uint32 magic_check;
};
#define POOL_USES_BENAPHORES 0
@@ -30,7 +34,7 @@ struct free_blk {
struct pool_ctl {
struct pool_mem *list;
char *freelist;
struct free_blk *freelist;
size_t alloc_size;
size_t block_size;
#if POOL_USES_BENAPHORES