![](/media/cache/profiles/98c39996bf1543e974747a2549b3107c.50x50_q85.png)
JVM test
pool.h@9:4ea7773ea2b0, 2013-09-07 (annotated)
- Committer:
- lynxeyed_atsu
- Date:
- Sat Sep 07 04:59:10 2013 +0000
- Revision:
- 9:4ea7773ea2b0
- Parent:
- 7:2a384a077520
added if_icmp* mnemonics
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lynxeyed_atsu | 6:b9d0d96b052f | 1 | // |
lynxeyed_atsu | 6:b9d0d96b052f | 2 | // pool.h |
lynxeyed_atsu | 6:b9d0d96b052f | 3 | // |
lynxeyed_atsu | 6:b9d0d96b052f | 4 | // |
lynxeyed_atsu | 6:b9d0d96b052f | 5 | // Created by atsu on 13/08/20. |
lynxeyed_atsu | 6:b9d0d96b052f | 6 | // |
lynxeyed_atsu | 6:b9d0d96b052f | 7 | // |
lynxeyed_atsu | 6:b9d0d96b052f | 8 | |
lynxeyed_atsu | 6:b9d0d96b052f | 9 | #ifndef POOL_H_ |
lynxeyed_atsu | 6:b9d0d96b052f | 10 | #define POOL_H_ |
lynxeyed_atsu | 5:047542b65d00 | 11 | |
lynxeyed_atsu | 5:047542b65d00 | 12 | #include <stdio.h> |
lynxeyed_atsu | 5:047542b65d00 | 13 | #include <string.h> |
lynxeyed_atsu | 5:047542b65d00 | 14 | #include "device_depend.h" |
lynxeyed_atsu | 5:047542b65d00 | 15 | |
lynxeyed_atsu | 6:b9d0d96b052f | 16 | |
lynxeyed_atsu | 6:b9d0d96b052f | 17 | #define memory_available 1 |
lynxeyed_atsu | 6:b9d0d96b052f | 18 | #define memory_invalid 0 |
lynxeyed_atsu | 9:4ea7773ea2b0 | 19 | #define pool_size 512 // 256 * (sizeof(int)) = 1kByte |
lynxeyed_atsu | 6:b9d0d96b052f | 20 | #define magic_value 0xDEADDEAD |
lynxeyed_atsu | 6:b9d0d96b052f | 21 | //#define USE_MAGIC |
lynxeyed_atsu | 6:b9d0d96b052f | 22 | |
lynxeyed_atsu | 6:b9d0d96b052f | 23 | typedef struct { |
lynxeyed_atsu | 6:b9d0d96b052f | 24 | int *first_pointer; |
lynxeyed_atsu | 6:b9d0d96b052f | 25 | int *next_pointer; |
lynxeyed_atsu | 6:b9d0d96b052f | 26 | int pool_size_all; |
lynxeyed_atsu | 6:b9d0d96b052f | 27 | int available; |
lynxeyed_atsu | 6:b9d0d96b052f | 28 | }pool_all; |
lynxeyed_atsu | 6:b9d0d96b052f | 29 | |
lynxeyed_atsu | 6:b9d0d96b052f | 30 | typedef struct { |
lynxeyed_atsu | 6:b9d0d96b052f | 31 | int **this_pointer; |
lynxeyed_atsu | 6:b9d0d96b052f | 32 | int my_size; |
lynxeyed_atsu | 6:b9d0d96b052f | 33 | int available; |
lynxeyed_atsu | 6:b9d0d96b052f | 34 | #if defined(USE_MAGIC) |
lynxeyed_atsu | 6:b9d0d96b052f | 35 | int magic_num; |
lynxeyed_atsu | 6:b9d0d96b052f | 36 | #endif |
lynxeyed_atsu | 5:047542b65d00 | 37 | }pool_each; |
lynxeyed_atsu | 6:b9d0d96b052f | 38 | |
lynxeyed_atsu | 5:047542b65d00 | 39 | extern int pl_buf[pool_size]; |
lynxeyed_atsu | 5:047542b65d00 | 40 | void pool_init(void); |
lynxeyed_atsu | 5:047542b65d00 | 41 | void pool_free(int *pointr); |
lynxeyed_atsu | 5:047542b65d00 | 42 | int *pool_alloc(int size); |
lynxeyed_atsu | 5:047542b65d00 | 43 | int *pool_realloc(int *pointr, int size); |
lynxeyed_atsu | 5:047542b65d00 | 44 | |
lynxeyed_atsu | 6:b9d0d96b052f | 45 | #endif |
lynxeyed_atsu | 6:b9d0d96b052f | 46 |