add mem allocator, list, spinlock; make malloc function thread safe.