Skip to content

Commit

Permalink
Fix typos in comments
Browse files Browse the repository at this point in the history
* blacklst.c: Fix typo ("even though").
* cord/cordbscs.c: Fix typo ("exponentially").
* cord/cordxtra.c: Fix typo ("represented").
* dyn_load.c: Fix typos ("uncollectible", "occurred").
* extra/AmigaOS: Fix typos ("specific", "necessary", "always",
"effectiveness").
* finalize.c: Fix typo ("descendants").
* include/cord.h: Fix typo ("idiosyncrasies").
* include/gc.h: Fix typo ("collectible").
* include/gc_allocator.h: Fix typos ("allocator", "[un]collectible").
* mach_dep.c: Fix typo ("erroneously").
* malloc.c: Fix typos ("[un]collectible", "pointer-free",
"initialization").
* mallocx.c: Fix typos ("largely", "pointer-free", "uncollectible").
* mark.c: Fix typos ("[un]collectible", "even though").
* misc.c: Fix typo ("erroneously").
* os_dep.c: Fix typos ("non-addressable", "happening", "pointer-free").
* tests/test.c: Fix typos ("uncollectible", "reversed").
* tests/test_cpp.cc: Fix typos ("[un]collectible").
* typd_mlc.c: Fix typo ("copyright").
* win32_threads.c: Fix typos ("optimization", "uncollectible").
  • Loading branch information
neleai authored and ivmai committed Jul 11, 2013
1 parent 5f52b60 commit af45302
Show file tree
Hide file tree
Showing 20 changed files with 77 additions and 80 deletions.
2 changes: 1 addition & 1 deletion blacklst.c
Expand Up @@ -21,7 +21,7 @@
* See the definition of page_hash_table in gc_private.h.
* False hits from the stack(s) are much more dangerous than false hits
* from elsewhere, since the former can pin a large object that spans the
* block, eventhough it does not start on the dangerous block.
* block, even though it does not start on the dangerous block.
*/

/*
Expand Down
2 changes: 1 addition & 1 deletion cord/cordbscs.c
Expand Up @@ -570,7 +570,7 @@ int CORD_riter(CORD x, CORD_iter_fn f1, void * client_data)
* The following functions are concerned with balancing cords.
* Strategy:
* Scan the cord from left to right, keeping the cord scanned so far
* as a forest of balanced trees of exponentialy decreasing length.
* as a forest of balanced trees of exponentially decreasing length.
* When a new subtree needs to be added to the forest, we concatenate all
* shorter ones to the new tree in the appropriate order, and then insert
* the result into the forest.
Expand Down
2 changes: 1 addition & 1 deletion cord/cordxtra.c
Expand Up @@ -461,7 +461,7 @@ CORD CORD_from_file_eager(FILE * f)
c = getc(f);
if (c == 0) {
/* Append the right number of NULs */
/* Note that any string of NULs is rpresented in 4 words, */
/* Note that any string of NULs is represented in 4 words, */
/* independent of its length. */
register size_t count = 1;

Expand Down
4 changes: 2 additions & 2 deletions dyn_load.c
Expand Up @@ -335,7 +335,7 @@ STATIC word GC_register_map_entries(char *maps)
/* away pointers in pieces of the stack segment that we */
/* don't scan. We work around this */
/* by treating anything allocated by libpthread as */
/* uncollectable, as we do in some other cases. */
/* uncollectible, as we do in some other cases. */
/* A specifically identified problem is that */
/* thread stacks contain pointers to dynamic thread */
/* vectors, which may be reused due to thread caching. */
Expand Down Expand Up @@ -1116,7 +1116,7 @@ GC_INNER void GC_register_dynamic_libraries(void)
/* Get info about next shared library */
status = shl_get(index, &shl_desc);

/* Check if this is the end of the list or if some error occured */
/* Check if this is the end of the list or if some error occurred */
if (status != 0) {
# ifdef GC_HPUX_THREADS
/* I've seen errno values of 0. The man page is not clear */
Expand Down
14 changes: 7 additions & 7 deletions extra/AmigaOS.c
Expand Up @@ -2,7 +2,7 @@

/******************************************************************
AmigaOS-spesific routines for GC.
AmigaOS-specific routines for GC.
This file is normally included from os_dep.c
******************************************************************/
Expand Down Expand Up @@ -230,10 +230,10 @@ void *(*GC_amiga_allocwrapper_do)(size_t size,void *(*AllocFunction)(size_t size


/******************************************************************
Amiga-spesific routines to obtain memory, and force GC to give
Amiga-specific routines to obtain memory, and force GC to give
back fast-mem whenever possible.
These hacks makes gc-programs go many times faster when
the amiga is low on memory, and are therefore strictly necesarry.
the Amiga is low on memory, and are therefore strictly necessary.
-Kjetil S. Matheussen, 2000.
******************************************************************/
Expand Down Expand Up @@ -331,7 +331,7 @@ char *chipmax;


/*
* Allways set to the last size of memory tried to be allocated.
* Always set to the last size of memory tried to be allocated.
* Needed to ensure allocation when the size is bigger than 100000.
*
*/
Expand Down Expand Up @@ -429,15 +429,15 @@ void *GC_amiga_rec_alloc(size_t size,void *(*AllocFunction)(size_t size2),const
#endif


/* The allocating-functions defined inside the amiga-blocks in gc.h is called
/* The allocating-functions defined inside the Amiga-blocks in gc.h is called
* via these functions.
*/


void *GC_amiga_allocwrapper_any(size_t size,void *(*AllocFunction)(size_t size2)){
void *ret,*ret2;

GC_amiga_dontalloc=TRUE; // Pretty tough thing to do, but its indeed necesarry.
GC_amiga_dontalloc=TRUE; // Pretty tough thing to do, but its indeed necessary.
latestsize=size;

ret=(*AllocFunction)(size);
Expand Down Expand Up @@ -471,7 +471,7 @@ void *GC_amiga_allocwrapper_any(size_t size,void *(*AllocFunction)(size_t size2)
#ifdef GC_AMIGA_RETRY
else{
/* We got chip-mem. Better try again and again and again etc., we might get fast-mem sooner or later... */
/* Using gctest to check the effectiviness of doing this, does seldom give a very good result. */
/* Using gctest to check the effectiveness of doing this, does seldom give a very good result. */
/* However, real programs doesn't normally rapidly allocate and deallocate. */
// printf("trying to force... %d bytes... ",size);
if(
Expand Down
2 changes: 1 addition & 1 deletion finalize.c
Expand Up @@ -20,7 +20,7 @@

/* Type of mark procedure used for marking from finalizable object. */
/* This procedure normally does not mark the object, only its */
/* descendents. */
/* descendants. */
typedef void (* finalization_mark_proc)(ptr_t /* finalizable_obj_ptr */);

#define HASH3(addr,size,log_size) \
Expand Down
2 changes: 1 addition & 1 deletion include/cord.h
Expand Up @@ -326,7 +326,7 @@ CORD_API size_t CORD_rchr(CORD x, size_t i, int c);
/* the correct buffer size. */
/* 4. Most of the conversions are implement through the native */
/* vsprintf. Hence they are usually no faster, and */
/* idiosyncracies of the native printf are preserved. However, */
/* idiosyncrasies of the native printf are preserved. However, */
/* CORD arguments to CORD_sprintf and CORD_vsprintf are NOT copied; */
/* the result shares the original structure. This may make them */
/* very efficient in some unusual applications. */
Expand Down
6 changes: 3 additions & 3 deletions include/gc.h
Expand Up @@ -401,8 +401,8 @@ GC_API void GC_CALL GC_init(void);
/* new object is cleared. GC_malloc_stubborn promises that no changes */
/* to the object will occur after GC_end_stubborn_change has been */
/* called on the result of GC_malloc_stubborn. GC_malloc_uncollectable */
/* allocates an object that is scanned for pointers to collectable */
/* objects, but is not itself collectable. The object is scanned even */
/* allocates an object that is scanned for pointers to collectible */
/* objects, but is not itself collectible. The object is scanned even */
/* if it does not appear to be reachable. GC_malloc_uncollectable and */
/* GC_free called on the resulting object implicitly update */
/* GC_non_gc_bytes appropriately. */
Expand Down Expand Up @@ -954,7 +954,7 @@ GC_API void GC_CALL GC_debug_register_finalizer(void * /* obj */,
/* allocated by GC_malloc or friends. Obj may also be */
/* NULL or point to something outside GC heap (in this */
/* case, fn is ignored, *ofn and *ocd are set to NULL). */
/* Note that any garbage collectable object referenced */
/* Note that any garbage collectible object referenced */
/* by cd will be considered accessible until the */
/* finalizer is invoked. */

Expand Down
6 changes: 3 additions & 3 deletions include/gc_allocator.h
Expand Up @@ -24,12 +24,12 @@

/*
* This implements standard-conforming allocators that interact with
* the garbage collector. Gc_alloctor<T> allocates garbage-collectable
* the garbage collector. Gc_allocator<T> allocates garbage-collectible
* objects of type T. Traceable_allocator<T> allocates objects that
* are not themselves garbage collected, but are scanned by the
* collector for pointers to collectable objects. Traceable_alloc
* collector for pointers to collectible objects. Traceable_alloc
* should be used for explicitly managed STL containers that may
* point to collectable objects.
* point to collectible objects.
*
* This code was derived from an earlier version of the GNU C++ standard
* library, which itself was derived from the SGI STL implementation.
Expand Down
42 changes: 21 additions & 21 deletions include/gc_cpp.h
Expand Up @@ -24,43 +24,43 @@ basic facilities similar to those described in "Safe, Efficient
Garbage Collection for C++", by John R. Elis and David L. Detlefs
(ftp://ftp.parc.xerox.com/pub/ellis/gc).
All heap-allocated objects are either "collectable" or
"uncollectable". Programs must explicitly delete uncollectable
All heap-allocated objects are either "collectible" or
"uncollectible". Programs must explicitly delete uncollectible
objects, whereas the garbage collector will automatically delete
collectable objects when it discovers them to be inaccessible.
Collectable objects may freely point at uncollectable objects and vice
collectible objects when it discovers them to be inaccessible.
Collectible objects may freely point at uncollectible objects and vice
versa.
Objects allocated with the built-in "::operator new" are uncollectable.
Objects allocated with the built-in "::operator new" are uncollectible.
Objects derived from class "gc" are collectable. For example:
Objects derived from class "gc" are collectible. For example:
class A: public gc {...};
A* a = new A; // a is collectable.
A* a = new A; // a is collectible.
Collectable instances of non-class types can be allocated using the GC
Collectible instances of non-class types can be allocated using the GC
(or UseGC) placement:
typedef int A[ 10 ];
A* a = new (GC) A;
Uncollectable instances of classes derived from "gc" can be allocated
Uncollectible instances of classes derived from "gc" can be allocated
using the NoGC placement:
class A: public gc {...};
A* a = new (NoGC) A; // a is uncollectable.
A* a = new (NoGC) A; // a is uncollectible.
The new(PointerFreeGC) syntax allows the allocation of collectable
The new(PointerFreeGC) syntax allows the allocation of collectible
objects that are not scanned by the collector. This useful if you
are allocating compressed data, bitmaps, or network packets. (In
the latter case, it may remove danger of unfriendly network packets
intentionally containing values that cause spurious memory retention.)
Both uncollectable and collectable objects can be explicitly deleted
Both uncollectible and collectible objects can be explicitly deleted
with "delete", which invokes an object's destructors and frees its
storage immediately.
A collectable object may have a clean-up function, which will be
A collectible object may have a clean-up function, which will be
invoked when the collector discovers the object to be inaccessible.
An object derived from "gc_cleanup" or containing a member derived
from "gc_cleanup" has a default clean-up function that invokes the
Expand All @@ -79,7 +79,7 @@ B, B is considered accessible. After A's clean-up is invoked and its
storage released, B will then become inaccessible and will have its
clean-up invoked. If A points at B and B points to A, forming a
cycle, then that's considered a storage leak, and neither will be
collectable. See the interface gc.h for low-level facilities for
collectible. See the interface gc.h for low-level facilities for
handling such cycles of objects with clean-up.
The collector cannot guarantee that it will find all inaccessible
Expand All @@ -96,14 +96,14 @@ add -DGC_OPERATOR_NEW_ARRAY to the Makefile.
If your compiler doesn't support "operator new[]", beware that an
array of type T, where T is derived from "gc", may or may not be
allocated as a collectable object (it depends on the compiler). Use
the explicit GC placement to make the array collectable. For example:
allocated as a collectible object (it depends on the compiler). Use
the explicit GC placement to make the array collectible. For example:
class A: public gc {...};
A* a1 = new A[ 10 ]; // collectable or uncollectable?
A* a2 = new (GC) A[ 10 ]; // collectable
A* a1 = new A[ 10 ]; // collectible or uncollectible?
A* a2 = new (GC) A[ 10 ]; // collectible.
3. The destructors of collectable arrays of objects derived from
3. The destructors of collectible arrays of objects derived from
"gc_cleanup" will not be invoked properly. For example:
class A: public gc_cleanup {...};
Expand Down Expand Up @@ -250,10 +250,10 @@ inline void* operator new( size_t size, GC_NS_QUALIFY(GCPlacement) gcp,
GC_NS_QUALIFY(GCCleanUpFunc) cleanup = 0,
void* clientData = 0 );
/*
Allocates a collectable or uncollected object, according to the
Allocates a collectible or uncollectible object, according to the
value of "gcp".
For collectable objects, if "cleanup" is non-null, then when the
For collectible objects, if "cleanup" is non-null, then when the
allocated object "obj" becomes inaccessible, the collector will
invoke the function "cleanup( obj, clientData )" but will not
invoke the object's destructors. It is an error to explicitly
Expand Down
2 changes: 1 addition & 1 deletion mach_dep.c
Expand Up @@ -105,7 +105,7 @@

# if defined(M68K) && defined(AMIGA)
/* This function is not static because it could also be */
/* errorneously defined in .S file, so this error would be caught */
/* erroneously defined in .S file, so this error would be caught */
/* by the linker. */
void GC_push_regs(void)
{
Expand Down
19 changes: 8 additions & 11 deletions malloc.c
Expand Up @@ -222,7 +222,7 @@ GC_API void * GC_CALL GC_generic_malloc(size_t lb, int k)
}
}

/* Allocate lb bytes of atomic (pointerfree) data */
/* Allocate lb bytes of atomic (pointer-free) data. */
#ifdef THREAD_LOCAL_ALLOC
GC_INNER void * GC_core_malloc_atomic(size_t lb)
#else
Expand Down Expand Up @@ -288,7 +288,7 @@ GC_API void * GC_CALL GC_generic_malloc(size_t lb, int k)
}
}

/* Allocate lb bytes of pointerful, traced, but not collectable data */
/* Allocate lb bytes of pointerful, traced, but not collectible data. */
GC_API void * GC_CALL GC_malloc_uncollectable(size_t lb)
{
void *op;
Expand Down Expand Up @@ -365,13 +365,10 @@ void * malloc(size_t lb)
/* But any decent compiler should reduce the extra procedure call */
/* to at most a jump instruction in this case. */
# if defined(I386) && defined(GC_SOLARIS_THREADS)
/*
* Thread initialisation can call malloc before
* we're ready for it.
* It's not clear that this is enough to help matters.
* The thread implementation may well call malloc at other
* inopportune times.
*/
/* Thread initialization can call malloc before we're ready for. */
/* It's not clear that this is enough to help matters. */
/* The thread implementation may well call malloc at other */
/* inopportune times. */
if (!EXPECT(GC_is_initialized, TRUE)) return sbrk(lb);
# endif /* I386 && GC_SOLARIS_THREADS */
return((void *)REDIRECT_MALLOC(lb));
Expand Down Expand Up @@ -417,7 +414,7 @@ void * calloc(size_t n, size_t lb)
return NULL;
# if defined(GC_LINUX_THREADS) /* && !defined(USE_PROC_FOR_LIBRARIES) */
/* libpthread allocated some memory that is only pointed to by */
/* mmapped thread stacks. Make sure it's not collectable. */
/* mmapped thread stacks. Make sure it is not collectible. */
{
static GC_bool lib_bounds_set = FALSE;
ptr_t caller = (ptr_t)__builtin_return_address(0);
Expand Down Expand Up @@ -592,7 +589,7 @@ GC_API void GC_CALL GC_free(void * p)
{
/* Don't bother with initialization checks. If nothing */
/* has been initialized, the check fails, and that's safe, */
/* since we haven't allocated uncollectable objects either. */
/* since we have not allocated uncollectible objects neither. */
ptr_t caller = (ptr_t)__builtin_return_address(0);
/* This test does not need to ensure memory visibility, since */
/* the bounds will be set when/if we create another thread. */
Expand Down
4 changes: 2 additions & 2 deletions mallocx.c
Expand Up @@ -480,7 +480,7 @@ GC_API void * GC_CALL GC_memalign(size_t align, size_t lb)
return result;
}

/* This one exists largerly to redirect posix_memalign for leaks finding. */
/* This one exists largely to redirect posix_memalign for leaks finding. */
GC_API int GC_CALL GC_posix_memalign(void **memptr, size_t align, size_t lb)
{
/* Check alignment properly. */
Expand All @@ -503,7 +503,7 @@ GC_API int GC_CALL GC_posix_memalign(void **memptr, size_t align, size_t lb)
}

#ifdef ATOMIC_UNCOLLECTABLE
/* Allocate lb bytes of pointerfree, untraced, uncollectable data */
/* Allocate lb bytes of pointer-free, untraced, uncollectible data */
/* This is normally roughly equivalent to the system malloc. */
/* But it may be useful if malloc is redefined. */
GC_API void * GC_CALL GC_malloc_atomic_uncollectable(size_t lb)
Expand Down
10 changes: 5 additions & 5 deletions mark.c
Expand Up @@ -130,7 +130,7 @@ GC_INNER GC_bool GC_mark_stack_too_small = FALSE;
static struct hblk * scan_ptr;

STATIC GC_bool GC_objects_are_marked = FALSE;
/* Are there collectable marked objects in the heap? */
/* Are there collectible marked objects in the heap? */

/* Is a collection in progress? Note that this can return true in the */
/* nonincremental case, if a collection has been abandoned and the */
Expand All @@ -149,7 +149,7 @@ GC_INNER void GC_clear_hdr_marks(hdr *hhdr)
hhdr -> hb_n_marks = 0;
}

/* Set all mark bits in the header. Used for uncollectable blocks. */
/* Set all mark bits in the header. Used for uncollectible blocks. */
GC_INNER void GC_set_hdr_marks(hdr *hhdr)
{
unsigned i;
Expand Down Expand Up @@ -284,7 +284,7 @@ GC_INNER void GC_initiate_gc(void)
STATIC struct hblk * GC_push_next_marked(struct hblk *h);
/* Ditto, but also mark from clean pages. */
STATIC struct hblk * GC_push_next_marked_uncollectable(struct hblk *h);
/* Ditto, but mark only from uncollectable pages. */
/* Ditto, but mark only from uncollectible pages. */

static void alloc_mark_stack(size_t);

Expand Down Expand Up @@ -991,7 +991,7 @@ STATIC void GC_do_local_mark(mse *local_mark_stack, mse *local_top)
/* Try to share the load, since the main stack is empty, */
/* and helper threads are waiting for a refill. */
/* The entries near the bottom of the stack are likely */
/* to require more work. Thus we return those, eventhough */
/* to require more work. Thus we return those, even though */
/* it's harder. */
mse * new_bottom = local_mark_stack
+ (local_top - local_mark_stack)/2;
Expand Down Expand Up @@ -1866,7 +1866,7 @@ STATIC struct hblk * GC_push_next_marked(struct hblk *h)
}
#endif /* !GC_DISABLE_INCREMENTAL */

/* Similar to above, but for uncollectable pages. Needed since we */
/* Similar to above, but for uncollectible pages. Needed since we */
/* do not clear marks for such pages, even for full collections. */
STATIC struct hblk * GC_push_next_marked_uncollectable(struct hblk *h)
{
Expand Down
2 changes: 1 addition & 1 deletion misc.c
Expand Up @@ -323,7 +323,7 @@ GC_INNER void GC_extend_size_map(size_t i)
void *GC_clear_stack_inner(void *, ptr_t);
#else
/* Clear the stack up to about limit. Return arg. This function is */
/* not static because it could also be errorneously defined in .S */
/* not static because it could also be erroneously defined in .S */
/* file, so this error would be caught by the linker. */
void * GC_clear_stack_inner(void *arg, ptr_t limit)
{
Expand Down

0 comments on commit af45302

Please sign in to comment.