]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - zone.c
Rewritten SVQC stringbuffer saving routines (which is part of yet unfinished databuff...
[xonotic/darkplaces.git] / zone.c
diff --git a/zone.c b/zone.c
index 16386369c21c1694527a74f2a403457fa8f405d7..2c72c113cfb50dd6c30e0a86eaef8665c279c24b 100644 (file)
--- a/zone.c
+++ b/zone.c
@@ -697,44 +697,6 @@ void Mem_ExpandableArray_FreeArray(memexpandablearray_t *l)
        memset(l, 0, sizeof(*l));
 }
 
-// VorteX: hacked Mem_ExpandableArray_AllocRecord, it does allocate record at certain index
-void *Mem_ExpandableArray_AllocRecordAtIndex(memexpandablearray_t *l, size_t index)
-{
-       size_t j;
-       if (index >= l->numarrays)
-       {
-               if (l->numarrays == l->maxarrays)
-               {
-                       memexpandablearray_array_t *oldarrays = l->arrays;
-                       l->maxarrays = max(l->maxarrays * 2, 128);
-                       l->arrays = (memexpandablearray_array_t*) Mem_Alloc(l->mempool, l->maxarrays * sizeof(*l->arrays));
-                       if (oldarrays)
-                       {
-                               memcpy(l->arrays, oldarrays, l->numarrays * sizeof(*l->arrays));
-                               Mem_Free(oldarrays);
-                       }
-               }
-               l->arrays[index].numflaggedrecords = 0;
-               l->arrays[index].data = (unsigned char *) Mem_Alloc(l->mempool, (l->recordsize + 1) * l->numrecordsperarray);
-               l->arrays[index].allocflags = l->arrays[index].data + l->recordsize * l->numrecordsperarray;
-               l->numarrays++;
-       }
-       if (l->arrays[index].numflaggedrecords < l->numrecordsperarray)
-       {
-               for (j = 0;j < l->numrecordsperarray;j++)
-               {
-                       if (!l->arrays[index].allocflags[j])
-                       {
-                               l->arrays[index].allocflags[j] = true;
-                               l->arrays[index].numflaggedrecords++;
-                               memset(l->arrays[index].data + l->recordsize * j, 0, l->recordsize);
-                               return (void *)(l->arrays[index].data + l->recordsize * j);
-                       }
-               }
-       }
-       return NULL;
-}
-
 void *Mem_ExpandableArray_AllocRecord(memexpandablearray_t *l)
 {
        size_t i, j;