Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmake/AwsCFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function(aws_set_common_properties target)
list(APPEND AWS_C_FLAGS /DAWS_SUPPORT_WIN7=1)
endif()

# Set MSVC runtime libary.
# Set MSVC runtime library.
# Note: there are other ways of doing this if we bump our CMake minimum to 3.14+
# See: https://cmake.org/cmake/help/latest/policy/CMP0091.html
if (AWS_STATIC_MSVC_RUNTIME_LIBRARY OR STATIC_CRT)
Expand Down Expand Up @@ -257,7 +257,7 @@ function(aws_set_common_properties target)
# We do this so that backtraces are more likely to show function names.
# We mostly use backtraces to diagnose memory leaks.
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
# And dont hide symbols on anything pre GCC 5.0 (Visibility support was not great on older compilers and some libraries didnt annotate visibility -
# And don't hide symbols on anything pre GCC 5.0 (Visibility support was not great on older compilers and some libraries didn't annotate visibility -
# looking at you jni, which does not annotate on gcc less than 4.2. Mixing no annotation and hidden symbols leads to unexpected failures.).
if (NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "5.0"))
set_target_properties(${target} PROPERTIES C_VISIBILITY_PRESET hidden CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN ON)
Expand Down
2 changes: 1 addition & 1 deletion include/aws/common/array_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ AWS_COMMON_API
int aws_array_list_ensure_capacity(struct aws_array_list *AWS_RESTRICT list, size_t index);

/**
* Copies the the memory pointed to by val into the array at index. If in dynamic mode, the size will grow by a factor
* Copies the memory pointed to by val into the array at index. If in dynamic mode, the size will grow by a factor
* of two when the array is full. In static mode, AWS_ERROR_INVALID_INDEX will be raised if the index is past the bounds
* of the array.
*/
Expand Down
6 changes: 3 additions & 3 deletions include/aws/common/atomics_msvc.inl
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ AWS_EXTERN_C_BEGIN
* This means more permissible memory ordering allowed between stores and loads.
*
* Thus ARM port will need more hardware fences/barriers to assure developer intent.
* Memory barriers will prevent reordering stores and loads accross them depending on their type
* Memory barriers will prevent reordering stores and loads across them depending on their type
* (read write, write only, read only ...)
*
* For more information about ARM64 memory ordering,
* see https://developer.arm.com/documentation/102336/0100/Memory-ordering
* For more information about Memory barriers,
* see https://developer.arm.com/documentation/102336/0100/Memory-barriers
* For more information about Miscosoft Interensic ARM64 APIs,
* For more information about Microsoft Intrinsic ARM64 APIs,
* see https://learn.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=msvc-170
* Note: wrt _Interlocked[Op]64 is the same for ARM64 and x64 processors
*/
Expand All @@ -96,7 +96,7 @@ typedef long long aws_atomic_impl_int_t;
# define AWS_R_BARRIER() __dmb(_ARM64_BARRIER_LD)
/* Hardware Write barrier, prevents all memory operations to cross the barrier downwards */
# define AWS_W_BARRIER() __dmb(_ARM64_BARRIER_ST)
/* Software barrier, prevents the compiler from reodering the operations across the barrier */
/* Software barrier, prevents the compiler from reordering the operations across the barrier */
# define AWS_SW_BARRIER() _ReadWriteBarrier();
#else
/* hardware barriers, do nothing on x86 since it has a strong memory model
Expand Down
2 changes: 1 addition & 1 deletion include/aws/common/byte_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ int aws_byte_buf_append_null_terminator(struct aws_byte_buf *buf);
/**
* Attempts to increase the capacity of a buffer to the requested capacity
*
* If the the buffer's capacity is currently larger than the request capacity, the
* If the buffer's capacity is currently larger than the request capacity, the
* function does nothing (no shrink is performed).
*/
AWS_COMMON_API
Expand Down
2 changes: 1 addition & 1 deletion include/aws/common/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct aws_cache_vtable {
};

/**
* Base stucture for caches, used the linked hash table implementation.
* Base structure for caches, used the linked hash table implementation.
*/
struct aws_cache {
struct aws_allocator *allocator;
Expand Down
6 changes: 3 additions & 3 deletions include/aws/common/cbor.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ AWS_COMMON_API
const char *aws_cbor_type_cstr(enum aws_cbor_type type);

/**
* @brief Create a new cbor encoder. Creating a encoder with a temporay buffer.
* @brief Create a new cbor encoder. Creating an encoder with a temporary buffer.
* Every aws_cbor_encoder_write_* will encode directly into the buffer to follow the encoded data.
*
* @param allocator
Expand Down Expand Up @@ -285,12 +285,12 @@ void aws_cbor_encoder_write_indef_map_start(struct aws_cbor_encoder *encoder);
* - If the next element type only accept what expected, `aws_cbor_decoder_pop_next_*`
* - If the next element type accept different type, invoke `aws_cbor_decoder_peek_type` first, then based on the type
* to invoke corresponding `aws_cbor_decoder_pop_next_*`
* - If the next element type doesn't have corrsponding value, specifically: AWS_CBOR_TYPE_NULL,
* - If the next element type doesn't have corresponding value, specifically: AWS_CBOR_TYPE_NULL,
* AWS_CBOR_TYPE_UNDEFINED, AWS_CBOR_TYPE_INF_*_START, AWS_CBOR_TYPE_BREAK, call
* `aws_cbor_decoder_consume_next_single_element` to consume it and continues for further decoding.
* - To ignore the next data item (the element and the content of it), `aws_cbor_decoder_consume_next_whole_data_item`
*
* Note: it's caller's responsibilty to keep the src outlive the decoder.
* Note: it's caller's responsibility to keep the src alive to outlive the decoder.
*
* @param allocator
* @param src The src data to decode from.
Expand Down
2 changes: 1 addition & 1 deletion include/aws/common/hash_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ typedef uint64_t(aws_hash_fn)(const void *key);
* keys, but note that the same type is used for a function that compares
* two hash table values in aws_hash_table_eq.
*
* Equality functions used in a hash table must be be reflexive (a == a),
* Equality functions used in a hash table must be reflexive (a == a),
* symmetric (a == b => b == a), transitive (a == b, b == c => a == c)
* and consistent (result does not change with time).
*/
Expand Down
6 changes: 3 additions & 3 deletions include/aws/common/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ struct aws_json_value *aws_json_value_get_from_object(const struct aws_json_valu
/**
* Returns the aws_json_value at the given key.
* Note: same as aws_json_value_get_from_object but with key as const char *.
* Prefer this method is you have a key thats already a valid char * as it is likely to be faster.
* Prefer this method if you have a key that's already a valid char * as it is likely to be faster.
* @param object The object aws_json_value you want to get the value from.
* @param key The key that the aws_json_value is at. Is case sensitive.
* @return The aws_json_value at the given key, otherwise NULL.
Expand All @@ -205,7 +205,7 @@ bool aws_json_value_has_key(const struct aws_json_value *object, struct aws_byte
/**
* Checks if there is a aws_json_value at the given key.
* Note: same as aws_json_value_has_key but with key as const char *.
* Prefer this method is you have a key thats already a valid char * as it is likely to be faster.
* Prefer this method if you have a key that's already a valid char * as it is likely to be faster.
* @param object The value aws_json_value you want to check a key in.
* @param key The key that you want to check. Is case sensitive.
* @return True if a aws_json_value is found.
Expand All @@ -228,7 +228,7 @@ int aws_json_value_remove_from_object(struct aws_json_value *object, struct aws_
/**
* Removes the aws_json_value at the given key.
* Note: same as aws_json_value_remove_from_object but with key as const char *.
* Prefer this method is you have a key thats already a valid char * as it is likely to be faster.
* Prefer this method if you have a key that's already a valid char * as it is likely to be faster.
* @param object The object aws_json_value you want to remove a aws_json_value in.
* @param key The key that the aws_json_value is at. Is case sensitive.
* @return AWS_OP_SUCCESS if the aws_json_value was removed.
Expand Down
2 changes: 1 addition & 1 deletion include/aws/common/math.cbmc.inl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

AWS_EXTERN_C_BEGIN

/* This header does safe operations. Supressing the checks within these functions
/* This header does safe operations. Suppressing the checks within these functions
* avoids unnecessary CBMC assertions
*/
#pragma CPROVER check push
Expand Down
2 changes: 1 addition & 1 deletion include/aws/common/priority_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ AWS_EXTERN_C_BEGIN

/**
* Initializes a priority queue struct for use. This mode will grow memory automatically (exponential model)
* Default size is the inital size of the queue
* Default size is the initial size of the queue
* item_size is the size of each element in bytes. Mixing items types is not supported by this API.
* pred is the function that will be used to determine priority.
*/
Expand Down
4 changes: 2 additions & 2 deletions include/aws/common/private/byte_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ AWS_COMMON_API size_t aws_nospec_mask(size_t index, size_t bound);
/**
* Expand the buffer appropriately to meet the requested capacity.
*
* If the the buffer's capacity is currently larger than the request capacity, the
* If the buffer's capacity is currently larger than the request capacity, the
* function does nothing (no shrink is performed).
*/
AWS_COMMON_API
Expand All @@ -28,7 +28,7 @@ int aws_byte_buf_reserve_smart(struct aws_byte_buf *buffer, size_t requested_cap
* Convenience function that attempts to increase the capacity of a buffer relative to the current
* length appropriately.
*
* If the the buffer's capacity is currently larger than the request capacity, the
* If the buffer's capacity is currently larger than the request capacity, the
* function does nothing (no shrink is performed).
*/
AWS_COMMON_API
Expand Down
2 changes: 1 addition & 1 deletion include/aws/common/private/lookup3.inl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if SELF_TEST is defined. You can use this free for any purpose. It's in
the public domain. It has no warranty.

You probably want to use hashlittle(). hashlittle() and hashbig()
hash byte arrays. hashlittle() is is faster than hashbig() on
hash byte arrays. hashlittle() is faster than hashbig() on
little-endian machines. Intel and AMD are little-endian machines.
On second thought, you probably want hashlittle2(), which is identical to
hashlittle() except it returns two 32-bit hashes for the price of one.
Expand Down
14 changes: 7 additions & 7 deletions include/aws/common/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ AWS_PUSH_SANE_WARNING_LEVEL
* Use the aws_string_bytes function to access the data bytes. A null byte is
* always included immediately after the data but not counted in the length, so
* that the output of aws_string_bytes can be treated as a C-string in cases
* where none of the the data bytes are null.
* where none of the data bytes are null.
*
* Note that the fields of this structure are const; this ensures not only that
* they cannot be modified, but also that you can't assign the structure using
Expand Down Expand Up @@ -69,7 +69,7 @@ AWS_EXTERN_C_BEGIN

#ifdef AWS_OS_WINDOWS
/**
* For windows only. Converts `to_convert` to a windows whcar format (UTF-16) for use with windows OS interop.
* For windows only. Converts `to_convert` to a windows wchar format (UTF-16) for use with windows OS interop.
*
* Note: `to_convert` is assumed to be UTF-8 or ASCII.
*
Expand All @@ -80,7 +80,7 @@ AWS_COMMON_API struct aws_wstring *aws_string_convert_to_wstring(
const struct aws_string *to_convert);

/**
* For windows only. Converts `to_convert` to a windows whcar format (UTF-16) for use with windows OS interop.
* For windows only. Converts `to_convert` to a windows wchar format (UTF-16) for use with windows OS interop.
*
* Note: `to_convert` is assumed to be UTF-8 or ASCII.
*
Expand All @@ -97,7 +97,7 @@ AWS_COMMON_API
void aws_wstring_destroy(struct aws_wstring *str);

/**
* For windows only. Converts `to_convert` from a windows whcar format (UTF-16) to UTF-8.
* For windows only. Converts `to_convert` from a windows wchar format (UTF-16) to UTF-8.
*
* Note: `to_convert` is assumed to be wchar already.
*
Expand All @@ -108,7 +108,7 @@ AWS_COMMON_API struct aws_string *aws_string_convert_from_wchar_str(
const struct aws_wstring *to_convert);

/**
* For windows only. Converts `to_convert` from a windows whcar format (UTF-16) to UTF-8.
* For windows only. Converts `to_convert` from a windows wchar format (UTF-16) to UTF-8.
*
* Note: `to_convert` is assumed to be wchar already.
*
Expand All @@ -119,7 +119,7 @@ AWS_COMMON_API struct aws_string *aws_string_convert_from_wchar_byte_cursor(
const struct aws_byte_cursor *to_convert);

/**
* For windows only. Converts `to_convert` from a windows whcar format (UTF-16) to UTF-8.
* For windows only. Converts `to_convert` from a windows wchar format (UTF-16) to UTF-8.
*
* Note: `to_convert` is assumed to be wchar already.
*
Expand Down Expand Up @@ -285,7 +285,7 @@ int aws_array_list_comparator_string(const void *a, const void *b);
* argument that points to constant memory and has data bytes containing the
* string literal in the second argument.
*
* GCC allows direct initilization of structs with variable length final fields
* GCC allows direct initialization of structs with variable length final fields
* However, this might not be portable, so we can do this instead
* This will have to be updated whenever the aws_string structure changes
*/
Expand Down
14 changes: 7 additions & 7 deletions scripts/appverifier_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"0x0B": "AppVerifier could not determine any particular type of corruption for the block. "
"Generally means heap points to non-accessible memory area",
"0x0C": "AppVerifier could not determine any particular type of corruption for the block. "
"Generally happens if during heap free operation you pass an address that poins to a non-accessible memory area. "
"Generally happens if during heap free operation you pass an address that points to a non-accessible memory area. "
"Can also occur with double free situations",
"0x0D": "Block of memory is written to after being freed",
"0x0E": "Freed block marked as non-accessible had access attempt",
Expand All @@ -76,7 +76,7 @@
"critical section has not been deleted",
"0x202": "A heap allocation contains a critical section, the allocation is freed, and the critical section "
"has not been deleted",
"0x203": "Typicaly means a critical section has been initialized more than once. May mean the critical section "
"0x203": "Typically means a critical section has been initialized more than once. May mean the critical section "
"or its debug information structure has been corrupted",
"0x204": "Memory containing a critical section was freed but the critical section has not been deleted using 'DeleteCriticalSection'",
"0x205": "The DebugInfo field of the critical section is pointing to freed memory",
Expand All @@ -92,8 +92,8 @@
"0x215": "The current thread tries to use a private lock that lives inside another DLL"
},
"Memory": {
"0x600": "AppVerifier detects a VirtualFree or a DLL unload with an invalid start adress or size of the memory allocation",
"0x601": "AppVerifier detects a VirtualAlloc call with an invalid start adress or size of the memory allocation",
"0x600": "AppVerifier detects a VirtualFree or a DLL unload with an invalid start address or size of the memory allocation",
"0x601": "AppVerifier detects a VirtualAlloc call with an invalid start address or size of the memory allocation",
"0x602": "AppVerifier detects a MapViewOfFile call with an invalid base address or size of the mapping",
"0x603": "AppVerifier detects an IsBadXXXPtr call with an invalid address for the memory buffer to be probed",
"0x604": "AppVerifier detects an IsBadXXXPtr call for a memory allocation that is free",
Expand All @@ -107,7 +107,7 @@
"0x60C": "AppVerifier detects a VirtualFree with a non-zero value for the dwSize parameter",
"0x60D": "A DLL's entry point function is raising an exception",
"0x60E": "A thread function is raising an exception",
"0x60F": "An exception occured during an IsBadXXXPtr call",
"0x60F": "An exception occurred during an IsBadXXXPtr call",
"0x610": "AppVerifier detects a VirtualFree call with a NULL first parameter",
"0x612": "AppVerifier detects a HeapFree for a block of memory that is actually part of the current thread's stack",
"0x613": "AppVerifier detects an UnmapViewOfFile for a block of memory that is actually part of the current thread's stack",
Expand All @@ -120,13 +120,13 @@
"the VirtualAlloc or VirtualAllocEx function when the region of pages was reserved",
"0x61A": "The program is calling UnmapViewOfFile with an IpBaseAddress parameter that is not identical to the value returned"
"by a previous call to the MapViewOfFile or MapViewOfFileEx function",
"0x61B": "A callback function in the threadpool thread is rasing an exception",
"0x61B": "A callback function in the threadpool thread is raising an exception",
"0x61C": "The application is trying to run code from an address that is non-executable or free",
"0x61D": "The application is created an executable heap",
"0x61E": "The application is allocating executable memory"
},
"SRWLock": {
"0x250": "A thread tried to use SRW lock that is not initalized",
"0x250": "A thread tried to use SRW lock that is not initialized",
"0x251": "The SRW lock is being re-initialized",
"0x252": "The SRW lock is being released with a wrong release API",
"0x253": "The SRW lock is being acquired recursively by the same thread",
Expand Down
2 changes: 1 addition & 1 deletion source/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static struct aws_error_info errors[] = {
"Invalid thread settings."),
AWS_DEFINE_ERROR_INFO_COMMON(
AWS_ERROR_THREAD_INSUFFICIENT_RESOURCE,
"Insufficent resources for thread."),
"Insufficient resources for thread."),
AWS_DEFINE_ERROR_INFO_COMMON(
AWS_ERROR_THREAD_NO_PERMISSIONS,
"Insufficient permissions for thread operation."),
Expand Down
2 changes: 1 addition & 1 deletion source/hash_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static void s_suppress_unused_lookup3_func_warnings(void) {
/**
* Calculate the hash for the given key.
* Ensures a reasonable semantics for null keys.
* Ensures that no object ever hashes to 0, which is the sentinal value for an empty hash element.
* Ensures that no object ever hashes to 0, which is the sentinel value for an empty hash element.
*/
static uint64_t s_hash_for(struct hash_table_state *state, const void *key) {
AWS_PRECONDITION(hash_table_state_is_valid(state));
Expand Down
2 changes: 1 addition & 1 deletion source/json.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct aws_json_value *aws_json_value_new_string(struct aws_allocator *allocator
}

struct aws_json_value *aws_json_value_new_string_from_c_str(struct aws_allocator *allocator, const char *string) {
(void)allocator; /* No need for allocator. It is overriden through hooks. */
(void)allocator; /* No need for allocator. It is overridden through hooks. */
void *ret_val = cJSON_CreateString(string);
return ret_val;
}
Expand Down
2 changes: 1 addition & 1 deletion source/memtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static void s_alloc_tracer_track(struct alloc_tracer *tracer, void *ptr, size_t
* With optimizations on we cannot trust the stack trace too much.
* Memtracer makes an assumption that stack trace will be available in all cases if stack trace api
* works. So in the pathological case of stack_depth <= FRAMES_TO_SKIP lets record all the frames we
* have, to at least have an anchor for where allocation is comming from, however inaccurate it is.
* have, to at least have an anchor for where allocation is coming from, however inaccurate it is.
*/
if (stack_depth <= FRAMES_TO_SKIP) {
memcpy((void **)&stack->frames[0], &stack_frames[0], (stack_depth) * sizeof(void *));
Expand Down
2 changes: 1 addition & 1 deletion source/posix/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ int aws_thread_launch(
s_thread_wrapper_destroy(wrapper);
if (options && options->cpu_id >= 0) {
/*
* `pthread_create` can fail with an `EINVAL` error or `EDEADLK` on freebasd if the `cpu_id` is
* `pthread_create` can fail with an `EINVAL` error or `EDEADLK` on FreeBSD if the `cpu_id` is
* restricted/invalid. Since the pinning to a particular `cpu_id` is supposed to be best-effort, try to
* launch a thread again without pinning to a specific cpu_id.
*/
Expand Down
Loading
Loading