Remove main
This commit is contained in:
@@ -26,42 +26,3 @@ void uc_slot_free(UCSlotAlloc *restrict sa, void *restrict slot)
|
||||
assert((size_t)slot_index < sa->num_slots);
|
||||
uc_bv_clr_bit(&sa->bitmap, slot_index);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
UC_SLOT_ALLOC_DEF(sa, 24, 1)
|
||||
|
||||
void *p1 = uc_slot_alloc(&sa);
|
||||
printf("%p\n", &sa_memory.memory[0]);
|
||||
printf("%p\n", p1);
|
||||
|
||||
void *p2 = uc_slot_alloc(&sa);
|
||||
printf("%p\n", p2);
|
||||
uc_slot_free(&sa, p1);
|
||||
|
||||
p2 = uc_slot_alloc(&sa);
|
||||
printf("%p\n", p2);
|
||||
|
||||
printf("__malloc__\n");
|
||||
void *v = malloc(24 * (1<<16));
|
||||
UC_SLOT_ALLOC_DEF_EX(sa2, 24, (1<<16), v)
|
||||
char *v2 = NULL;
|
||||
for (int i = 0; i < 1<<16; i++) {
|
||||
char *c = uc_slot_alloc(&sa2);
|
||||
if (c == NULL) {
|
||||
printf("uc_slot_alloc failed at %d\n", i);
|
||||
break;
|
||||
}
|
||||
*c = i;
|
||||
if (i == 0) {
|
||||
v2 = c;
|
||||
}
|
||||
}
|
||||
for (int i = (1<<16) -1 ; i >= 0; i--) {
|
||||
uc_slot_free(&sa2, v2 + 24*i);
|
||||
}
|
||||
free(v);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user