diff --git a/include/tr/memory.h b/include/tr/memory.h index fe927f7..53df1ee 100644 --- a/include/tr/memory.h +++ b/include/tr/memory.h @@ -39,11 +39,11 @@ struct memSegment }; /** - * I found this at stanford.edu: + * I found this at stanford.edu: * https://graphics.stanford.edu/~seander/bithacks.html#IntegerLogLookup * * Really cool way of dealing with this. The oneat stanford.edu is slightly - * different as ist deals only with 32bit values. I need a 64bit version + * different as ist deals only with 32bit values. I need a 64bit version * because on a 64bit system size_t is also 64bit and thus it is possible * to allocate that much amount of memory theoretically. */ diff --git a/src/memory.c b/src/memory.c index 7a27a74..88b18ca 100644 --- a/src/memory.c +++ b/src/memory.c @@ -196,7 +196,7 @@ TR_malloc(size_t size) // size if not a multiple of pagesize so bring it to one. idx++; size = idx * psize; - } + } idx += psize_width - MIN_BITS; } else { @@ -297,11 +297,11 @@ char * TR_strdup(const char * src) { char * dup; - + if (NULL == src) { return NULL; } - + dup = TR_malloc(strlen(src)+1); strcpy(dup, src);