On Tue, Mar 23, 2010 at 19:43, Shawn O. Pearce <spearce@xxxxxxxxxxx> wrote: > Fredrik Kuivinen <frekui@xxxxxxxxx> wrote: >> +static int multiple_threads; >> +#ifndef NO_PTHREADS >> +int xpthread_create(pthread_t *thread, const pthread_attr_t *attr, >> + void *(*start_routine)(void*), void *arg) >> +{ >> + multiple_threads = 1; >> + return pthread_create(thread, attr, start_routine, arg); >> +} >> +#endif >> + >> void *xmalloc(size_t size) >> { >> void *ret = malloc(size); >> if (!ret && !size) >> ret = malloc(1); >> - if (!ret) { >> + if (!ret && !multiple_threads) { >> release_pack_memory(size, -1); > > So by "make thread safe" you really mean "disable release of > least-frequently used pack windows once any thread starts". Yes. > If that is what we are doing, disabling the release of pack windows > when malloc fails, why can't we do that all of the time? The idea was that most git programs are single threaded, so they can still benefit from releasing the pack windows when they are low on memory. - Fredrik -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html