динамическое выделение mem
This commit is contained in:
parent
3f1e00dd1e
commit
1a34fea5ff
|
@ -93,14 +93,14 @@ inline void pool_free(void *p)
|
|||
busy_pool = b2;
|
||||
}
|
||||
|
||||
void *mem[MAX_I];
|
||||
|
||||
int main()
|
||||
{
|
||||
unsigned long long i;
|
||||
|
||||
|
||||
init();
|
||||
|
||||
void **mem = malloc(MAX_I * sizeof(void *));
|
||||
|
||||
for (i = 0; i < MAX_I; i++)
|
||||
if (!(mem[i] = pool_alloc())) {
|
||||
|
@ -111,6 +111,8 @@ int main()
|
|||
for (i = 0; i < MAX_I; i++)
|
||||
pool_free(mem[i]);
|
||||
|
||||
free(mem);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue