(asn1buf_expand): If pre-allocating memory for future use, store
proper end of buffer.
This was a big performance hit in asn.1 routines as every time it tried to
decode an octet, 200 bytes were allocated (for future use), but the
buffer structure pnly thought that one byte was allocated and the next
time through would try to allocate memory again.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8553
dc483132-0cff-0310-8789-
dd5450dbe970
+Thu Jun 27 10:31:34 1996 Ezra Peisach <epeisach@kangaroo.mit.edu>
+
+ * asn1buf.c (asn12krb5_buf): Initialize magic fields of structure.
+ (asn1buf_expand): If pre-allocating memory for future use, store
+ proper end of buffer.
+
Wed Jun 12 14:25:11 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>
* asn1_k_encode.h, asn1_k_decode.h: Add prototypes for the SAM
int i;
*code = (krb5_data*)calloc(1,sizeof(krb5_data));
if(*code == NULL) return ENOMEM;
+ (*code)->magic = KV5M_DATA;
(*code)->data = NULL;
(*code)->length = 0;
(*code)->length = asn1buf_len(buf);
inc : STANDARD_INCREMENT))
* sizeof(asn1_octet));
if(buf->base == NULL) return ENOMEM;
- buf->bound = (buf->base) + bound_offset + inc;
+ buf->bound = (buf->base) + bound_offset + (inc > STANDARD_INCREMENT ?
+ inc : STANDARD_INCREMENT);
buf->next = (buf->base) + next_offset;
return 0;
}