Initial import of libucore
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user