Initial import of libucore

This commit is contained in:
Nils O. Selåsdal
2012-10-29 23:07:32 +01:00
commit ed3866e49a
79 changed files with 6181 additions and 0 deletions
+27
View File
@@ -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;
}