28 lines
498 B
C
28 lines
498 B
C
#include <string.h>
|
|
#include "ucore/salloc.h"
|
|
|
|
// Intended to be run under valgrind. Should show no errors
|
|
|
|
|
|
int main(int argc, char *argv)
|
|
{
|
|
size_t i;
|
|
SAlloc *s = uc_new_salloc(36 * 100);
|
|
for (i = 0; i < 100; i++) {
|
|
void *p = uc_s_alloc(s, 36);
|
|
memset(p,7,36);
|
|
}
|
|
|
|
uc_free_salloc(s);
|
|
|
|
s = uc_new_salloc(85 * 100);
|
|
for (i = 0; i < 100 * 3; i++) {
|
|
void *p = uc_s_alloc(s, 85);
|
|
memset(p,7,85);
|
|
}
|
|
|
|
uc_free_salloc(s);
|
|
|
|
return 0;
|
|
}
|