took out all that garbarge with global_malloc, the routines are not thread-safe, but who cares